yieldaggregator
Swap
Executes token swaps within a yield aggregator protocol, providing transaction metadata (chain ID, addresses, gas, reference ID). Configurable slippage, swap path, and gas priority let users tailor swaps to market conditions.
💡 Compute Unit Value: 95 (Fixed)
post/defi/v1/yieldaggregator/swap
Request
- Base URLhttps://svc.blockdaemon.com
- URLhttps://svc.blockdaemon.com/defi/v1/yieldaggregator/swap
- AuthAPI key in header X-API-Key
Request body
Example request
{
"yieldAggregatorId": "5200",
"marketAddress": "0xcdd26eb5eb2ce0f203a84553853667ae69ca29ce",
"from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
"path": [
"0x514910771AF9Ca656af840dff83E8264EcF986CA",
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
],
"amountIn": "1000000000000000000",
"slippage": "10",
"gas": "100000",
"enableAggregator": false,
"gasPriority": "low",
"enableFee": false
}Response
Successful response
Example response
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xdae2f6eddda6fb4fb60cc02633de27e2b431b402",
"to": "0x888888888889758F76e7103c6CbF23ABbF58F946",
"value": "0",
"gas": "1000000",
"data": "0x2a50917c000000000000000000000000dae2f6eddda6fb4fb60cc02633de27e2b431b402000000000000000000000000b451a36c8b6b2eac77ad0737ba732818143a0e250000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000089f69f2983fe3071000000000000000000000000000000000000000000000000489cbf8f1d0c8549000000000000000000000000000000000000000000000000b587dee5c89f4d3600000000000000000000000000000000000000000000000091397f1e3a190a92000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"estimationCheck": "Returned error: execution reverted: ERC20: insufficient allowance",
"referenceId": "8d5b7f177bf541d385f723d4891a792e"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.