Making a Deposit on Superform

This page will help you get started with Superform

Conventions

  • This is a fully OpenAPI-compliant API. You can always view the most recent OpenAPI schema file here.
  • The API surface is standardized to camel_case. The only exception is route detail data that is proxied from LiFi in the execution endpoints.
  • The vault_statisticsobject may return a value of -1000000 for any of its float64 properties if that value cannot be computed. This is used in place of NaNs because the JSON spec does not natively support encoding the NaN value.



Execution

You can use the API to make deposits into and withdrawals from vaults listed on Superform. The flow in either direction is comprised of two steps:

  1. Send a request to /deposit/calculate with a set of options. This will return a set of possible routes.
  2. Select a route and send it, along with the rest of the response, to /deposit/start. This will return the encoded transaction data. You may then use this data to execute a transaction on-chain.

Making a deposit

Let's say you want to deposit into the ETH SuperUSDC on Superform. You have some ETH on Base so you would like to use that to fund this deposit. Here is what the body of that deposit request would look like:


[
    {
        "user_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
        "from_token_address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "from_chain_id": 8453,
        "amount_in": "0.007096152538997953",
        "refund_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
        "vault_id": "vL7k-5ZgYCoFgi6kz2jIJ",
        "bridge_slippage": 100,
        "swap_slippage": 100,
        "route_type": "output",
        "exclude_ambs": [],
        "exclude_liquidity_providers": [],
        "exclude_dexes": [],
        "exclude_bridges": []
    }
]

We are depositing $23.60 worth of ETH cross-chain from Base to the vault on Ethereum. You can read more about individual options in the API Reference. Note that we are using the SuperPool here to avoid the high gas fees that would come with depositing from Ethereum directly.


Once we send the request, we will see a list of possible routes in the liq.route.routes array. The request returned four routes, I've truncated them to two for brevity:

