> For the complete documentation index, see [llms.txt](https://docs.hann.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hann.finance/protocol/stableswap-dex.md).

# Convert and StableSwap

Swap USDHN and USDT, bridge assets to Kaia, and provide or stake StableSwap liquidity.

Hann Finance exchanges USDHN and USDT through its StableSwap pool. Supply both tokens to receive LP tokens, which represent a share of the pool. Staking those LP tokens earns rewards through RewardStaker.

| Action                     | App path                 | Result                                                                                 |
| -------------------------- | ------------------------ | -------------------------------------------------------------------------------------- |
| Swap USDHN ↔ USDT          | `/convert` → Swap        | The output token arrives in your wallet.                                               |
| Bridge assets to Kaia      | `/convert` → Bridge      | Supported USDC or USDT from another chain arrives as USDT on Kaia.                     |
| Add or remove liquidity    | `/earn/usdt` → Liquidity | Deposit both pool tokens for LP tokens, or burn LP tokens to receive both pool tokens. |
| Stake or unstake LP tokens | `/earn/usdt` → Staking   | Move LP tokens between your wallet and RewardStaker.                                   |

![USDT and USDHN enter the pool to mint LP tokens; returning LP tokens releases a share of both assets.](https://2221521122-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8nyFCptMbCTgKUyVYlHX%2Fuploads%2Fgit-blob-d717b790e22fa1be7b704012c9f0a3b9778a8af9%2Fswap-liquidity.svg?alt=media)

*Depositing both assets creates LP tokens. Burning LP tokens returns a share of the pool's current balances.*

## Swap USDHN and USDT

1. Connect your wallet and open `/convert` → Swap.
2. Choose USDHN → USDT or USDT → USDHN.
3. Enter either the amount to spend or the amount to receive. The other amount is calculated from the pool quote.
4. Open the settings and set the slippage tolerance and transaction deadline. Review the quoted amount, fee, and minimum received or maximum spent.
5. Complete the approval or Permit2 signature requested by your wallet, then confirm the swap transaction.
6. After confirmation, check the output-token balance and transaction details.

The app uses the configured `UsdtUsdhnPool` through `StableSwapRouter`. It does not choose an arbitrary pool or exchange token pair. Router quotes and swaps check the pool's factory registration and the router's allowed tokens. Swaps cannot execute while the pool is paused.

### Input amount and output amount

| What you enter                  | Contract limit                       | When the transaction reverts            |
| ------------------------------- | ------------------------------------ | --------------------------------------- |
| Amount to spend: exact input    | `amountOutMin`, the minimum received | The output is below the minimum.        |
| Amount to receive: exact output | `amountInMax`, the maximum spent     | The required input exceeds the maximum. |

For an exact-input quote of `995` tokens and `0.5%` slippage, the minimum received is approximately `990.025` tokens:

$$
minOut \approx quote \times \left(1-\frac{slippageBps}{10{,}000}\right)
$$

One basis point is `0.01%`. The final limit uses the token's decimal precision. A higher slippage tolerance permits a larger difference from the quote; it does not change the pool fee. The deadline stops execution after the specified time.

The fee shown in the quote comes from the pool's current configuration and balances. Pool imbalance can increase both price impact and the dynamic fee. There is no fixed exchange rate of one USDHN for one USDT.

## Bridge assets to Kaia

Bridge uses Rhino.fi to bring supported USDC or USDT from other EVM chains to USDT on Kaia. The source-chain and asset selectors show the routes returned by the bridge service. The destination is Kaia mainnet, chain ID `8217`, and the destination token is USDT.

1. Open `/convert` → Bridge and choose the source chain and asset.
2. Enter the amount and recipient. Keep the source chain's native token available for transaction fees.
3. Review the receive amount, bridge fee, estimated time, and the KAIA gas top-up setting.
4. Switch your wallet to the source chain, approve the quoted token amount, and confirm the source-chain deposit.
5. Follow the transfer status through delivery on Kaia. The source transaction confirms the deposit; destination delivery completes the transfer.

The KAIA gas top-up converts part of the transfer value into native KAIA for destination-chain fees. Its cost is included in the quote. Bridge is available in the Kaia mainnet app; the Kairos testnet app does not expose it. Execution requires an EVM wallet connection that can switch to the source chain. The app's mobile connection mode and Kaia-only wallet connection do not support this source-chain flow.

Bridge transfer history and the resume control follow a submitted transfer after you reopen the page. Check that transfer's status before creating another deposit. Cross-chain delivery spans separate transactions and has its own progress and refund states.

## Add liquidity

1. Open `/earn/usdt` → Liquidity → Deposit.
2. Enter a positive amount of both USDT and USDHN. Review the pool ratio, expected LP tokens, minimum LP tokens, and deadline.
3. Choose Deposit Only or enable Stake LP tokens directly.
4. Approve both tokens or sign the requested Permit2 authorizations, then confirm the deposit.

The pool accepts both token amounts without forcing a fixed deposit ratio. An imbalanced deposit affects the LP-token quote and incurs the pool's imbalance fee. The deposit fails if either token amount is zero or the minted LP amount is below `minLiquidity`.

| Deposit option    | Where the new LP tokens go               | Additional authorization                                                            |
| ----------------- | ---------------------------------------- | ----------------------------------------------------------------------------------- |
| Deposit only      | Your wallet, through `StableSwapRouter`  | Token spending authorization for the router.                                        |
| Deposit and stake | RewardStaker, through `StableSwapZapper` | Token spending authorization for the zapper and its RewardStaker operator approval. |

Operator approval lets the zapper stake or unstake on your behalf. It is a separate on-chain permission from token spending approval. The app requests it before the combined transaction when it is not already set.

## Stake, unstake, and claim rewards

Use `/earn/usdt` → Staking to stake LP tokens held in your wallet or to unstake an existing balance. Staking transfers LP tokens to RewardStaker; unstaking returns LP tokens to your wallet. Neither action removes pool liquidity.

Claim rewards to collect accrued USDHN without removing the staked LP balance. The deposit-and-stake and stake flows also offer a reward-claim option when accrued rewards are present.

## Remove liquidity

1. Open `/earn/usdt` → Liquidity → Withdraw and enter the LP amount to withdraw.
2. Review the expected USDT and USDHN amounts and the minimum amount for each token.
3. For wallet-held LP tokens, approve or sign for `StableSwapRouter` and confirm withdrawal. For staked LP tokens, use the combined unstake-and-withdraw option; the app checks the zapper's operator approval first.
4. After confirmation, both tokens arrive in your wallet and the LP tokens are burned.

The app withdraws both tokens in proportion to the pool's current balances. It does not promise to return the original deposit amounts or let this flow choose a single output token. Proportional removal remains available in the contracts while the pool is paused; swaps and new deposits remain paused.

## What changes the value of an LP position

LP tokens hold exposure to both pool assets. If USDHN falls below its peg, traders can sell USDHN into the pool for USDT. The pool then holds more USDHN and less USDT. Your share follows that changed composition. Staking rewards do not remove this exposure, and a minimum withdrawal amount does not guarantee a dollar value.

See [StableSwap mechanics](/mechanics/deep-dives/stableswap.md) for the curve, fee calculation, and depeg examples. [Zappers](/protocol/zapper.md) describes combined liquidity and Trove operations.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hann.finance/protocol/stableswap-dex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
