Parifi API Reference

Get Quote

POST /protocol/get-protocol-quotes

Fetch the quote for depositing into Parifi from any chain using any token.

Base URL

https://api.pod.routerintents.com

Body

{
    "ReceiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
    "SourceTokens": [
        {
            "chainId": "8453",
            "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "name": "USDC",
            "symbol": "USDC",
            "decimals": 6
        }
    ],
    "DestinationTokens": [
        {
            "chainId": "42161",
            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            // "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" in case of pfWETH
            "name": "USDC", // WETH in case of pfWETH
            "symbol": "USDC", // WETH in case of pfWETH
            "decimals": 6 // 18 in case of pfWETH
        }
        ```postman_json
        {
            "chainId": "42161",
            "address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
            "name": "WETH",
            "symbol": "WETH",
            "decimals": 18
        }
```
    ],
    "Amount": [
        "11000000"
    ],
    "SourceChainId": 8453,
    "Protocol": [
        {
            "protocolId": "parifi",
            "chainId": "42161",
            "action": "vault-deposit",
            "poolId": "parifi-vault-usdc" // parifi-vault-weth in case of pfWETH
        }
    ]
}

To deposit into Parifi's WETH vault, replace USDC info with WETH info in the DestinationTokens array.

Parifi Protocol Data

// For protocol, pass the following:
    {
        "protocolId": "parifi",
        "chainId": "42161",
        "action": "vault-deposit",
        "poolId": "parifi-vault-usdc". // parifi-vault-weth in case of pfWETH
    }

Response

