Symbiosis API
Symbiosis API | Symbiosis Finance | Swagger
What is the Symbiosis API?
The Symbiosis API allows you to integrate the core functionalities of the Symbiosis Protocol into your application, platform, or protocol. It provides decentralized cross-chain swaps and liquidity management, enabling users to interact with multiple blockchain networks without intermediaries.
Checklist Before Going to Production (Mainnet)
Warning: If any of these checks fail, you put the assets of your users at risk. Therefore, you must not go to Mainnet with real assets and real users. This could result in the loss of your users' assets.
Approval of ERC20 Tokens: Always approve users' ERC20 tokens for only one contract — the
metaRouterGateway
— on each blockchain. Verify the contract addresses for all supported blockchains in this configuration.Contract Existence and Address Validation: Ensure that the contracts used in your integration are deployed on the respective blockchains, and that their addresses on each blockchain match those listed in this configuration.
Handling of Calldata: Do not modify, reuse, or cache calldata retrieved from Symbiosis SDKs or API methods.
Testing: After deployment to Mainnet, conduct at least one cross-chain operation to ensure proper functionality.
Reminder: Perform this checklist during the initial deployment and after every software update.
Understanding the Symbiosis Protocol
The key components for understanding the Symbiosis Protocol include:
The Symbiosis Core Contracts Interactions: Symbiosis Routing Contracts.
Stuck cross-chain operations handling: Symbiosis & Emergencies.
Supported Blockchains and Tokens
Supported Blockchains
Chain-specific values (chain IDs, etc.) can be found in the following configuration:
You can also retrieve a list of currently supported blockchains using the /v1/chains
endpoint.
Supported Tokens
Using the Symbiosis API, you can operate any token that exists and can be exchanged in DEXs within the blockchains supported by the Symbiosis Protocol. There are no restrictions on the tokens to operate, and you may define your own list of supported tokens if needed.
Swagger API Documentation
The Symbiosis API documentation, powered by Swagger, provides an interactive way to explore and test all endpoints:
Mainnet Documentation: Access the Swagger interface for the Mainnet environment.
Fees
The Symbiosis Protocol facilitates on-chain swaps and cross-chain operations across a wide range of supported blockchain networks. During these operations, the protocol collects several types of fees.
Partners may optionally apply additional fees on top of the standard Symbiosis fees if needed.
Cross-chain Operations
For cross-chain operations, Symbiosis provides two dedicated fee collector contracts designed for partners to charge and collect custom fees in addition to the standard protocol fees:
General Fee Collector: deployed on the Symbiosis chain (the protocol host chain) — used for all cross-chain operations except those to and from the Bitcoin network.
BTC Fee Collector: deployed on the BNB Chain — used for operations to and from the Bitcoin network.
For details on how to collect additional fees using these contracts, please refer to Partner Fee Collectors
On-Chain Swaps
For on-chain swaps, Symbiosis uses a separate fee collector contract deployed on each supported blockchain. The protocol does not provide a built-in mechanism for partners to collect additional fees for these operations.
If you need to charge additional fees for on-chain swaps, you must deploy and manage your own fee collector contract independently.
Swap Workflow Using the Symbiosis API
A General Workflow for Performing a Swap Using the Symbiosis API
Call
/v1/chains
to get a list of available blockchain networks.Call
/v1/swap-limits
to verify swap limits (the minimum and maximum allowed swap amounts).Call
/v1/swap
to get the calldata (payload) needed to execute the swap through Symbiosis protocol.If the source token is not a native gas token (e.g., ERC-20 tokens on EVM chains), approve the smart contract to spend the user's tokens.
Sign the calldata obtained in Step 3 using the wallet. Submit the transaction to the source blockchain. Since network conditions constantly change, calldata must be regenerated periodically (e.g., every 30 seconds) to ensure it remains valid before execution.
Call
/v1/tx/{chainID}/{txHash}
to monitor the progress of the swap. This endpoint provides real-time status updates for cross-chain operations.
Handling Transactions & Approvals
Approving smart contracts, signing, and sending transactions are performed through the user's wallet (e.g., MetaMask, WalletConnect, Coinbase Wallet) using wallet APIs. These actions are not handled directly by the Symbiosis API but must be performed via wallet interactions initiated by the application.
Checking API Health & Swap Time
An application can perform health checks periodically or before each swap using /health-check
. The frequency depends on the app's load and expected behavior.
To get an approximate swap duration, use the swap time estimation endpoint /v1/swap-durations
. The estimated swap time is based on historical data and a real swap time may vary due to changing network conditions.
Examples
Symbiosis WebApp
The Symbiosis WebApp uses the Symbiosis API for interacting with the Symbiosis Protocol and serves as a reference for supported protocol functionalities.
Swagger
The Swagger documentation of the Symbiosis API provides examples for every endpoint. Simply scroll to the endpoint of interest, input the required data, or use preset values, and execute the example.
For instance, there are preset token pairs for cross-chain swapping:
Last updated