DeFi API Execution Reference
Quotes
Get the Best Quote
Retrieve the best available swap quote for a given source token, destination token, and amount. This endpoint returns pricing details, limits, and metadata required to proceed with a swap.
Quotes are time-limited and must be executed before they expire.
POST /v1/quotes
Request body structure:
| Name | Type | Required | Description |
|---|---|---|---|
from | Object | Required | Base token information for receiveing quote. |
token_id | Number | Conditional required | Part of from object. Required only if network_id and token are not provided. For receiveing token_id use the GET /v1/tokens endpoint. |
network_id | Number | Conditional required | Part of from object. Required only if token_id is not provided. For receiveing network_id use the GET /v1/networks endpoint. |
token | String | Conditional required | Part of from object. Required only if token_id is not provided. |
to | Object | Required | Quote token information for receiveing quote. |
token_id | Number | Conditional required | Part of to object. Required only if network_id and token are not provided. For receiveing token_id use the GET /v1/tokens endpoint. |
network_id | Number | Conditional required | Part of to object. Required only if token_id is not provided. For receiveing network_id use the GET /v1/networks endpoint. |
token | String | Conditional required | Part of to object. Required only if token_id is not provided. |
amount | Number | Required | Amount to swap, must be specified in decimal-adjusted format. |
slippage_bps | String | Required | Slippage expressed in basis points. |
Request body example:
{
"from": {
"token_id": 1
},
"to": {
"token_id": 4
},
"amount": 100,
"slippage_bps": "50"
}
Response example:
{
"id": "bea66e69-64c3-4b88-96ac-29f1ce7d454d",
"from": {
"network_id": 1,
"token": "0xdac17f9********13d831ec7",
"token_id": 1,
"amount_lots": 100000000,
"amount_decimals": 6
},
"mid": {
"token_id": null,
"token": null,
"token_min_amount": null,
"token_max_amount": null,
"token_decimals": null
},
"to": {
"network_id": 4,
"token": "0xdac17f9********13d831ec7",
"token_id": 4,
"min_amount_lots": 857382336,
"max_amount_lots": 861690790,
"amount_decimals": 9
},
"slippage_bps": "50",
"expires_at": 1769777954084
}
Quote Expiry
The expires_at field is a Unix timestamp in milliseconds (ms since epoch). After this timestamp, the quote is no longer valid and must be refreshed. Quotes should always be executed before expiry to guarantee pricing.
Middle Token Routing
If the user attempts to swap a volatile token, the system may automatically route the swap through a highly liquid intermediate token, typically USDC, to improve execution reliability and manage price volatility. All fields prefixed within mid response object describe this routing behavior and the token used internally.
Affiliate fees
To set your reward amount, please contact your manager or reach out to us at [email protected].
Intents
An intent represents a user's request to perform a swap and can only be created based on a quote, to which it is attached. It defines what the user wants to do, while the protocol handles how it gets executed.
Intents are chain-agnostic and support multiple blockchains and approval mechanisms.
Intent lifecycle
A typical intent goes through the following steps:
- Creation - An intent is created via the API with swap parameters such as source chain, destination chain, tokens, and amounts.
- Approval - The user authorizes fund usage using a chain-specific approval mechanism (for example, Permit2 on EVM, PSBT on Bitcoin, Cosigned transaction on Solana).
- Execution - Once approved, the resolver processes the intent and executes the swap.
- Status tracking - The intent status can be queried at any time to track progress or final outcome.
Create Intent
Create a new swap intent that describes what the user wants to swap. An intent is created off-chain and later executed on-chain by a resolver.
POST /v1/intents
Request body structure:
| Name | Type | Required | Description |
|---|---|---|---|
quote_id | String | Optional | For some providers this field is mandatory. |
from | Object | Required | Base token information for intent creation. |
address | String | Required | Part of from object. Sender address. |
network_id | Number | Conditional required | Part of from object. Required only if token_id is not provided. For receiveing network_id use the GET /v1/networks endpoint. |
token | String | Conditional required | Part of from object. Required only if token_id is not provided. |
token_id | Number | Conditional required | Part of from object. Required only if network_id and token are not provided. |
public_key | String | Optional | Part of from object. Field required only if source chain is Bitcoin or Solana. |
to | Object | Required | Quote token information for intent creation. |
address | String | Required | Part of to object. Receiver address. |
token_id | Number | Conditional required | Part of to object. Required only if network_id and token are not provided. For receiveing token_id use the GET /v1/tokens endpoint. |
network_id | Number | Conditional required | Part of to object. Required only if token_id is not provided. For receiveing network_id use the GET /v1/networks endpoint. |
token | String | Conditional required | Part of to object. Required only if token_id is not provided. |
refund_address | String | Required | Address for potential refund. |
amount | Number | Required | Amount to swap, must be specified in decimal-adjusted format. |
slippage_bps | String | Required | Slippage expressed in basis points. |
Request example:
{
"quote_id": "bea66e69-64c3-4b88-96ac-29f1ce7d454d",
"from": {
"from_network_id": 1,
"from_token": "0xc02aaa3********9083c756cc2",
"from_address": "0x000000000000000000000000000000000000000"
},
"to": {
"to_network_id": 4,
"to_token": "So11111111111111111111111111111111111111112",
"to_address": "0x000000000000000000000000000000000000000"
},
"refund_address": "0x000000000000000000000000000000000000000",
"amount": 100,
"slippage_bps": "50"
}
Response example (EVM and Tron):
{
"id": "8a2d3f92-2a2b-4e4c-9d8a-3c9f92e4a111",
"deadline_at": 1761545456,
"approval_type": "permit2",
"params_to_sign": {
"escrow_contract_address": "0x000000000000000000000000000000000000000",
"permit2_contract_address": "0x000000000000000000000000000000000000000",
"resolver_deposit_address": "0x000000000000000000000000000000000000000",
"nonce": 10000,
"additional_data": {
"domain": { /* EIP-712 domain data */ },
"types": { /* EIP-712 types */ },
"witness": { /* witness data */ },
"witness_type_string": "ExampleTrade witness)ExampleTrade(address exampleTokenAddress,uint256 exampleMinimumAmountOut)",
"witness_hash": "0x000000000000000000000000000000000000000000000000000000000000000"
}
}
}
Approval Mechanism
The approval flow depends on the blockchain and swap type. The value of approval_type may change, and the structure of params_to_sign depends on the selected approval mechanism. Clients must always check approval_type and handle params_to_sign accordingly.
Approval Mechanism Examples:
Permit2 (used for EVM-based blockchains):
{
"id": "528d72ae-61cd-4fbc-9940-48ce4104abbb",
"deadline_at": 1772124002,
"secret_hash": "0x19875e12d834bc24********44dd26f37d367a44926",
"approval_type": "permit2",
"params_to_sign": {
"escrow_contract_address": "0x8DcbE1aCf********18F8e8836",
"permit2_contract_address": "0x0000000********6B43aC78BA3",
"resolver_deposit_address": "0xF3B3a4edB********f69f557029",
"nonce": 499,
"additional_data": {
"domain": { /* EIP-712 domain data */ },
"types": { /* EIP-712 types */ },
"witness": { /* witness data */ },
"secretHash": "0xabcde...",
"witness_type_string": "DepositWitness witness)DepositWitness(address resolverDepositAddress,bytes32 secretHash,uint256 deadline)TokenPermissions(address token,uint256 amount)",
"witness_hash": "0xc77ff4a96e********b8c12636c39f7f"
}
}
}
HTLC (used for Bitcoin blockchain):
{
"id": "0a47fbd6-056a-4e4d-a1e3-9b9a1bf947e5",
"approval_type": "htlc",
"params_to_sign": {
"psbt": "cHNidP8BAJ0CAAAAAQEBAQEB...",
"inputs": [0, 1, 2]
}
}
Cosigned transaction (used for Solana blockchain):
{
"id": "0a47fbd6-056a-4e4d-a1e3-9b9a1bf947e5",
"deadline_at": 1772124152,
"secret_hash": "0x84edcf7********dd0fb60baccf",
"approval_type": "cosign",
"params_to_sign": {
"transaction": "02000..."
}
}
Approvals
After an intent is created, an approval must be added before it can be executed. This endpoint attaches a signed approval to an existing intent. The approval proves the user has authorized the swap and allows it to proceed.
You can find examples of how to generate the approval signed data on this page.
POST /v1/intents/{intent_id}/approvals
Request Body
The request body depends on the approval mechanism. It includes the approval type and the signed data generated by the user.
| Name | Type | Required | Description |
|---|---|---|---|
approval_type | String | Required | Options between permit2, cosign, htlc depends on the network. |
signed_data | String | Required | Signed data generated by the user via connected wallet. |
Permit2 (EVM):
{
"approval_type": "permit2",
"signed_data": "0x..."
}
PSBT (Bitcoin):
{
"approval_type": "psbt",
"signed_data": "cHNid..."
}
Cosign (Solana):
{
"approval_type": "cosign",
"signed_data": {
"transaction": "02000...",
"user_address": "F8ZRdxv********ETTDFg"
}
}
Retrieving Intent Status
This endpoint allows you to check the current status of a swap intent. It provides the intent's lifecycle state, associated transactions, and additional metadata.
GET /v1/intents/{intent_id}
Response Example:
{
"intent_id": "fe5601fb-60f2-4cb0-8a67-c55bd3640411",
"status": "Deposited",
"from_amount_lots": "123456",
"from_network_id": 1,
"from_token": "0x000000000000000000000000000000000000000",
"from_token_id": 1,
"to_network_id": 2,
"to_token": "0x000000000000000000000000000000000000000",
"to_token_id": 4,
"to_min_amount_lots": "123456",
"to_max_amount_lots": "123456",
"swap_metadata": {
"id": "19b44362-bc4d-4b2e-824f-f712c6c80eff",
"proxy_address": "0x000000000000000000000000000000000000000",
"user_deposit_tx": "0x000000000000000000000000000000000000000",
"fulfill_tx": null,
"swap_tx": null,
"created_at": "2026-01-15T12:00:00Z",
"user_deposited_at": "2026-01-15T12:05:00Z",
"fulfilled_at": null,
"swapped_at": null,
"refunded_at": null
}
}
The status field represents the overall progress of the swap, combining both intent and swap state.
Possible swap statuses:
| Status | Description |
|---|---|
| Created | The intent has been created but no approval has been added yet. |
| Approved | User has added approval/signature for the swap. |
| Verified | Resolver has accepted the intent and is ready to execute. |
| Failed | The intent was declined by the resolver. |
| Deposited | Resolver has deposited user tokens on source network into the escrow. |
| Finished | User has received funds on destination network in target token. |
| Expired | The intent expired before execution. |
| Refunded | Tokens have been refunded to the user. |
Additional Notes:
- Use this endpoint to poll the status of an intent or check its progress.
swap_metadataprovides transaction hashes and timestamps to track each stage.