Thirdfy API Reference

Get Quote

POST /protocol/get-protocol-quotes

Fetch the quote for adding liquidity into Thirdfy from any chain using any token.

Base URL

https://api.pod.routerintents.com

Body

{
    "ReceiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
    "SourceTokens": [
        {
            "chainId": "42161",
            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "name": "USDC",
            "symbol": "USDC",
            "decimals": 6
        }
    ],
    "DestinationTokens": [
        {
            "chainId": "10242",
            "address": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
            "name": "USDC",
            "symbol": "USDC",
            "decimals": 6
        },
        {
            "chainId": "10242",
            "address": "0x6C45E28A76977a96e263f84F95912B47F927B687",
            "name": "USDT",
            "symbol": "USDT",
            "decimals": 6
        }
    ],
    "Amount": [
        "10000000"
    ],
    "SourceChainId": 42161,
    "Protocol": [
        {
            "protocolId": "thirdfy",
            "chainId": "10242",
            "action": "deposit",
            "poolId": "",
            "data": {
                "upperTick": "887220",
                "lowerTick": "-887220"
            }
        }
    ]
}

BaseSwap Protocol Data

// For protocol, pass the following:
{
    "protocolId": "thirdfy",
    "chainId": "10242", // Arthera
    "action": "deposit",
    "poolId": "",
    "data": {
        "lowerTick": "-887220",
        "upperTick": "887220",
        }
}

Response