[
    {
        "in": {
            "user_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
            "from_chain_id": 8453,
            "to_chain_id": 1,
            "from_token_address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
            "to_token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "amount_in": "0.007096152538997953",
            "superpositions_amount_in": "",
            "superpositions_chain_id": 0,
            "vault_id": "vL7k-5ZgYCoFgi6kz2jIJ",
            "superform_id": "6277101737774167025033327034726523872305111570443857120149",
            "route_type": "output",
            "exclude_bridges": [],
            "exclude_dexes": [],
            "exclude_ambs": [],
            "exclude_liquidity_providers": [],
            "bridge_slippage": 100,
            "swap_slippage": 100,
            "positive_slippage": 200,
            "is_part_of_multi_vault": false,
            "refund_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
            "need_insurance": false,
            "filter_swap_routes": false,
            "retain_4626": false,
            "is_erc20": false,
            "adjusted_amount": "7096152538997953",
            "max_slippage": 395,
            "vault_decimals": 6,
            "vault_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "contract_address": "0xF7DE3c70F2db39a188A81052d2f3C8e3e217822a",
            "from_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
            "from_amount": "",
            "form_implementation_id": "1",
            "superform_address": "0xa232962Bc242538fa2E5B85E99EA9f675BAD4B95",
            "destination": "0x3721B0E122768CedDfB3Dec810E64c361177f826",
            "method": "",
            "is_same_route": false,
            "is_x_chain": true,
            "transaction_type": "deposit",
            "has_dst_swap": false,
            "output_amount_for_withdraw": "",
            "output_amount_normalized": "",
            "gas_estimate": {
                "gas_price_usd": "0.0000000979",
                "estimated_seconds": 2
            }
        },
        "liq": {
            "ok": true,
            "vault_id": "vL7k-5ZgYCoFgi6kz2jIJ",
            "routes": [
                {
                    "route_id": "e406d83b-a439-4ee2-a305-dce745c3cb6e",
                    "is_erc20": true,
                    "bridge_id": 101,
                    "from_chain_id": 8453,
                    "from_amount": "7096152538997953",
                    "from_token": {
                        "address": "0x0000000000000000000000000000000000000000",
                        "symbol": "ETH",
                        "decimals": 18,
                        "chain_id": 8453,
                        "name": "ETH",
                        "logo_uri": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                    },
                    "from_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                    "to_chain_id": 8453,
                    "to_amount": "22694503",
                    "to_amount_usd": "23.6015",
                    "to_amount_min": "22467558",
                    "to_token": {
                        "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                        "symbol": "sp-ysUSDC",
                        "decimals": 6,
                        "chain_id": 8453,
                        "name": "SuperUSDC SuperPosition",
                        "logo_uri": ""
                    },
                    "to_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                    "gas_cost_usd": "0.0678",
                    "cross_chain_fee": 0,
                    "has_swap": false,
                    "insurable_route": false,
                    "interim_token": "",
                    "interim_token_amount": "",
                    "erc20_route_approval_target": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
                    "super_position": {
                        "amount": "22694503",
                        "symbol": "ysUSDC",
                        "usd_value": 23.601505162863283
                    },
                    "service": {
                        "name": "LiFi",
                        "logo": "https://li.fi/logo192.png"
                    },
                    "bridge": null,
                    "dex": {
                        "name": "1inch Via LiFi",
                        "logo": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/oneinch.png"
                    },
                    "estimate_time": 30,
                    "lifi_route_first_step": {
                        "type": "lifi",
                        "id": "d1940576-59b1-4dc6-a2fa-c8236e33dffb:0",
                        "tool": "1inch",
                        "toolDetails": {
                            "key": "1inch",
                            "name": "1inch",
                            "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/oneinch.png"
                        },
                        "action": {
                            "fromToken": {
                                "address": "0x0000000000000000000000000000000000000000",
                                "symbol": "ETH",
                                "decimals": 18,
                                "chainId": 8453,
                                "name": "ETH",
                                "coinKey": "ETH",
                                "priceUSD": "3322.3",
                                "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                            },
                            "fromAmount": "7096152538997953",
                            "toToken": {
                                "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                                "symbol": "sp-ysUSDC",
                                "decimals": 6,
                                "chainId": 8453,
                                "name": "SuperUSDC SuperPosition",
                                "coinKey": "sp-ysUSDC",
                                "priceUSD": "1.0399658437661037"
                            },
                            "fromChainId": 8453,
                            "toChainId": 8453,
                            "slippage": 0.01,
                            "fromAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                            "toAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77"
                        },
                        "estimate": {
                            "tool": "1inch",
                            "approvalAddress": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
                            "toAmountMin": "22467558",
                            "toAmount": "22694503",
                            "fromAmount": "7096152538997953",
                            "gasCosts": [
                                {
                                    "type": "SEND",
                                    "price": "29448734",
                                    "estimate": "692762",
                                    "limit": "935762",
                                    "amount": "20400963863308",
                                    "amountUSD": "0.0678",
                                    "token": {
                                        "address": "0x0000000000000000000000000000000000000000",
                                        "symbol": "ETH",
                                        "decimals": 18,
                                        "chainId": 8453,
                                        "name": "ETH",
                                        "coinKey": "ETH",
                                        "priceUSD": "3322.3",
                                        "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                    }
                                }
                            ],
                            "toolData": {
                                "fromToken": {
                                    "address": "",
                                    "symbol": "",
                                    "decimals": 0,
                                    "chainId": 0,
                                    "name": "",
                                    "coinKey": ""
                                },
                                "toToken": {
                                    "address": "",
                                    "symbol": "",
                                    "decimals": 0,
                                    "chainId": 0,
                                    "name": "",
                                    "coinKey": ""
                                },
                                "toTokenAmount": "",
                                "fromTokenAmount": "",
                                "estimatedGas": 0
                            },
                            "executionDuration": 30,
                            "fromAmountUSD": "23.5755",
                            "toAmountUSD": "23.6015"
                        },
                        "includedSteps": [
                            {
                                "id": "dd77cf07-e920-431e-83ec-e07d9cffd3c7",
                                "type": "swap",
                                "action": {
                                    "fromToken": {
                                        "address": "0x0000000000000000000000000000000000000000",
                                        "symbol": "ETH",
                                        "decimals": 18,
                                        "chainId": 8453,
                                        "name": "ETH",
                                        "coinKey": "ETH",
                                        "priceUSD": "3322.3",
                                        "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                    },
                                    "fromAmount": "7096152538997953",
                                    "toToken": {
                                        "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                                        "symbol": "sp-ysUSDC",
                                        "decimals": 6,
                                        "chainId": 8453,
                                        "name": "SuperUSDC SuperPosition",
                                        "coinKey": "sp-ysUSDC",
                                        "priceUSD": "1.0399658437661037"
                                    },
                                    "fromChainId": 8453,
                                    "toChainId": 8453,
                                    "slippage": 0.01,
                                    "fromAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77"
                                },
                                "estimate": {
                                    "tool": "1inch",
                                    "approvalAddress": "0x111111125421ca6dc452d289314280a0f8842a65",
                                    "toAmountMin": "22467558",
                                    "toAmount": "22694503",
                                    "fromAmount": "7096152538997953",
                                    "gasCosts": [
                                        {
                                            "type": "SEND",
                                            "price": "29448734",
                                            "estimate": "692762",
                                            "limit": "1300591",
                                            "amount": "20400963863308",
                                            "amountUSD": "0.0678",
                                            "token": {
                                                "address": "0x0000000000000000000000000000000000000000",
                                                "symbol": "ETH",
                                                "decimals": 18,
                                                "chainId": 8453,
                                                "name": "ETH",
                                                "coinKey": "ETH",
                                                "priceUSD": "3322.3",
                                                "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                            }
                                        }
                                    ],
                                    "toolData": {
                                        "fromToken": {
                                            "address": "",
                                            "symbol": "",
                                            "decimals": 0,
                                            "chainId": 0,
                                            "name": "",
                                            "coinKey": ""
                                        },
                                        "toToken": {
                                            "address": "",
                                            "symbol": "",
                                            "decimals": 0,
                                            "chainId": 0,
                                            "name": "",
                                            "coinKey": ""
                                        },
                                        "toTokenAmount": "",
                                        "fromTokenAmount": "",
                                        "estimatedGas": 0
                                    },
                                    "executionDuration": 30,
                                    "fromAmountUSD": "",
                                    "toAmountUSD": ""
                                },
                                "tool": "1inch",
                                "toolDetails": {
                                    "key": "1inch",
                                    "name": "1inch",
                                    "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/oneinch.png"
                                }
                            }
                        ],
                        "integrator": "superform.xyz",
                        "routesRequestId": ""
                    }
                },
                {
                    "route_id": "cf3deeea-428a-49c7-a924-6fbdeb3bfd1f",
                    "is_erc20": true,
                    "bridge_id": 101,
                    "from_chain_id": 8453,
                    "from_amount": "7096152538997953",
                    "from_token": {
                        "address": "0x0000000000000000000000000000000000000000",
                        "symbol": "ETH",
                        "decimals": 18,
                        "chain_id": 8453,
                        "name": "ETH",
                        "logo_uri": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                    },
                    "from_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                    "to_chain_id": 8453,
                    "to_amount": "22700941",
                    "to_amount_usd": "23.6082",
                    "to_amount_min": "22473931",
                    "to_token": {
                        "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                        "symbol": "sp-ysUSDC",
                        "decimals": 6,
                        "chain_id": 8453,
                        "name": "SuperUSDC SuperPosition",
                        "logo_uri": ""
                    },
                    "to_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                    "gas_cost_usd": "0.0351",
                    "cross_chain_fee": 0,
                    "has_swap": false,
                    "insurable_route": false,
                    "interim_token": "",
                    "interim_token_amount": "",
                    "erc20_route_approval_target": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
                    "super_position": {
                        "amount": "22700941",
                        "symbol": "ysUSDC",
                        "usd_value": 23.6082004621716
                    },
                    "service": {
                        "name": "LiFi",
                        "logo": "https://li.fi/logo192.png"
                    },
                    "bridge": null,
                    "dex": {
                        "name": "Odos Via LiFi",
                        "logo": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/odos.png"
                    },
                    "estimate_time": 30,
                    "lifi_route_first_step": {
                        "type": "lifi",
                        "id": "4e76d1e0-7dfa-41d4-8284-bd515c7e5df9:0",
                        "tool": "odos",
                        "toolDetails": {
                            "key": "odos",
                            "name": "Odos",
                            "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/odos.png"
                        },
                        "action": {
                            "fromToken": {
                                "address": "0x0000000000000000000000000000000000000000",
                                "symbol": "ETH",
                                "decimals": 18,
                                "chainId": 8453,
                                "name": "ETH",
                                "coinKey": "ETH",
                                "priceUSD": "3322.3",
                                "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                            },
                            "fromAmount": "7096152538997953",
                            "toToken": {
                                "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                                "symbol": "sp-ysUSDC",
                                "decimals": 6,
                                "chainId": 8453,
                                "name": "SuperUSDC SuperPosition",
                                "coinKey": "sp-ysUSDC",
                                "priceUSD": "1.0399658437661037"
                            },
                            "fromChainId": 8453,
                            "toChainId": 8453,
                            "slippage": 0.01,
                            "fromAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                            "toAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77"
                        },
                        "estimate": {
                            "tool": "odos",
                            "approvalAddress": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
                            "toAmountMin": "22473931",
                            "toAmount": "22700941",
                            "fromAmount": "7096152538997953",
                            "gasCosts": [
                                {
                                    "type": "SEND",
                                    "price": "29448734",
                                    "estimate": "359076",
                                    "limit": "602076",
                                    "amount": "10574333609784",
                                    "amountUSD": "0.0351",
                                    "token": {
                                        "address": "0x0000000000000000000000000000000000000000",
                                        "symbol": "ETH",
                                        "decimals": 18,
                                        "chainId": 8453,
                                        "name": "ETH",
                                        "coinKey": "ETH",
                                        "priceUSD": "3322.3",
                                        "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                    }
                                }
                            ],
                            "toolData": {
                                "fromToken": {
                                    "address": "",
                                    "symbol": "",
                                    "decimals": 0,
                                    "chainId": 0,
                                    "name": "",
                                    "coinKey": ""
                                },
                                "toToken": {
                                    "address": "",
                                    "symbol": "",
                                    "decimals": 0,
                                    "chainId": 0,
                                    "name": "",
                                    "coinKey": ""
                                },
                                "toTokenAmount": "",
                                "fromTokenAmount": "",
                                "estimatedGas": 0
                            },
                            "executionDuration": 30,
                            "fromAmountUSD": "23.5755",
                            "toAmountUSD": "23.6082"
                        },
                        "includedSteps": [
                            {
                                "id": "76fb82f0-a105-4c1c-9b72-02cf054dc722",
                                "type": "swap",
                                "action": {
                                    "fromToken": {
                                        "address": "0x0000000000000000000000000000000000000000",
                                        "symbol": "ETH",
                                        "decimals": 18,
                                        "chainId": 8453,
                                        "name": "ETH",
                                        "coinKey": "ETH",
                                        "priceUSD": "3322.3",
                                        "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                    },
                                    "fromAmount": "7096152538997953",
                                    "toToken": {
                                        "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                                        "symbol": "sp-ysUSDC",
                                        "decimals": 6,
                                        "chainId": 8453,
                                        "name": "SuperUSDC SuperPosition",
                                        "coinKey": "sp-ysUSDC",
                                        "priceUSD": "1.0399658437661037"
                                    },
                                    "fromChainId": 8453,
                                    "toChainId": 8453,
                                    "slippage": 0.01,
                                    "fromAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77"
                                },
                                "estimate": {
                                    "tool": "odos",
                                    "approvalAddress": "0x19ceead7105607cd444f5ad10dd51356436095a1",
                                    "toAmountMin": "22473931",
                                    "toAmount": "22700941",
                                    "fromAmount": "7096152538997953",
                                    "gasCosts": [
                                        {
                                            "type": "SEND",
                                            "price": "29448734",
                                            "estimate": "359076",
                                            "limit": "866799",
                                            "amount": "10574333609784",
                                            "amountUSD": "0.0351",
                                            "token": {
                                                "address": "0x0000000000000000000000000000000000000000",
                                                "symbol": "ETH",
                                                "decimals": 18,
                                                "chainId": 8453,
                                                "name": "ETH",
                                                "coinKey": "ETH",
                                                "priceUSD": "3322.3",
                                                "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                            }
                                        }
                                    ],
                                    "toolData": {
                                        "fromToken": {
                                            "address": "",
                                            "symbol": "",
                                            "decimals": 0,
                                            "chainId": 0,
                                            "name": "",
                                            "coinKey": ""
                                        },
                                        "toToken": {
                                            "address": "",
                                            "symbol": "",
                                            "decimals": 0,
                                            "chainId": 0,
                                            "name": "",
                                            "coinKey": ""
                                        },
                                        "toTokenAmount": "",
                                        "fromTokenAmount": "",
                                        "estimatedGas": 0
                                    },
                                    "executionDuration": 30,
                                    "fromAmountUSD": "",
                                    "toAmountUSD": ""
                                },
                                "tool": "odos",
                                "toolDetails": {
                                    "key": "odos",
                                    "name": "Odos",
                                    "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/odos.png"
                                }
                            }
                        ],
                        "integrator": "superform.xyz",
                        "routesRequestId": ""
                    }
                }
            ]
        }
    }
]

If you wish to select the first route, you can simply copy and paste this entire object into the input of the next endpoint. If you wish to use the second (or any n-th) route, make sure it is the first route in the liq.route.routes array that is passed as part of the request input.

Let's say we select the first route. This is what the request body to /deposit/start will look like:

[
    {
        "in": {
            "user_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
            "from_chain_id": 8453,
            "to_chain_id": 1,
            "from_token_address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
            "to_token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "amount_in": "0.007096152538997953",
            "superpositions_amount_in": "",
            "superpositions_chain_id": 0,
            "vault_id": "vL7k-5ZgYCoFgi6kz2jIJ",
            "superform_id": "6277101737774167025033327034726523872305111570443857120149",
            "route_type": "output",
            "exclude_bridges": [],
            "exclude_dexes": [],
            "exclude_ambs": [],
            "exclude_liquidity_providers": [],
            "bridge_slippage": 100,
            "swap_slippage": 100,
            "positive_slippage": 200,
            "is_part_of_multi_vault": false,
            "refund_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
            "need_insurance": false,
            "filter_swap_routes": false,
            "retain_4626": false,
            "is_erc20": false,
            "adjusted_amount": "7096152538997953",
            "max_slippage": 395,
            "vault_decimals": 6,
            "vault_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "contract_address": "0xF7DE3c70F2db39a188A81052d2f3C8e3e217822a",
            "from_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
            "from_amount": "",
            "form_implementation_id": "1",
            "superform_address": "0xa232962Bc242538fa2E5B85E99EA9f675BAD4B95",
            "destination": "0x3721B0E122768CedDfB3Dec810E64c361177f826",
            "method": "",
            "is_same_route": false,
            "is_x_chain": true,
            "transaction_type": "deposit",
            "has_dst_swap": false,
            "output_amount_for_withdraw": "",
            "output_amount_normalized": "",
            "gas_estimate": {
                "gas_price_usd": "0.0000000985",
                "estimated_seconds": 2
            }
        },
        "liq": {
            "vault_id": "vL7k-5ZgYCoFgi6kz2jIJ",
            "ok": true,
            "routes": [
                {
                    "route_id": "ad646608-c4b1-44da-9405-111d3e55a02a",
                    "is_erc20": true,
                    "bridge_id": 101,
                    "from_chain_id": 8453,
                    "from_amount": "7096152538997953",
                    "from_token": {
                        "address": "0x0000000000000000000000000000000000000000",
                        "symbol": "ETH",
                        "decimals": 18,
                        "chain_id": 8453,
                        "name": "ETH",
                        "logo_uri": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                    },
                    "from_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                    "to_chain_id": 8453,
                    "to_amount": "22638199",
                    "to_amount_usd": "23.5430",
                    "to_amount_min": "22411817",
                    "to_token": {
                        "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                        "symbol": "sp-ysUSDC",
                        "decimals": 6,
                        "chain_id": 8453,
                        "name": "SuperUSDC SuperPosition",
                        "logo_uri": ""
                    },
                    "to_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                    "gas_cost_usd": "0.0494",
                    "cross_chain_fee": 0,
                    "has_swap": false,
                    "insurable_route": false,
                    "interim_token": "",
                    "interim_token_amount": "",
                    "erc20_route_approval_target": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
                    "super_position": {
                        "amount": "22638199",
                        "symbol": "ysUSDC",
                        "usd_value": 23.542950932938535
                    },
                    "service": {
                        "name": "LiFi",
                        "logo": "https://li.fi/logo192.png"
                    },
                    "bridge": null,
                    "dex": {
                        "name": "1inch Via LiFi",
                        "logo": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/oneinch.png"
                    },
                    "estimate_time": 30,
                    "lifi_route_first_step": {
                        "type": "lifi",
                        "id": "608e8ca7-11a5-447d-a2f2-1ccf1f420766:0",
                        "tool": "1inch",
                        "toolDetails": {
                            "key": "1inch",
                            "name": "1inch",
                            "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/oneinch.png"
                        },
                        "action": {
                            "fromToken": {
                                "address": "0x0000000000000000000000000000000000000000",
                                "symbol": "ETH",
                                "decimals": 18,
                                "chainId": 8453,
                                "name": "ETH",
                                "coinKey": "ETH",
                                "priceUSD": "3322.3",
                                "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                            },
                            "fromAmount": "7096152538997953",
                            "toToken": {
                                "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                                "symbol": "sp-ysUSDC",
                                "decimals": 6,
                                "chainId": 8453,
                                "name": "SuperUSDC SuperPosition",
                                "coinKey": "sp-ysUSDC",
                                "priceUSD": "1.0399658437661037"
                            },
                            "fromChainId": 8453,
                            "toChainId": 8453,
                            "slippage": 0.01,
                            "fromAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
                            "toAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77"
                        },
                        "estimate": {
                            "tool": "1inch",
                            "approvalAddress": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
                            "toAmountMin": "22411817",
                            "toAmount": "22638199",
                            "fromAmount": "7096152538997953",
                            "gasCosts": [
                                {
                                    "type": "SEND",
                                    "price": "29858191",
                                    "estimate": "497762",
                                    "limit": "740762",
                                    "amount": "14862272868542",
                                    "amountUSD": "0.0494",
                                    "token": {
                                        "address": "0x0000000000000000000000000000000000000000",
                                        "symbol": "ETH",
                                        "decimals": 18,
                                        "chainId": 8453,
                                        "name": "ETH",
                                        "coinKey": "ETH",
                                        "priceUSD": "3322.3",
                                        "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                    }
                                }
                            ],
                            "toolData": {
                                "fromToken": {
                                    "address": "",
                                    "symbol": "",
                                    "decimals": 0,
                                    "chainId": 0,
                                    "name": "",
                                    "coinKey": ""
                                },
                                "toToken": {
                                    "address": "",
                                    "symbol": "",
                                    "decimals": 0,
                                    "chainId": 0,
                                    "name": "",
                                    "coinKey": ""
                                },
                                "toTokenAmount": "",
                                "fromTokenAmount": "",
                                "estimatedGas": 0
                            },
                            "executionDuration": 30,
                            "fromAmountUSD": "23.5755",
                            "toAmountUSD": "23.5430"
                        },
                        "includedSteps": [
                            {
                                "id": "e2aa5a19-41d2-4132-bcbc-4a9d2cf8cc89",
                                "type": "swap",
                                "action": {
                                    "fromToken": {
                                        "address": "0x0000000000000000000000000000000000000000",
                                        "symbol": "ETH",
                                        "decimals": 18,
                                        "chainId": 8453,
                                        "name": "ETH",
                                        "coinKey": "ETH",
                                        "priceUSD": "3322.3",
                                        "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                    },
                                    "fromAmount": "7096152538997953",
                                    "toToken": {
                                        "address": "0xffE8B2295CEf70290819A8193834cc7900bCef5f",
                                        "symbol": "sp-ysUSDC",
                                        "decimals": 6,
                                        "chainId": 8453,
                                        "name": "SuperUSDC SuperPosition",
                                        "coinKey": "sp-ysUSDC",
                                        "priceUSD": "1.0399658437661037"
                                    },
                                    "fromChainId": 8453,
                                    "toChainId": 8453,
                                    "slippage": 0.01,
                                    "fromAddress": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77"
                                },
                                "estimate": {
                                    "tool": "1inch",
                                    "approvalAddress": "0x111111125421ca6dc452d289314280a0f8842a65",
                                    "toAmountMin": "22411817",
                                    "toAmount": "22638199",
                                    "fromAmount": "7096152538997953",
                                    "gasCosts": [
                                        {
                                            "type": "SEND",
                                            "price": "29858191",
                                            "estimate": "497762",
                                            "limit": "1047091",
                                            "amount": "14862272868542",
                                            "amountUSD": "0.0494",
                                            "token": {
                                                "address": "0x0000000000000000000000000000000000000000",
                                                "symbol": "ETH",
                                                "decimals": 18,
                                                "chainId": 8453,
                                                "name": "ETH",
                                                "coinKey": "ETH",
                                                "priceUSD": "3322.3",
                                                "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
                                            }
                                        }
                                    ],
                                    "toolData": {
                                        "fromToken": {
                                            "address": "",
                                            "symbol": "",
                                            "decimals": 0,
                                            "chainId": 0,
                                            "name": "",
                                            "coinKey": ""
                                        },
                                        "toToken": {
                                            "address": "",
                                            "symbol": "",
                                            "decimals": 0,
                                            "chainId": 0,
                                            "name": "",
                                            "coinKey": ""
                                        },
                                        "toTokenAmount": "",
                                        "fromTokenAmount": "",
                                        "estimatedGas": 0
                                    },
                                    "executionDuration": 30,
                                    "fromAmountUSD": "",
                                    "toAmountUSD": ""
                                },
                                "tool": "1inch",
                                "toolDetails": {
                                    "key": "1inch",
                                    "name": "1inch",
                                    "logoURI": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/exchanges/oneinch.png"
                                }
                            }
                        ],
                        "integrator": "superform.xyz",
                        "routesRequestId": ""
                    }
                }
            ]
        }
    }
]

The response from /deposit/start will be:

{
    "$schema": "https://api.superform.xyz/schemas/DepositResponse.json",
    "to": "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
    "method": "-",
    "data": "0x4630a0d8d708b0a7566a215628801e8faf390d8cc36be31b5ca26f56c5a7bb2fb0b4c2c300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000014ebd125201ada1f94a8270d24d03a3f87146e77000000000000000000000000000000000000000000000000000000000155f89f0000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000d7375706572666f726d2e78797a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a3078303030303030303030303030303030303030303030303030303030303030303030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000111111125421ca6dc452d289314280a0f8842a65000000000000000000000000111111125421ca6dc452d289314280a0f8842a650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffe8b2295cef70290819a8193834cc7900bcef5f000000000000000000000000000000000000000000000000001935e9c35be4c100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000028807ed23790000000000000000000000006ea77f83ec8693666866ece250411c974ab962a8000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000ffe8b2295cef70290819a8193834cc7900bcef5f0000000000000000000000006ea77f83ec8693666866ece250411c974ab962a80000000000000000000000001231deb6f5749ef6ce6943a275a1d3e7486f4eae000000000000000000000000000000000000000000000000001935e9c35be4c1000000000000000000000000000000000000000000000000000000000155f89e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000013c00000000000000000000000000000000000000000000000000011e0000f000a007e5c0d20000000000000000000000000000000000000000000000cc00006900001a40414200000000000000000000000000000000000006d0e30db002a000000000000000000000000000000000000000000000000000000000016363b0ee63c1e501482fe995c4a52bc79271ab29a53591363ee30a89420000000000000000000000000000000000000602a0000000000000000000000000000000000000000000000000000000000155f89eee63c1e581100e1d85849b80d7da26416269b8a3f83890d6c3833589fcd6edb6e08f4c7c32d4f71b54bda02913111111125421ca6dc452d289314280a0f8842a650020d6bdbf78ffe8b2295cef70290819a8193834cc7900bcef5f111111125421ca6dc452d289314280a0f8842a65000000002a94d114000000000000000000000000000000000000000000000000",
    "value": "7096152538997953",
    "value_usd": "23.6014485371",
    "discount_usd": "0.0000000000",
    "original_fee_usd": "0.0000000000",
    "discount_percent": "",
    "fees_estimate": null,
    "approval_data": null
}

🚧

Note - the quotes that we get from the liquidity aggregators expire after a few minutes. Make sure to get a fresh quote using the calculate endpoints before using it in the start endpoints.


Making a withdrawal

The flow to make a withdrawal is almost identical to the deposit flow outlined above. To withdraw from Steakhouse USDC to native Eth on Avalanche, send the following request to /withdraw/calculate:

[
    {
        "user_address": "0x93AB0CD091DC8Dd513eBFd11972e64A2AC558552",
        "refund_address": "0x93AB0CD091DC8Dd513eBFd11972e64A2AC558552",
        "vault_id": "zcxnMoUkKUbMQ3uM_w3fq",
        "bridge_slippage": 50,
        "swap_slippage": 50,
        "route_type": "output",
        "exclude_ambs": [],
        "exclude_dexes": [],
        "exclude_bridges": [],
        "to_token_address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "to_chain_id": 42161,
        "superpositions_amount_in": "3881289106529881",
        "superpositions_chain_id": 10,
        "is_erc20": false,
        "retain_4626": false
    }
]

Then select a route, and send it to /deposit/start. In addition to transaction data, you will see approval_data object with the data necessary for user to approve the transaction on-chain before executing the withdrawal.


Making a multi-vault deposit

You may have noticed that we've been sending an array to the /deposit/calculate and /deposit/withdraw endpoints. In our initial example, that array contained only one object representing one vault that the user wants to deposit into. We can deposit into multiple vaults just as easily. Here is a request to deposit into a PoolTogether vault on Base and a Sturdy vault on Optimism using ZRO on Arbitrum as the funding token:

[
    {
        "user_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
        "from_token_address": "0x6985884C4392D348587B19cb9eAAf157F13271cd",
        "from_chain_id": 42161,
        "amount_in": "9.206843004750000503",
        "refund_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
        "vault_id": "GQ-edWKmiKTM6iF0Xz3LB",
        "bridge_slippage": 50,
        "swap_slippage": 50,
        "route_type": "output",
        "exclude_ambs": [],
        "exclude_liquidity_providers": [],
        "exclude_dexes": [],
        "exclude_bridges": []
    },
    {
        "user_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
        "from_token_address": "0x6985884C4392D348587B19cb9eAAf157F13271cd",
        "from_chain_id": 42161,
        "amount_in": "9.206843004750000503",
        "refund_address": "0x14eBD125201ADA1F94A8270d24d03A3f87146e77",
        "vault_id": "agKh8y1aPQ9e452ZdpnMC",
        "bridge_slippage": 50,
        "swap_slippage": 50,
        "route_type": "output",
        "exclude_ambs": [],
        "exclude_liquidity_providers": [],
        "exclude_dexes": [],
        "exclude_bridges": []
    }
]

After selecting a route and starting it, you will be minted SuperPositions on Arbitrum representing vault shares in these two vaults.

📘

Note - if the funding token is a non-native token, you will need to approve spending that token by calling the approvemethod on the token contract with the SuperformRouter address as the spender. You can get this and other deployed contract addresses from the/supported endpoint.