🛠️Symbiosis API

Symbiosis API | Symbiosis Finance | Swagger

What is Symbiosis API

We are happy to introduce the Symbiosis API, which allows you to integrate the functionalities of the Symbiosis Protocol into your application, platform or protocol.

By integrating the Symbiosis API, you can quickly and effectively enable decentralized cross-chain swaps and cross-chain liquidity management for your users.

Given the frequent updates to the Symbiosis JS SDK – some of which may not maintain backward compatibility – we recommend our integrators and partners prioritize using the Symbiosis API.

Checklist to do before deploying 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.

  1. You approve users’ ERC20 tokens only for one contract, and this contract is metaRouterGateway on each blockchain. You can check the addresses of the contracts for all blockchains supported by Symbiosis protocol V2 in this configuration.

  2. All contracts you use in your software exist on the corresponding blockchains, and their addresses on each blockchain correspond to the addresses in this configuration.

  3. You do not modify, reuse, or cash the calldata you get by calling methods of the Symbiosis SDKs and API.

  4. After deployment to Mainnet, run at least one transaction.

Please do these checks for the initial deployment AND each software update.

The Symbiosis API allows you to use the following functionality:

  1. Perform cross-chain operations:

    1. Cross-chain swapping (any to any token on the supported blocchain networks). An explanation in a nutshell: Cross-chain Swaps with Symbiosis.

    2. Interchain communication (any token to a third-party protocol). An explanation in a nutshell: Symbiosis as Interchain Communication Protocol.

    3. Cross-chain zapping (any token to a liquidity pool owned by Symbiosis). An explanation in a nutshell: Cross-chain Zaps and Withdrawal to/from Symbiosis Pools.

    4. Bridging (minting/burning routine). An explanation: Symbiosis Mint-Burn Process.

  2. Get statuses of cross-chain operations.

  3. Deal with emergencies (an explanation: Symbiosis & Emergencies):

    1. Get a list of stuck cross-chain operations,

    2. Generate calldata to perform reverting operation.

Understanding the Symbiosis Protocol

The most crucial parts for understanding the Symbiosis protocol are:

Supported blockchains and tokens

We have no restrictions on the tokens to operate. You may consider composing your own list of supported tokens if you need to.

Values such as chain IDs for the supported blockchains are listed in the following configurations:

Endpoints

EndpointDescription

/health-check

It returns the health of the API: 200 if everything is up and running.

/v1/revert

The reverting transaction must be sent from the address that was specified as the address eligible to revert the initial cross-chain operation if it gets stuck: revertableAddress. For an explanation of emergencies, see Symbiosis & Emergencies

/v1/stucked/{address}

It returns a list of stuck cross-chain operations (swapping, bridging, zapping, interchain communicating) for the given address from all blockchains supported by the Symbiosis protocol.

address must be the sender's address: from which the initial transactions initiating cross-chain operations were sent. For an explanation of emergencies, see Symbiosis & Emergencies

/v1/tx/{chainId}/{transactionHash}

It returns the status of the original transaction specified by the blockchain ID and transaction hash. The original transaction means the transaction sent to the source blockchain. The possible states: - Not found - Pending - Success (in this case, the destination chain ID and the hash of the transaction on the destination chain are returned as well), - Stucked, - Reverted

/v1/swapping/exact_in

/v1/bridging/exact_in

/v1/zapping/exact_in

It returns a calldata for a cross-chain Zap.

/v1/zapping/aave/exact_in

It returns a calldata for an interchain communicating operation to supply assets to the AAVE protocol.

/v1/zapping/cream/exact_in

/v1/zapping/benqi/exact_in

/v1/zapping/beefy/exact_in

Swagger

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 swagger of the Symbiosis API contains 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