Skip to main content
POST
Encode an Ondo swap for broadcast

Authorizations

Authorization
string
header
required

OAuth 2.0 authorization and token endpoints

Body

Ondo swap transaction params

The buy to encode: an asset, the wallet buying it, and what it pays.

amount
string
required

Gross amount to pay, as a uint256 decimal string in the funding token's smallest unit. This is the figure to approve: the CoinList fee comes off it, and Ondo prices the remainder.

Example:

"100000000"

chain
enum<string>
required

The EVM chain to swap on. Only chains CoinList has deployed a swap contract on are accepted, which is narrower than both this enum and the chains the on-chain reads serve.

Available options:
ethereum_sepolia,
base_sepolia,
ethereum_mainnet,
base_mainnet
Example:

"ethereum_sepolia"

symbol
string
required

Ondo asset symbol to buy

Example:

"AAPLon"

wallet_address
string
required

Wallet that will broadcast the transaction. The calldata is signed over it, so no other wallet can send it.

Example:

"0x2c4c7082a135f6b980cdae4b40c3ebf72cd4a512"

Response

Successful response.

A signed, ready-to-broadcast Ondo swap and the amounts it commits to. Unlike the quote, this spends an attestation and expires, so call it once the user has confirmed and never on a timer.

action
enum<string>
required
Available options:
broadcast_transaction
data
string
required

The encoded swap to broadcast on-chain

Example:

"0x0c89df8c"

expires_at
string<date-time>
required

When the signed calldata stops being accepted. Broadcast before this or request a new transaction; a late send reverts.

Example:

"2025-01-01T00:00:00.000000Z"

fee
string
required

CoinList's cut of pay_input_amount, in the same units. Taken at execution, not on top, so the wallet never approves more than pay_input_amount.

Example:

"0"

notional_value
string
required

The part of pay_input_amount that reaches Ondo, in the same units. This is what the quantity was priced against, and the signature commits to it.

Example:

"100000000"

pay_input_amount
string
required

Total the purchase costs, fee included, as a uint256 decimal string in the funding token's smallest unit. The approval has to cover this.

Example:

"100000000"

pay_input_decimals
integer
required

Decimals pay_input_amount, fee and notional_value are denominated in, read on-chain from the funding token. The token is resolved from the offer rather than named by the caller, so this is the only place its scale is published.

Example:

6

receive_output_amount
string
required

Quantity of the asset the wallet receives, as a uint256 decimal string in the asset's smallest unit. Divide by 10^receive_output_decimals to display whole tokens.

Example:

"264000000000000000"

receive_output_decimals
integer
required

Decimals receive_output_amount is denominated in, reported by whatever priced the quantity rather than looked up separately.

Example:

18

to
string
required

The swap contract to submit the transaction to

Example:

"0xff9c5ade32d9b4102469bd5f3817cb0061b25fec"