{
    "Code": 0,
    "Errors": [],
    "PayLoad": {
        "appId": "0",
        "quotationType": "BatchTransaction",
        "slippageTolerance": 2,
        "sourceTokens": [
            {
                "chainId": "42161",
                "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                "name": "USDC",
                "symbol": "USDC",
                "decimals": 6
            }
        ],
        "amount": [
            "10000000"
        ],
        "sourceChainId": 42161,
        "destinationChainId": 10242,
        "adapters": [
            {
                "adapterId": "asset_bridge",
                "adapterType": "bridge",
                "sourceChainId": 42161,
                "destChainId": "10242",
                "adapterOptions": {
                    "srcToken": {
                        "chainId": "42161",
                        "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "name": "USDC",
                        "symbol": "USDC",
                        "decimals": 6
                    },
                    "amountIn": "10000000",
                    "amountOut": "9642687",
                    "destToken": {
                        "chainId": "10242",
                        "address": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                        "name": "USDC",
                        "symbol": "USDC",
                        "decimals": 6
                    },
                    "receiverAddress": "0xeA8fd31012991e1518Fe47f7BC7849859385Cf70",
                    "data": {
                        "actionType": 0,
                        "refundAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                        "partnerId": 129,
                        "tokens": [],
                        "bridgeFee": {
                            "amount": "259912",
                            "decimals": 6,
                            "symbol": "USDC",
                            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                        },
                        "isMainnet": true,
                        "quotationParams": {
                            "fromTokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "toTokenAddress": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                            "amount": "10000000",
                            "fromTokenChainId": 42161,
                            "toTokenChainId": "10242",
                            "partnerId": 129,
                            "additionalGasLimit": 2500000,
                            "slippageTolerance": 3
                        },
                        "forwarderQuotation": {
                            "flowType": "mint-burn",
                            "isTransfer": true,
                            "isWrappedToken": false,
                            "allowanceTo": "0x0Fa205c0446cD9EeDCc7538c9E24BC55AD08207f",
                            "bridgeFee": {
                                "amount": "259912",
                                "decimals": 6,
                                "symbol": "USDC",
                                "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                            },
                            "fromTokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "toTokenAddress": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                            "source": {
                                "chainId": "42161",
                                "chainType": "evm",
                                "asset": {
                                    "decimals": 6,
                                    "symbol": "USDC",
                                    "name": "USD Coin",
                                    "chainId": "42161",
                                    "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                                    "resourceID": "usdc-circle",
                                    "isMintable": false,
                                    "isWrappedAsset": false
                                },
                                "stableReserveAsset": {
                                    "decimals": 6,
                                    "symbol": "USDC",
                                    "name": "USD Coin",
                                    "chainId": "42161",
                                    "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                                    "resourceID": "usdc-circle",
                                    "isMintable": false,
                                    "isWrappedAsset": false
                                },
                                "tokenAmount": "10000000",
                                "stableReserveAmount": "10000000",
                                "path": [],
                                "flags": [],
                                "priceImpact": "0",
                                "tokenPath": "",
                                "dataTx": []
                            },
                            "destination": {
                                "chainId": "10242",
                                "chainType": "evm",
                                "asset": {
                                    "decimals": 6,
                                    "symbol": "USDC",
                                    "name": "USDC",
                                    "chainId": "10242",
                                    "address": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                                    "resourceID": "usdc-circle",
                                    "isMintable": true,
                                    "isWrappedAsset": false
                                },
                                "stableReserveAsset": {
                                    "decimals": 6,
                                    "symbol": "USDC",
                                    "name": "USDC",
                                    "chainId": "10242",
                                    "address": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                                    "resourceID": "usdc-circle",
                                    "isMintable": true,
                                    "isWrappedAsset": false
                                },
                                "tokenAmount": "9740088",
                                "stableReserveAmount": "9740088",
                                "path": [],
                                "flags": [],
                                "priceImpact": "0",
                                "tokenPath": "",
                                "dataTx": []
                            },
                            "partnerId": 129,
                            "fuelTransfer": null,
                            "slippageTolerance": "3",
                            "estimatedTime": 180
                        },
                        "destinationAmount": "9740088",
                        "destinationAmountPromised": "9642687"
                    }
                },
                "adapters": [
                    {
                        "adapterId": "thirdfy_swap",
                        "adapterType": "swap",
                        "sourceChainId": "10242",
                        "destChainId": "10242",
                        "adapterOptions": {
                            "srcToken": {
                                "chainId": "10242",
                                "address": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                                "name": "USDC",
                                "symbol": "USDC",
                                "decimals": 6
                            },
                            "amountIn": "4797237",
                            "amountOut": "4756089",
                            "destToken": {
                                "chainId": "10242",
                                "address": "0x6C45E28A76977a96e263f84F95912B47F927B687",
                                "name": "USDT",
                                "symbol": "USDT",
                                "decimals": 6
                            },
                            "receiverAddress": "0xeA8fd31012991e1518Fe47f7BC7849859385Cf70",
                            "data": {
                                "amountSent": "4797237",
                                "amountReceived": "4756089",
                                "amountReceivedInEther": "4.756089",
                                "exchangeRate": 1,
                                "slippageTolerance": 3,
                                "partnerId": 129
                            }
                        },
                        "adapters": []
                    },
                    {
                        "adapterId": "thirdfy_deposit",
                        "adapterType": "amm",
                        "sourceChainId": "10242",
                        "destChainId": "10242",
                        "adapterOptions": {
                            "receiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                            "data": {
                                "refundAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                                "token0": {
                                    "chainId": "10242",
                                    "address": "0x6C45E28A76977a96e263f84F95912B47F927B687",
                                    "name": "USDT",
                                    "symbol": "USDT",
                                    "decimals": 6
                                },
                                "token1": {
                                    "chainId": "10242",
                                    "address": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                                    "name": "USDC",
                                    "symbol": "USDC",
                                    "decimals": 6
                                },
                                "tickLower": "-887220",
                                "tickUpper": "887220",
                                "amount0Desired": "4756089",
                                "amount1Desired": "4797237",
                                "amount0Min": "4756",
                                "amount1Min": "4797",
                                "recipient": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                                "deadline": 1719839601111,
                                "token0Reserve": "73483604",
                                "token1Reserve": "100265003",
                                "fee": 303
                            }
                        },
                        "adapters": []
                    }
                ]
            }
        ],
        "quote": [
            {
                "amountSent": "10000000",
                "amountReceived": "9642687",
                "amountReceivedInEther": "9.642687",
                "exchangeRate": "",
                "estimatedTime": 180,
                "slippageTolerance": "3",
                "srcToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                "destToken": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                "adapterId": "asset_bridge",
                "bridgeFee": {
                    "amount": "259912",
                    "decimals": 6,
                    "symbol": "USDC",
                    "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                }
            },
            {
                "amountSent": "4797237",
                "amountReceived": "4756089",
                "amountReceivedInEther": "4.756089",
                "exchangeRate": 1,
                "slippageTolerance": 3,
                "srcToken": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
                "destToken": "0x6C45E28A76977a96e263f84F95912B47F927B687",
                "adapterId": "thirdfy_swap",
                "estimatedTime": 0
            },
            {
                "amountSent": 0,
                "amountReceived": 0,
                "amountReceivedInEther": 0,
                "srcToken": "",
                "destToken": "",
                "adapterId": "thirdfy_deposit",
                "estimatedTime": 0
            }
        ],
        "clientAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "senderAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "estimatedTime": 180
    }
}

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": "42161",
            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "name": "USDC",
            "symbol": "USDC",
            "decimals": 6
        }
    ],
    "DestinationTokens": [
        {
            "chainId": "10242",
            "address": "0x8C4aCd74Ff4385f3B7911432FA6787Aa14406f8B",
            "name": "USDC",
            "symbol": "USDC",
            "decimals": 6
        },
        {
            "chainId": "10242",
            "address": "0x6C45E28A76977a96e263f84F95912B47F927B687",
            "name": "USDT",
            "symbol": "USDT",
            "decimals": 6
        }
    ],
    "Amount": [
        "10000000"
    ],
    "SourceChainId": 42161,
    "Protocol": [
        {
            "protocolId": "thirdfy",
            "chainId": "10242",
            "action": "deposit",
            "poolId": "",
            "data": {
                "upperTick": "887220",
                "lowerTick": "-887220"
            }
        }
    ]
}'


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": "4ef98dca-caec-4f3a-9e83-2f1af33a8d6b",
        "gasPrice": "438724",
        "calldata": "0x03fe2173000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000009896800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ed24e7e548a3f53c98949079fff6ee804caf9f8900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000001e848000000000000000000000000000000000000000000000000000000000000001603130323432000000000000000000000000000000000000000000000000000000000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000098968000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000810000000000000000000000000000000000000000000000000000000000000014ea8fd31012991e1518fe47f7bc7849859385cf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002b4fad70fc7e6579f19163deebbc5846bead25c800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006c39ef688ae7f246d9a1af65689efbd933722489000000000000000000000000e2f77e7b44c02be634ef5f318c9359571074186c00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000008c4acd74ff4385f3b7911432fa6787aa14406f8b0000000000000000000000006c45e28a76977a96e263f84f95912b47f927b687000000000000000000000000ea8fd31012991e1518fe47f7bc7849859385cf70000000000000000000000000000000000000000000000000000001906e6e83f70000000000000000000000000000000000000000000000000000000000493335000000000000000000000000000000000000000000000000000000000046651e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000006c45e28a76977a96e263f84f95912b47f927b6870000000000000000000000008c4acd74ff4385f3b7911432fa6787aa14406f8bfffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2764c00000000000000000000000000000000000000000000000000000000000d89b4ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000129400000000000000000000000000000000000000000000000000000000000012bd0000000000000000000000002b4fad70fc7e6579f19163deebbc5846bead25c8000000000000000000000000000000000000000000000000000001906e6db1d7",
        "to": "0xc304C00001c2fe8feDeE8b49428eB180c34CB3F6",
        "from": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "value": "0x00",
        "prioritySteps": [],
        "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