v1

latestOpenAPI 3.1.02026-08-04751,1671.3 MB
Swaps

Predict Transaction

Simulate the spot swap and changes in token balances, in addition to the fee estimation.

post/api/v1/swaps/predict

Request body

quote_idstring uuid required

The ID of the quote.

vault_idstring uuid required

The unique identifier of the vault.

amountstring required

The amount to swap.

slippage_bpsstring

The slippage tolerance in basis points.

should_run_policy_checkboolean

Should run a policy check

fail_on_prediction_failureboolean

True if transaction creation should fail in case prediction failed, False otherwise. <br> In case simulation has failed upon continuation, the expected result of the transaction will be partial and policy will be applied on information that can be extracted statically from the transaction only. This might result in falling back to the default policy rule.

use_mev_protected_nodeboolean

Use a MEV protected node to send the transaction. By using a MEV protected node, you avoid maximal extractable value (MEV) attacks.

Example request

{
  "input_asset_identifier": {
    "details": {
      "token": {
        "base58_repr": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
      }
    }
  },
  "output_asset_identifier": {
    "details": {
      "token": {
        "base58_repr": "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
      }
    }
  },
  "amount": "1000000000000000000",
  "slippage_bps": "1000000000000000000",
  "fee": {
    "details": {
      "gas_limit": "1000000000000000000"
    }
  }
}

Response

Successful Response

OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR