{ "route": { "amount_in": "<string>", "amount_out": "<string>", "min_received": "<string>", "destination": "<string>", "swap_type": 123 }, "swap_parameters": [ { "token_in": "<string>", "token_out": "<string>", "rate": "<string>", "protocol_id": "<string>", "pool_address": "<string>", "swap_type": 123, "extra_data": "<string>" } ], "calldata": "<string>", "to": "<string>", "value": "<string>" }
Execute a token swap using the optimal route
https://api.fibrous.finance/base/execute
/route
0.5
Show child attributes
curl -X POST "https://api.fibrous.finance/base/execute" \ -H "Content-Type: application/json" \ -d '{ "route": { "success": true, "inputToken": { "name": "Wrapped Ether", "address": "0x4200000000000000000000000000000000000006", "decimals": 18, "price": 3171.37 }, "outputToken": { "name": "USD Coin", "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "decimals": 6, "price": 0.99971 }, "inputAmount": "1000000000000000000", "outputAmount": "3165007379", "route": [...] }, "slippage": 0.5, "destination": "0x1234567890123456789012345678901234567890" }'
{ "route": { "amount_in": "1000000000000000000", "amount_out": "3165007379", "min_received": "3149182360", "destination": "0x1234567890123456789012345678901234567890", "swap_type": 0 }, "swap_parameters": [ { "token_in": "0x4200000000000000000000000000000000000006", "token_out": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "rate": "3165007379", "protocol_id": "9", "pool_address": "0x72ab388e2e2f6facef59e3c3fa2c4e29011c2d38", "swap_type": 0, "extra_data": "0x0064" } ], "calldata": "0x...", "to": "0x274602a953847d807231d2370072f5f4e4594b44", "value": "1000000000000000000" }
Route Expired
{ "error": "Route expired", "message": "The provided route is no longer valid. Please fetch a new route." }
Insufficient Liquidity
{ "error": "Insufficient liquidity", "message": "Not enough liquidity available for this swap amount." }
Invalid Slippage
{ "error": "Invalid slippage", "message": "Slippage must be between 0.1 and 100" }