v1

latestOpenAPI 3.1.02026-08-04751,1671.3 MB
Swaps

Create Transaction

Create a new spot swap.

post/api/v1/swaps

Headers

x-signaturestring

Signature of the body. Base64 encoded string. If the request is made programatically by an API user, signing of the request is required and is intended to protect you from malicious backends. x_signature is valid for 120 seconds.

Example:SGVsbG8=

Signature of the body. Base64 encoded string. If the request is made programatically by an API user, signing of the request is required and is intended to protect you from malicious backends. x_signature is valid for 120 seconds.

x-timestampinteger

Timestamp of the signature. Integer. Specify an Epoch date. If the request is made programatically by an API user, the timestamp of the request is required and is intended to protect you from replay attacks.

Timestamp of the signature. Integer. Specify an Epoch date. If the request is made programatically by an API user, the timestamp of the request is required and is intended to protect you from replay attacks.

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.

signer_type'initiator' | 'api_signer' | 'end_user' | 'multiple_signers' | 'api_user'
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_secure_nodeboolean

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

use_mev_protected_nodeboolean

Use an MEV protected node to send the transaction. By using an 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