Before you get started
Good to know
Here's an example project built with Next.js. Its purpose is to demonstrate how to integrate the Unizen API for single-chain and cross-chain trade: https://github.com/unizen-io/unizen-dex-aggregator-example
For security reasons, our API does not return contract addresses. Instead, you can obtain Trade Aggregator addresses using either of the following methods:
Install the npm package: https://www.npmjs.com/package/@unizen-io/unizen-contract-addresses and use the JSON file from
@unizen-io/unizen-contract-addresses/production.json
Configure the JSON file provided below for your project.
This file contains the addresses of our production contracts. The version, indicated by "v1" or "v2" or "v3", corresponds to the trade and can be obtained from the quote data of the respective trade using the /quote API.
How to set the fees
The fees for each integrator can vary based on the selected API plan and, for custom plans, are determined by the fee and revenue-sharing percentage agreed upon with Unizen. Additionally, each trade quote includes a feePercentage
parameter, allowing integrators to specify different fees based on the trade. For custom plans, the feePercentage
must fall within the predefined range agreed upon with Unizen.
For more detailed information, please refer to here.
Make sure you grasp the concepts of Price Impact and Slippage
We have written an article diving into the concepts and protective measures that should be put in place to protect users from conducting trades with high price impact or slippage. This article can be found here.
Last updated