Lido API Reference

Get Quote

POST /protocol/get-protocol-quotes

Fetch the quote for staking into Lido from any chain using any token.

Base URL

https://api.pod.routerintents.com

Body

{
    "ReceiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
    "SourceTokens": [
        {
            "chainId": "42161",
            "address": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
            "symbol": "USDT",
            "decimals": 6
        }
    ],
    "Amount": [
        "100000000"
    ],
    "SourceChainId": 42161,
    "Protocol": [
        {
            "protocolId": "lido",
            "chainId": "1",
            "action": "express-stake",
            "poolId": "lido-stEth_1",
            "data": {
                "bridgeChain": "1",
                "bridgePoolId": "lido-stEth"
            }
        }
    ]
}
// For protocol, pass the following:
{
    "protocolId": "lido",
    "chainId": "1",
    "action": "express-stake",
    "poolId": "lido-stEth_1",
    "data": {
        "bridgeChain": "324", // if you want to bridge wstETH to some other chain, else data should be empty
        "bridgePoolId": "lido-stEth" 
        }
}

Response

{
    "Code": 0,
    "Errors": [],
    "PayLoad": {
        "appId": "0",
        "quotationType": "BatchTransaction",
        "slippageTolerance": 2,
        "sourceTokens": [
            {
                "chainId": "42161",
                "address": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
                "symbol": "USDT",
                "decimals": 6
            }
        ],
        "amount": [
            "100000000"
        ],
        "sourceChainId": 42161,
        "destinationChainId": 1,
        "destinationToken": {
            "address": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
            "name": "stETH",
            "symbol": "stETH",
            "decimals": 18
        },
        "adapters": [
            {
                "adapterId": "nitro_bridge",
                "adapterType": "bridge",
                "sourceChainId": 42161,
                "destChainId": "1",
                "adapterOptions": {
                    "srcToken": {
                        "chainId": "42161",
                        "address": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
                        "symbol": "USDT",
                        "decimals": 6
                    },
                    "amountIn": "100000000",
                    "amountOut": "23788845745661004",
                    "destToken": {
                        "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                        "name": "ETH",
                        "symbol": "ETH",
                        "decimals": 18
                    },
                    "receiverAddress": "0x4D9733ca83610E1343Ed2581d1779f294638BB33",
                    "data": {
                        "actionType": 1,
                        "refundAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                        "partnerId": 6,
                        "tokens": [
                            "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
                            "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
                        ],
                        "bridgeFee": {
                            "amount": "4280091678031428",
                            "decimals": 18,
                            "symbol": "WETH",
                            "address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
                        },
                        "isMainnet": true,
                        "quotationParams": {
                            "fromTokenAddress": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
                            "toTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                            "amount": "100000000",
                            "fromTokenChainId": 42161,
                            "toTokenChainId": "1",
                            "partnerId": 6,
                            "additionalGasLimit": 160000,
                            "slippageTolerance": 2
                        },
                        "forwarderQuotation": {
                            "flowType": "trustless",
                            "isTransfer": "false",
                            "isWrappedToken": false,
                            "allowanceTo": "0xCA94d8C245601B152C904f42fE788B4125f5b46B",
                            "bridgeFee": {
                                "amount": "4280091678031428",
                                "decimals": 18,
                                "symbol": "WETH",
                                "address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
                            },
                            "fuelTransfer": null,
                            "fromTokenAddress": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
                            "toTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                            "source": {
                                "chainId": "42161",
                                "chainType": "evm",
                                "asset": {
                                    "decimals": 6,
                                    "symbol": "USDT",
                                    "name": "Tether USD",
                                    "chainId": "42161",
                                    "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
                                    "resourceID": "usdt",
                                    "isMintable": false,
                                    "isWrappedAsset": false,
                                    "isReserveAsset": false,
                                    "tokenInstance": {
                                        "decimals": 6,
                                        "symbol": "USDT",
                                        "name": "Tether USD",
                                        "chainId": 42161,
                                        "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"
                                    }
                                },
                                "stableReserveAsset": {
                                    "decimals": 18,
                                    "symbol": "WETH",
                                    "name": "WETH",
                                    "chainId": "42161",
                                    "address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
                                    "resourceID": "native-eth",
                                    "isMintable": false,
                                    "isWrappedAsset": false,
                                    "isReserveAsset": false
                                },
                                "tokenAmount": "100000000",
                                "stableReserveAmount": "28309228794860723",
                                "path": [
                                    "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
                                    "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
                                ],
                                "flags": [
                                    "4002"
                                ],
                                "priceImpact": "0.00",
                                "tokenPath": "USDT->WETH",
                                "dataTx": [
                                    "0x90411a3200000000000000000000000066398e8b1e02291381d049c0c932394d5f2fc7ac000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb900000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000066398e8b1e02291381d049c0c932394d5f2fc7ac000000000000000000000000ca94d8c245601b152c904f42fe788b4125f5b46b0000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000649317f62ed4b30000000000000000000000000000000000000000000000000065972a4e00c22a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d2137a6d0ef438a7c2bb38eeef364500271658be00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000104e5b07cdb000000000000000000000000389938cf14be379217570d8e4619e51fbdafaa2100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000066398e8b1e02291381d049c0c932394d5f2fc7ac00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002efd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb900006482af49447d8a07e3bd95bd0d56f35241523fbab100000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e8500000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000353c1f0bc78fbbc245b3c93ef77b1dcc5b77d2a00000000000000000000000000000000000000000000000000065972a4e00c22a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f86542200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f9900000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000ca94d8c245601b152c904f42fe788b4125f5b46b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
                                ]
                            },
                            "destination": {
                                "chainId": "1",
                                "chainType": "evm",
                                "asset": {
                                    "chainId": "1",
                                    "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
                                    "name": "ETH",
                                    "symbol": "ETH",
                                    "decimals": 18,
                                    "resourceID": "native-eth",
                                    "isMintable": false,
                                    "isWrappedAsset": false
                                },
                                "stableReserveAsset": {
                                    "decimals": 18,
                                    "symbol": "WETH",
                                    "name": "WETH",
                                    "chainId": "1",
                                    "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                                    "resourceID": "native-eth",
                                    "isMintable": false,
                                    "isWrappedAsset": false,
                                    "isReserveAsset": false
                                },
                                "tokenAmount": "24029137116829295",
                                "stableReserveAmount": "24029137116829295",
                                "priceImpact": "0.00",
                                "tokenPath": "WETH",
                                "dataTx": [
                                    "0x00"
                                ],
                                "path": [
                                    "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
                                ],
                                "flags": [
                                    "4002"
                                ]
                            },
                            "partnerId": "6",
                            "slippageTolerance": "2",
                            "estimatedTime": 40
                        },
                        "destinationAmount": "24029137116829295",
                        "destinationAmountPromised": "23788845745661004"
                    }
                },
                "adapters": [
                    {
                        "adapterId": "lido_stake",
                        "adapterType": "stake",
                        "sourceChainId": "1",
                        "destChainId": "1",
                        "adapterOptions": {
                            "srcToken": {
                                "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                                "name": "ETH",
                                "symbol": "ETH",
                                "decimals": 18
                            },
                            "amountIn": "23788845745661004",
                            "amountOut": "23788845745661004",
                            "destToken": {
                                "address": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
                                "name": "stETH",
                                "symbol": "stETH",
                                "decimals": 18
                            },
                            "receiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                            "data": {
                                "refundAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                                "partnerId": 6,
                                "protocolData": {
                                    "bridgeChain": "1",
                                    "bridgePoolId": "lido-stEth"
                                }
                            }
                        },
                        "adapters": []
                    }
                ]
            }
        ],
        "quote": [
            {
                "amountSent": "100000000",
                "amountReceived": "23788845745661004",
                "amountReceivedInEther": "0.023789",
                "exchangeRate": "",
                "estimatedTime": 40,
                "slippageTolerance": "2",
                "srcToken": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
                "destToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                "adapterId": "nitro_bridge",
                "bridgeFee": {
                    "amount": "4280091678031428",
                    "decimals": 18,
                    "symbol": "WETH",
                    "address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"
                }
            },
            {
                "amountSent": "23788845745661004",
                "amountReceived": 23788845745661004,
                "amountReceivedInEther": 0.023788845745661005,
                "exchangeRate": 23788845745661004,
                "srcToken": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
                "destToken": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
                "adapterId": "lido_stake",
                "estimatedTime": 12
            }
        ],
        "clientAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "senderAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "estimatedTime": 0
    }
}

