# Single-Chain Swap

This document provides an overview of the Unizen API for single-chain transactions via the Unizen DEX aggregator. The API provides access to all available quotes for a trade from supported DEXes, as well as the ability to generate transaction data for a trade.

Unizen's trading architecture is decentralized, providing access to over 20,000 digital assets across more than 160 decentralized exchanges and 7 blockchains. This allows users to get the most out of their trades and easily access digital assets on any supported blockchain.

**Available Endpoints**

The Unizen API for single-chain transactions provides the following endpoints:

* `GET /trade/v1/{chainId}/quote/single`: Find all available quotes for a single-chain trade via the Unizen DEX aggregator.
* `GET /trade/v1/{chainId}/swap/single`: Generate transaction data for a single-chain trade via the Unizen DEX aggregator.

| Network             | Quote Endpoint               | Swap Endpoint               |
| ------------------- | ---------------------------- | --------------------------- |
| Ethereum (Mainnet)  | /trade/v1/1/quote/single     | /trade/v1/1/swap/single     |
| Polygon             | /trade/v1/137/quote/single   | /trade/v1/137/swap/single   |
| Binance Smart Chain | /trade/v1/56/quote/single    | /trade/v1/56/swap/single    |
| Optimism            | /trade/v1/10/quote/single    | /trade/v1/10/swap/single    |
| Fantom              | /trade/v1/250/quote/single   | /trade/v1/250/swap/single   |
| Avalanche           | /trade/v1/43114/quote/single | /trade/v1/43114/swap/single |
| Arbitrum            | /trade/v1/42161/quote/single | /trade/v1/42161/swap/single |

**Using the Unizen API for Single-Chain Transactions**

1. Call `GET /trade/v1/{chainId}/quote/single` to get all available quotes for a single-chain trade via the Unizen DEX aggregator.
2. Call `GET /trade/v1/{chainId}/swap/single` to generate transaction data for a single-chain trade via the Unizen DEX aggregator.
3. Send the transaction to the DEX aggregator contract using the `sendTransaction` function, passing in the `from` address, `to` address, `data`, `gasPrice`, `gasLimit`, and `value` parameters.

**Note**: you can avoid calling the 2nd step (swap call) if you pass the sender and the parameter disableEstimateGas=false to the quote endpoint, so you will get the gas estimation and the transaction data to conduct the trade

**Minimum Trade Amount**:

* The minimum amount to trade is $1 (in USD value of tokens). Trades with amounts below this limit are not allowed.

**Solana**

You can get quotes and execute trades on supported EVM chains (Ethereum, BSC, Polygon, Berachain, etc.) as well as on Solana. The process is identical for both, except for the final step—sending the confirmation to the user's wallet. This step requires different handling depending on whether the chain is EVM-based or Solana. The details are explained in the following articles.

**Important**: the chain id for Solana is -846853820


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.unizen.io/api-get-started/single-chain-swap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
