Vault Swap Transaction Payloads
Details
The deposit-address flow in Starting a Swap gives you an address the user sends funds to. A vault swap goes one step further: the API returns an unsigned transaction for the source chain, and your application (or a wallet SDK) signs and submits it. The user never has to copy a deposit address, and you control the transaction from end to end.
Each source chain has its own endpoint. All four are GET requests, take the same core parameters, and return the payload fields your chain library expects. They are intentionally left out of the interactive API reference; this page is their documentation.
API Endpoints
/tx-payload/bitcoin- Bitcoin, returns an OP_RETURN nulldata payload./tx-payload/evm- Ethereum and Arbitrum, returns calldata for the vault contract./tx-payload/solana- Solana, returns the program, accounts and instruction data./tx-payload/tron- Tron, returns calldata for the vault contract.
Parameters
Every endpoint requires:
apiKey- Your API key.sourceAsset- The asset to swap from, for examplebtc.btc.destinationAsset- The asset to swap to, for exampleeth.eth.destinationAddress- The address on the destination chain to swap to.minimumPrice- The minimum accepted price in human-readable form. Same calculation as theminimumPriceon/swap.refundAddress- Address on the source chain to which the refund will be sent, if the minimum price cannot be met.retryDurationInBlocks- Number of blocks (6 seconds each) after which a deposit is refunded if the minimum price cannot be met. Maximum14400(24 hours).
Two parameters differ per chain:
- Bitcoin uses
destinationMinimumAmount- the minimum output amount in the smallest native unit of the output asset. - EVM, Solana and Tron use
sourceAmount- the amount of the source asset in its smallest native unit.
Optional parameters:
commissionBps- Override to the charged commission, within Commission Protection.boostFee- Maximum accepted boost fee in basis points for Bitcoin swaps.numberOfChunksandchunkIntervalBlocks- DCA parameters, EVM, Solana and Tron only.
Response
The response is an unsigned payload which your code signs and submits on the source chain:
- Bitcoin:
network,nulldataPayload(hex data for an OP_RETURN output) anddepositAddress. Build one transaction that sends the amount todepositAddresswith an OP_RETURN output carryingnulldataPayload. - EVM:
to(the vault contract),calldata,valueand, for ERC-20 sources,sourceTokenAddress(approve that token first). - Solana:
programId,accountsanddatafor the instruction. - Tron:
to,calldata,value,noteandsourceTokenAddress.
After the transaction is confirmed on the source chain, follow the swap with Get Swap Status, by deposit channel or transaction hash, exactly like a regular swap.
Error Responses
Failures use the same RFC 7807 problem details shape as the other endpoints, including the machine-readable code on upstream failures. See Error Codes.
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.6.4",
"title": "Service Unavailable",
"status": 503,
"detail": "Too many swaps are ongoing right now, please try again later",
"traceId": "00-6e04726aca44787669d57a48b1833007-ddd09a1fe1f24426-00",
"code": "too_many_channels"
}