Under protocol, set action as express-stake if you want the best path for the user. If the action is set as stake, our pathfinder will always generate a path that involves staking into Lido on Ethereum. In the case of express-stake, our pathfinder will also evaluate if directly swapping into wstETH will result in a better output.

Sample cURL

curl --location 'https://api.pod.routerintents.com/router-intent/protocol/get-protocol-quotes' \
--header 'Accept: */*' \
--header 'Accept-Language: en-GB,en;q=0.7' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: https://lido.routerintents.com' \
--header 'Referer: https://lido.routerintents.com/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'Sec-GPC: 1' \
--header 'User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36' \
--header 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Brave";v="126"' \
--header 'sec-ch-ua-mobile: ?1' \
--header 'sec-ch-ua-platform: "Android"' \
--data '{
    "ReceiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
    "SourceTokens": [
        {
            "chainId": "42161",
            "address": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
            "symbol": "USDT",
            "decimals": 6
        }
    ],
    "Amount": [
        "100000000"
    ],
    "SourceChainId": 42161,
    "Protocol": [
        {
            "protocolId": "lido",
            "chainId": "1",
            "action": "express-stake",
            "poolId": "lido-stEth_1",
            "data": {
                "bridgeChain": "1",
                "bridgePoolId": "lido-stEth"
            }
        }
    ]
}'


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": "afc3480f-a8a3-441b-a43e-676d1f284b84",
        "gasPrice": "803830000000",
        "calldata": "0xabcd",
        "to": "0xc304C00001c2fe8feDeE8b49428eB180c34CB3F6",
        "from": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "value": "0x00",
        "prioritySteps": [
            {
                "contractAddress": "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
                "data": "0x095ea7b3000000000000000000000000c304c00001c2fe8fedee8b49428eb180c34cb3f60000000000000000000000000000000000000000000000000000000005f5e100",
                "value": 0,
                "instructionData": "Approve USDT for Batch Handler Contract",
                "instructionTitle": "Approve USDT",
                "chainId": "42161"
            }
        ],
        "gasLimit": "7500000"
    }
}

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. The gasLimit sent by our APIs is a highly conservative estimate of the gas that a tx could use. Since the actual gas limit will be much lower, we suggest that the API users estimate the gasLimit themselves once the approval tx is mined.

Last updated