Introduction
Empowering Web3 Builders with Unbeatable Token Swaps
Last updated
Empowering Web3 Builders with Unbeatable Token Swaps
Last updated
Request an API key by filling out this form: https://www.unizen.io/api-application
Integrating the Unizen Trade API into your platform unlocks unparalleled value for your users, thanks to our groundbreaking innovations like Unizen Liquidity Distribution Mechanism and Unizen Interoperability Protocol. As a proven solution that consistently outperforms leading DEX aggregators, the Unizen Trade API is the go-to choice for Web3 builders offering token swaps in their products.
Enable the most cost efficient, most accessible and seamless omni-chain enabled decentralized swaps for the users of your product or platform.
Superior Performance
In a study of 37 randomly selected single-chain trades worth $10k each, Unizen Trade provided approximately $238,073 more value in total compared to the two leading DEX Aggregators.
This superior performance can be accredited to ULDM, an in-house innovation developed in conjunction with top research institutions. ULDM addresses the problem of slippage by combining two key elements: Smart Liquidity Routing and a custom "trade splitting" algorithm.
Seamless Interoperability
Unizen Interoperability Protocol enables the fastest, seamless, zero-touch cross-chain interactions at the lowest cost possible for all assets. This groundbreaking technology further sets Unizen Trade apart from the competition, providing users with an unmatched trading experience.
Instant Access
The moment decentralized liquidity is provisioned on any of the supported blockchains, digital assets immediately become accessible on the Unizen Trade API. Unizen Trade Engine holds access to millions of digital assets across multiple blockchains, including native Bitcoin.
Flexible Fee Structure
Partners who integrate with Unizen through the Unizen Trade API can opt to charge a fee to their users, with flexibility in the fee structure. The API agreement allows partners to determine the fee to be charged, with Unizen retaining a percentage of the fee or positive slippage based on specific conditions. This ensures a fair and balanced relationship between Unizen and its partners.
Learn more about Unizen's revenue share model here.
Unizen Trade API is a superior-grade DEX aggregation and intelligent order routing API. By leveraging this API, developers can effortlessly and dependably access aggregated omni-chain DEX liquidity.
Unizen Trade API secures the most optimal execution price across more than 150 liquidity sources, including public Automated Market Makers (AMMs) and private professional market makers, spread across eight diverse blockchains.
The process of making a trade on Unizen involves a number of steps.
Integrators request a quote from the Unizen API.
Once the request data is received, the Unizen API proceeds to call the Unizen Trade Engine, which retrieves a quote from all supported DEX (AMM CDEX).
The Unizen Trade Engine then returns the requested data to the Unizen API.
The Unizen API then takes over and handles the data based on Integrator requirements. Afterwards, it returns all supported DEX for this trade, with the best trade on top. This stage is crucial because it helps Integrators make an informed decision on the best trade to make.
Once Integrators have made a decision, they send a request to the Unizen API to generate data for a transaction with the selected DEX.
The Unizen API then generates transaction data, estimates gas, and returns it to the Integrators. This stage is important as it helps Integrators plan ahead and avoid any unforeseen issues that may arise.
Once Integrators have received the data, they use it to send the transaction to the Unizen trade contract. This is the final step of the trade.
After that, the Unizen API continues to support the API to track the transaction status, ensuring that Integrators remain updated on the status of their trades.
To execute trades using the Unizen Trade Aggregator API, follow these steps:
Request a quote from the Unizen API by calling the /quote/single
or /quote/cross
API. The /quote/single
API is used for single-chain trades, while the /quote/cross
API is used for cross-chain trades.
The Unizen API will handle the request data and call the Unizen Trade Engine to retrieve a quote from all supported DEXs.
The Unizen API will return the requested data to you, allowing you to make an informed decision on the best trade to execute.
Once you have decided on the trade you want to execute, call the /trade/v1.0/{chainId}/swap/single
or /trade/v1.0/{chainId}/swap/cross
API to generate transaction data for the selected DEX.
You can avoid calling the swap endpoint by using the quote endpoint instead. Simply pass the user's wallet address as the sender
parameter and set disableEstimate
to true
. This way, you'll receive the same information as you would from the swap endpoint, saving one transaction in the process. However, this approach only works for the best quote. If you wish to select a different quote, you'll need to call the swap endpoint with the details of that specific quote.
The Unizen API will generate the transaction data, estimate gas, and return it to you.
Send the transaction to the Unizen trade contract using the data generated by the Unizen API.
The Unizen API will continue to support the API to track the transaction status, ensuring that you remain updated on the status of your trades.
By following these steps, you can easily execute trades across multiple DEXs without having to interact with each one individually. This provides a seamless user experience for multi-chain trading and asset management.