Step 2 — Create Swap Payload
Build the swap payload using the route selected in Step 1.
Endpoint
See the REST API reference: Swap
Minimal request example
curl -X 'POST' \
'https://testnet.api.euclidprotocol.com/api/v1/execute/swap' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"amount_in": "1000000",
"asset_in": {
"token": "euclid",
"token_type": { "native": { "denom": "ueuclid" } }
},
"slippage": "50",
"recipients": [
{
"user": {
"chain_uid": "neutron",
"address": "neutron1..."
},
"amount": {
"dynamic": "true"
}
}
],
"sender": {
"chain_uid": "neutron",
"address": "neutron1..."
},
"swap_path": {
"path": [
{
"route": ["euclid", "bnb"],
"dex": "euclid",
"chain_uid": "vsl",
"amount_in": "1000000",
"amount_out": "..."
}
]
}
}'
Required validation before submit
swap_pathis exactly the selected route from Step 1.sendermatches the signing wallet context.recipientscontains the intended destination chain and address.recipients[].amountis set for each recipient (dynamicis recommended when exact output is unknown before execution).
Next step: Broadcast.