Encode an Ondo swap for broadcast
Encodes the buy the user just confirmed and returns calldata their wallet can sign and broadcast, plus the amounts it commits to. This is the commit step: it consumes an attestation and the calldata expires, so call it once per confirmation and never poll it. Approve the swap contract for the full amount first; an allowance short of it is rejected here rather than reverting on-chain. The addresses are resolved from the offer, so the request names the asset, not the tokens.
Authorizations
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.
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.
"100000000"
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.
ethereum_sepolia, base_sepolia, ethereum_mainnet, base_mainnet "ethereum_sepolia"
Ondo asset symbol to buy
"AAPLon"
Wallet that will broadcast the transaction. The calldata is signed over it, so no other wallet can send it.
"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.
broadcast_transaction The encoded swap to broadcast on-chain
"0x0c89df8c"
When the signed calldata stops being accepted. Broadcast before this or request a new transaction; a late send reverts.
"2025-01-01T00:00:00.000000Z"
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.
"0"
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.
"100000000"
Total the purchase costs, fee included, as a uint256 decimal string in the funding token's smallest unit. The approval has to cover this.
"100000000"
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.
6
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.
"264000000000000000"
Decimals receive_output_amount is denominated in, reported by whatever priced the quantity rather than looked up separately.
18
The swap contract to submit the transaction to
"0xff9c5ade32d9b4102469bd5f3817cb0061b25fec"