POST
/
v1
/
route-swap
Execute Route Swap
curl --request POST \
  --url https://api.amm.flashnet.xyz/v1/route-swap \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "hops": [
    {
      "assetInAddress": "03bitcoinassetpubkey0000000000000000000000000000000000000000000000",
      "assetOutAddress": "03ethereumassetpubkey1111111111111111111111111111111111111111111111",
      "hopIntegratorFeeRateBps": "50",
      "poolId": "03pool1aabbccddeeff00112233445566778899aabbccddeeff00112233445566778"
    },
    {
      "assetInAddress": "03ethereumassetpubkey1111111111111111111111111111111111111111111111",
      "assetOutAddress": "03usdstablecoinpubkey2222222222222222222222222222222222222222222222",
      "hopIntegratorFeeRateBps": "50",
      "poolId": "03pool2bbccddeeffffaabbccddeeff00112233445566778899aabbccddeeff0011"
    }
  ],
  "initialSparkTransferId": "spark-transfer-uuid-or-hash-for-initial-deposit",
  "inputAmount": "100000000",
  "integratorFeeRateBps": "100",
  "integratorPublicKey": "03aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899",
  "maxRouteSlippageBps": "200",
  "minAmountOut": "100000000",
  "nonce": "unique-route-swap-nonce-456",
  "signature": "3045022100a7e5d4f8b2c9a1e6f0d5b8c4a9e7f2d1c8b5a4e9f0d6c5b3a2e1d0c9b8a7f02201f2e3d4c5b6a7980e9f0a1b2c3d4e5f67889a0b1c2d3e4f5a6b7c8d9e0f1a2b3",
  "userPublicKey": "02abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567"
}'
{
"accepted": false,
"error": "Insufficient liquidity in hop 2",
"executionPrice": "0",
"finalOutboundTransferId": "",
"outputAmount": "0",
"refundTransferId": "spark-transfer-refund-999",
"refundedAmount": "100000000",
"refundedAssetPublicKey": "03bitcoinassetpubkey0000000000000000000000000000000000000000000000",
"requestId": "01HJZKFABCDEFGHJKLMNPQRSTVW"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Route swap execution details including hop sequence and authentication

Defines the request to execute a swap across a defined route of liquidity pools.

Response

200
application/json

Route swap execution successful

Represents the response after a route swap execution attempt.