Wen API Reference
Get Quote
POST
/protocol/get-protocol-quotes
Fetch the quote for buying tokens listed on Wen.markets.
Base URL
https://api.pod.routerintents.com
Body
{
"ReceiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
"SourceTokens": [
{
"chainId": "10",
"address": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"name": "USDC",
"symbol": "USDC",
"decimals": 6
}
],
"DestinationTokens": [
{
"chainId": "137",
"address": "0x2f89e67606290a9068A681A452f2AD8855087166",
"name": "KID JOKER",
"symbol": "KIDJ",
"decimals": 18
}
],
"Amount": [
"18000000"
],
"SourceChainId": 10,
"Protocol": [
{
"protocolId": "wen",
"chainId": "137",
"action": "swap"
}
]
}
Wen.markets Protocol Data
// For protocol, pass the following:
{
"protocolId": "wen",
"chainId": "137",
"action": "swap",
}
Response
200: Success
{
"Code": 0,
"Errors": [],
"PayLoad": {
"appId": "0",
"quotationType": "BatchTransaction",
"feeParams": [
{
"fee": "9000",
"recipient": "0x00EB64b501613F8Cf8Ef3Ac4F82Fc63a50343fee",
"decimals": 6,
"symbol": "USDC",
"tokenAddress": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"chainId": 10,
"name": "USDC",
"adapter": "batch-handler"
}
],
"slippageTolerance": 2,
"sourceTokens": [
{
"chainId": "10",
"address": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"name": "USDC",
"symbol": "USDC",
"decimals": 6
}
],
"amount": [
"18000000"
],
"sourceChainId": 10,
"destinationChainId": 137,
"destinationToken": {
"chainId": "137",
"address": "0x2f89e67606290a9068A681A452f2AD8855087166",
"name": "KID JOKER",
"symbol": "KIDJ",
"decimals": 18
},
"adapters": [
{
"adapterId": "nitro_bridge",
"adapterType": "bridge",
"sourceChainId": 10,
"destChainId": "137",
"adapterOptions": {
"srcToken": {
"chainId": "10",
"address": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"name": "USDC",
"symbol": "USDC",
"decimals": 6
},
"amountIn": "17991000",
"amountOut": "43664305655285055488",
"destToken": {
"chainId": "137",
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"name": "MATIC",
"symbol": "MATIC",
"decimals": 18,
"resourceID": "",
"isMintable": false,
"isWrappedAsset": false
},
"receiverAddress": "0x6e19dc0107F1aE2C0C31dce91716249cD6AD101A",
"data": {
"actionType": 1,
"refundAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
"partnerId": 0,
"tokens": [
"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"0x4200000000000000000000000000000000000006"
],
"bridgeFee": {
"amount": "5777338603664",
"decimals": 18,
"symbol": "WETH",
"address": "0x4200000000000000000000000000000000000006"
},
"isMainnet": true,
"quotationParams": {
"fromTokenAddress": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"toTokenAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"amount": "17991000",
"fromTokenChainId": 10,
"toTokenChainId": "137",
"additionalGasLimit": 160000,
"slippageTolerance": 2
},
"forwarderQuotation": {
"flowType": "trustless",
"isTransfer": "false",
"isWrappedToken": false,
"allowanceTo": "0x5501A36b1313aC5d27e85418acd2AA4564f50b44",
"bridgeFee": {
"amount": "5777338603664",
"decimals": 18,
"symbol": "WETH",
"address": "0x4200000000000000000000000000000000000006"
},
"fuelTransfer": null,
"fromTokenAddress": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"toTokenAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"source": {
"chainId": "10",
"chainType": "evm",
"asset": {
"decimals": 6,
"symbol": "USDC",
"name": "USDC",
"chainId": "10",
"address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"resourceID": "usdc-circle",
"isMintable": false,
"isWrappedAsset": false,
"isReserveAsset": false,
"tokenInstance": {
"decimals": 6,
"symbol": "USDC",
"name": "USDC",
"chainId": 10,
"address": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"
}
},
"stableReserveAsset": {
"decimals": 18,
"symbol": "WETH",
"name": "WETH",
"chainId": "10",
"address": "0x4200000000000000000000000000000000000006",
"resourceID": "native-eth",
"isMintable": false,
"isWrappedAsset": false,
"isReserveAsset": false
},
"tokenAmount": "17991000",
"stableReserveAmount": "7244999510187305",
"path": [
"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"0x4200000000000000000000000000000000000006"
],
"flags": [
"4002"
],
"priceImpact": "0.00",
"tokenPath": "USDC->WETH",
"dataTx": [
"0x90411a320000000000000000000000002691f337abeb0146f16441ca4f82f363275851d5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff8500000000000000000000000042000000000000000000000000000000000000060000000000000000000000002691f337abeb0146f16441ca4f82f363275851d50000000000000000000000005501a36b1313ac5d27e85418acd2aa4564f50b4400000000000000000000000000000000000000000000000000000000011285580000000000000000000000000000000000000000000000000019bd49e633dd290000000000000000000000000000000000000000000000000019ffd8de2f37510000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d2137a6d0ef438a7c2bb38eeef364500271658be000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d90000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85000000000000000000000000ff202313e26974cfc4ab0121c485ba54303a2e41000000000000000000000000000000000000000000000000000000000112855800000000000000000000000000000000000000000000000000000000000000000000000000000000ff202313e26974cfc4ab0121c485ba54303a2e410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000084c31b8d7a0000000000000000000000002691f337abeb0146f16441ca4f82f363275851d50000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000112855800000000000000000000000000000000000000000000000000000001000276a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e850000000000000000000000004200000000000000000000000000000000000006000000000000000000000000353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a00000000000000000000000000000000000000000000000000019ffd8de2f375100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000420000000000000000000000000000000000000600000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f9900000000000000000000000042000000000000000000000000000000000000060000000000000000000000005501a36b1313ac5d27e85418acd2aa4564f50b4400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
]
},
"destination": {
"chainId": "137",
"chainType": "evm",
"asset": {
"chainId": "137",
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"name": "MATIC",
"symbol": "MATIC",
"decimals": 18,
"resourceID": "",
"isMintable": false,
"isWrappedAsset": false
},
"stableReserveAsset": {
"decimals": 18,
"symbol": "WETH",
"name": "Wrapped Ether",
"chainId": "137",
"address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"resourceID": "native-eth",
"isMintable": false,
"isWrappedAsset": false,
"isReserveAsset": false
},
"tokenAmount": "44105359247762688392",
"stableReserveAmount": "7239222171583641",
"priceImpact": "0.00",
"tokenPath": "WETH->WMATIC",
"dataTx": [
"0x90411a320000000000000000000000001e82ad8a12068a85fcb96368463b434e77b21201000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f6190000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000001e82ad8a12068a85fcb96368463b434e77b21201000000000000000000000000c57133521ffbd729cb81cc8ddc12d9e9f61e0f6a0000000000000000000000000000000000000000000000000019b808c1fcc4990000000000000000000000000000000000000000000000025df6c6a66b5897840000000000000000000000000000000000000000000000026415b68e3de289880000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d2137a6d0ef438a7c2bb38eeef364500271658be00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d90000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f6190000000000000000000000000319000133d3ada02600f0875d2cf03d442c33670000000000000000000000000000000000000000000000000019b808c1fcc499000000000000000000000000000000000000000000000000000000000000000000000000000000000319000133d3ada02600f0875d2cf03d442c336700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a402b9446c0000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f6190000000000000000000000001e82ad8a12068a85fcb96368463b434e77b21201000000000000000000000000ccab6b8ca444378541177fa30e32df6a187839de0000000000000000000000000000000000000000000000000019b808c1fcc499000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ccab6b8ca444378541177fa30e32df6a187839de00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000a4627dd56a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000600000000000000000000000007ceb23fd6bc0add59e62ac25578270cff1b9f6190000000000000000000000001e82ad8a12068a85fcb96368463b434e77b21201000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e850000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270000000000000000000000000353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a00000000000000000000000000000000000000000000000026415b68e3de2898800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f8654220000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf127000000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f990000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270000000000000000000000000c57133521ffbd729cb81cc8ddc12d9e9f61e0f6a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
],
"path": [
"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"
],
"flags": [
"4002"
]
},
"partnerId": 0,
"slippageTolerance": "2",
"estimatedTime": 40
},
"destinationAmount": "44105359247762688392",
"destinationAmountPromised": "43664305655285055488"
}
},
"adapters": [
{
"adapterId": "wen_swap",
"adapterType": "swap",
"sourceChainId": "137",
"destChainId": "137",
"adapterOptions": {
"srcToken": {
"chainId": "137",
"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"name": "MATIC",
"symbol": "MATIC",
"decimals": 18,
"resourceID": "",
"isMintable": false,
"isWrappedAsset": false
},
"amountIn": "43664305655285055488",
"amountOut": "3899117791166465780089571",
"destToken": {
"chainId": "137",
"address": "0x2f89e67606290a9068A681A452f2AD8855087166",
"name": "KID JOKER",
"symbol": "KIDJ",
"decimals": 18
},
"receiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
"data": {
"amountSent": "43664305655285055488",
"amountReceived": "3899117791166465780089571",
"amountReceivedInEther": 3899117.7911664657,
"exchangeRate": "0.000011198508994575",
"slippageTolerance": 1,
"partnerId": 0
}
},
"adapters": []
}
],
"fee": {
"fee": "5777338603664",
"recipient": "",
"decimals": 18,
"symbol": "WETH",
"tokenAddress": "0x4200000000000000000000000000000000000006",
"chainId": 10,
"name": "WETH",
"adapter": "nitro_bridge"
}
}
],
"quote": [
{
"amountSent": 17991000,
"amountReceived": "43664305655285055488",
"amountReceivedInEther": "43.664306",
"exchangeRate": "",
"estimatedTime": 40,
"slippageTolerance": "2",
"srcToken": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"destToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"adapterId": "nitro_bridge",
"bridgeFee": {
"amount": "5777338603664",
"decimals": 18,
"symbol": "WETH",
"address": "0x4200000000000000000000000000000000000006"
}
},
{
"amountSent": "43664305655285055488",
"amountReceived": "3899117791166465780089571",
"amountReceivedInEther": 3899117.7911664657,
"exchangeRate": "0.000011198508994575",
"slippageTolerance": 1,
"srcToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"destToken": "0x2f89e67606290a9068A681A452f2AD8855087166",
"adapterId": "wen_swap",
"estimatedTime": 0
}
],
"clientAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
"senderAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
"estimatedTime": 40
}
}
400: Bad Request
{
"Code": 1,
"Error": [
{
"Code": "1",
"Message": [
{
"title": "",
"message": ""
}
]
}
],
"Payload": null
}
Sample cURL
curl --location 'https://api.pod.routerintents.com/router-intent/protocol/get-protocol-quotes' \
--header 'Accept: */*' \
--header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: https://poc-intents-ui.vercel.app' \
--header 'Referer: https://poc-intents-ui.vercel.app/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: cross-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \
--header 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '{
"ReceiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
"SourceTokens": [
{
"chainId": "10",
"address": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"name": "USDC",
"symbol": "USDC",
"decimals": 6
}
],
"DestinationTokens": [
{
"chainId": "137",
"address": "0x2f89e67606290a9068A681A452f2AD8855087166",
"name": "KID JOKER",
"symbol": "KIDJ",
"decimals": 18
}
],
"Amount": [
"18000000"
],
"SourceChainId": 10,
"Protocol": [
{
"protocolId": "wen",
"chainId": "137",
"action": "swap"
}
]
}'
Compose Calldata
POST
/adapter/compose-adapter-calldata
Fetch the calldata to execute the quote fetched via the get-protocol-quotes
endpoint
Base URL
https://api.pod.routerintents.com
Body
Payload object from the response of the get-protocol-quotes
endpoint
Response
{
"Code": 0,
"Errors": [],
"PayLoad": {
"trnxId": "5619175b-32b2-4bc9-8f3a-3534650cc623",
"gasPrice": "818125",
"calldata": "0xabcd",
"to": "0x1047770a9eb317667fAa472Ed2579E6f8dA086c6",
"from": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
"value": "0x00",
"prioritySteps": [],
"gasLimit": "500000"
}
}
{
"Code": 1,
"Error": [
{
"Code": "1",
"Message": [
{
"title": "",
"message": ""
}
]
}
],
"Payload": null
}
Notes:
In the payload,
prioritySteps
will contain the approval transaction calldata that needs to be executed before performing the transaction.The estimated
gasLimit
sent by our APIs are not based on any simulations because it is not possible to simulate gasLimit without having token allowance. ThegasLimit
sent by our APIs is an estimate of the gas that a tx could use. Since the actual gas limit might differ, we suggest that the API users estimate thegasLimit
themselves once the approval tx is mined.
Last updated