{
    "Code": 0,
    "Errors": [],
    "PayLoad": {
        "appId": "0",
        "quotationType": "BatchTransaction",
        "feeParams": [
            {
                "fee": "5500",
                "recipient": "0x00EB64b501613F8Cf8Ef3Ac4F82Fc63a50343fee",
                "decimals": 6,
                "symbol": "USDC",
                "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "chainId": 8453,
                "name": "USDC",
                "adapter": "batch-handler"
            }
        ],
        "slippageTolerance": 2,
        "sourceTokens": [
            {
                "chainId": "8453",
                "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "name": "USDC",
                "symbol": "USDC",
                "decimals": 6
            }
        ],
        "amount": [
            "11000000"
        ],
        "sourceChainId": 8453,
        "destinationChainId": 42161,
        "destinationToken": {
            "address": "0xbf11aC635fE97430b5333018778d0D746f67C989",
            "name": "Parifi USDC Vault",
            "symbol": "pfUSDC",
            "decimals": 6
        },
        "adapters": [
            {
                "adapterId": "nitro_bridge",
                "adapterType": "bridge",
                "sourceChainId": 8453,
                "destChainId": "42161",
                "adapterOptions": {
                    "srcToken": {
                        "chainId": "8453",
                        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "name": "USDC",
                        "symbol": "USDC",
                        "decimals": 6
                    },
                    "amountIn": "10994500",
                    "amountOut": "10873557",
                    "destToken": {
                        "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "name": "USDC",
                        "symbol": "USDC",
                        "decimals": 6
                    },
                    "receiverAddress": "0x48aF30669A2622e6941862D2B7453A2612C7a70B",
                    "data": {
                        "actionType": 0,
                        "refundAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                        "partnerId": 0,
                        "tokens": [],
                        "bridgeFee": {
                            "amount": "11109",
                            "decimals": 6,
                            "symbol": "USDC",
                            "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "isMainnet": true,
                        "quotationParams": {
                            "fromTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                            "toTokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "amount": "10994500",
                            "fromTokenChainId": 8453,
                            "toTokenChainId": "42161",
                            "additionalGasLimit": 160000,
                            "slippageTolerance": 2
                        },
                        "forwarderQuotation": {
                            "flowType": "trustless",
                            "isTransfer": true,
                            "isWrappedToken": false,
                            "allowanceTo": "0x0fa205c0446cd9eedcc7538c9e24bc55ad08207f",
                            "bridgeFee": {
                                "amount": "11109",
                                "decimals": 6,
                                "symbol": "USDC",
                                "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                            },
                            "fromTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                            "toTokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "source": {
                                "chainId": "8453",
                                "chainType": "evm",
                                "asset": {
                                    "decimals": 6,
                                    "symbol": "USDC",
                                    "name": "USDC",
                                    "chainId": "8453",
                                    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                                    "resourceID": "usdc-circle",
                                    "isMintable": false,
                                    "isWrappedAsset": false
                                },
                                "stableReserveAsset": {
                                    "decimals": 6,
                                    "symbol": "USDC",
                                    "name": "USDC",
                                    "chainId": "8453",
                                    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                                    "resourceID": "usdc-circle",
                                    "isMintable": false,
                                    "isWrappedAsset": false
                                },
                                "tokenAmount": "10994500",
                                "stableReserveAmount": "10994500",
                                "path": [],
                                "flags": [],
                                "priceImpact": "0",
                                "tokenPath": "",
                                "dataTx": []
                            },
                            "destination": {
                                "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": "10983391",
                                "stableReserveAmount": "10983391",
                                "path": [],
                                "flags": [],
                                "priceImpact": "0",
                                "tokenPath": "",
                                "dataTx": []
                            },
                            "partnerId": 0,
                            "fuelTransfer": null,
                            "slippageTolerance": "2",
                            "estimatedTime": 40
                        },
                        "destinationAmount": "10983391",
                        "destinationAmountPromised": "10873557"
                    }
                },
                "adapters": [
                    {
                        "adapterId": "parifi_vault_deposit",
                        "adapterType": "vault-deposit",
                        "sourceChainId": "42161",
                        "destChainId": "42161",
                        "adapterOptions": {
                            "srcToken": {
                                "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                                "name": "USDC",
                                "symbol": "USDC",
                                "decimals": 6
                            },
                            "amountIn": "10873557",
                            "amountOut": "1071985",
                            "destToken": {
                                "address": "0xbf11aC635fE97430b5333018778d0D746f67C989",
                                "name": "Parifi USDC Vault",
                                "symbol": "pfUSDC",
                                "decimals": 6
                            },
                            "receiverAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
                            "data": {
                                "refundAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8"
                            }
                        },
                        "adapters": []
                    }
                ],
                "fee": {
                    "fee": "11109",
                    "recipient": "",
                    "decimals": 6,
                    "symbol": "USDC",
                    "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                    "chainId": 8453,
                    "name": "USDC",
                    "adapter": "nitro_bridge"
                }
            }
        ],
        "quote": [
            {
                "amountSent": 10994500,
                "amountReceived": "10873557",
                "amountReceivedInEther": "10.873557",
                "exchangeRate": "",
                "estimatedTime": 40,
                "slippageTolerance": "2",
                "srcToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "destToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                "adapterId": "nitro_bridge",
                "bridgeFee": {
                    "amount": "11109",
                    "decimals": 6,
                    "symbol": "USDC",
                    "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                }
            },
            {
                "amountSent": "10873557",
                "amountReceived": "1071985",
                "amountReceivedInEther": 1.071985,
                "exchangeRate": "10.14338540184797361903",
                "srcToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                "destToken": "0xbf11aC635fE97430b5333018778d0D746f67C989",
                "adapterId": "parifi_vault_deposit",
                "estimatedTime": 0
            }
        ],
        "clientAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "senderAddress": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "estimatedTime": 40
    }
}

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": "8453",
            "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            "name": "USDC",
            "symbol": "USDC",
            "decimals": 6
        }
    ],
    "DestinationTokens": [
        {
            "chainId": "42161",
            "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "name": "USDC",
            "symbol": "USDC",
            "decimals": 6
        }
    ],
    "Amount": [
        "11000000"
    ],
    "SourceChainId": 8453,
    "Protocol": [
        {
            "protocolId": "parifi",
            "chainId": "42161",
            "action": "vault-deposit",
            "poolId": "parifi-vault-usdc"
        }
    ]
}'


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": "82600676-56af-4304-8675-f09e1e7328ff",
        "gasPrice": "183152032566",
        "calldata": "0xabc",
        "to": "0x1047770a9eb317667fAa472Ed2579E6f8dA086c6",
        "from": "0x2B4fAD70FC7E6579f19163DeEBbc5846bead25C8",
        "value": "0x00",
        "prioritySteps": [
            {
                "contractAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "data": "0x095ea7b30000000000000000000000001047770a9eb317667faa472ed2579e6f8da086c60000000000000000000000000000000000000000000000000000000000a7d8c0",
                "value": 0,
                "instructionData": "Approve USDC for Batch Handler Contract",
                "instructionTitle": "Approve USDC",
                "chainId": "8453"
            }
        ],
        "gasLimit": "3000000"
    }
}

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