🛠️Symbiosis API
Symbiosis API | Symbiosis Finance | Swagger
What is Symbiosis API
The Symbiosis API allows you to integrate the functionalities of the Symbiosis Protocol into your application, platform, or protocol, enabling decentralized cross-chain swaps and cross-chain liquidity management for your users.
Checklist Before Going to Production (Mainnet)
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: Approve users’ ERC20 tokens only for one contract, which is '
metaRouterGateway'
on each blockchain. You can verify the addresses of the contracts for all blockchains supported by Symbiosis protocol V2 in this configuration.Existence and Correct Addresses of Contracts: Ensure that all contracts used in your software exist on the corresponding blockchains and that their addresses on each blockchain match those in this configuration.
Handling of Calldata: Do not modify, reuse, or cache the calldata obtained from calling methods of the Symbiosis SDKs and API.
Acknowledgement of 'from' Address Usage: Acknowledge that the 'from' address is used to revert a cross-chain swap if the cross-chain operation gets stuck. For more information see #address-eligible-to-revert-cross-chain-swaps
Testing: After deployment to Mainnet, run at least one cross-chain operation.
Please do these checks for the initial deployment AND each software update.
Understanding the Symbiosis Protocol
The most crucial parts for understanding the Symbiosis protocol are:
The Symbiosis contracts interaction: Symbiosis Routing Contracts.
Emergencies (stuck cross-chain operations): Symbiosis & Emergencies.
Fee collection: Gas Fees for Cross-chain Operations via Symbiosis.
Supported Blockchains and Tokens
Supported blockchains
Values such as chain IDs for the supported blockchains are listed in the following configurations:
You can also get a list of supported blockchains using the '/v1/chains' endpoint to get a list of currently supported blockchains.
Supported tokens
Using the Symbiosis API, you can operate any token that exists and can be exchanged in DEXes on the blockchains supported by the Symbiosis protocol. We have no restrictions on the tokens to operate. You may consider composing your own list of supported tokens if you need to.
Address Eligible to Revert Cross-chain Operations
In certain situations, a cross-chain operation may fail to complete. Various reasons could cause this failure. To address such scenarios, the Symbiosis protocol provides methods to revert stuck cross-chain operations.
Important: Only the address specified as 'from' in the original cross-chain operation can revert the operation if it gets stuck. The two possible scenarios for specifying the 'from' address are:
The User's Address as the 'from' Address: If a cross-chain operation gets stuck, the user can revert the operation using the Symbiosis WebApp.
Your Contract's Address as the 'from' Address: If you choose this option, your contract must include methods to perform reverts.
For an explanation of emergencies, see Symbiosis & Emergencies
Swaggers
Testnet: Please note, we do not guarantee functionality of the Symbiosis API on Testnet.
Examples
Symbiosis WebApp
Symbiosis WebApp employs the Symbiosis API for its interactions with the Symbiosis protocol and can be used as a reference for existing protocol functionality.
Swagger
The swaggers of the Symbiosis API:Swagger contain examples of using every endpoint. Just scroll down to the endpoint you are interested in, enter the needed data or select it from the preset data and run an example.
Last updated