> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pesapay.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# USDT through USDT0

> USDT moves over LayerZero as USDT0, then converts to USDC on the Stellar DEX.

Most stablecoin users hold USDT, but the stablecoin with deep liquidity on Stellar is USDC. So Pesa accepts and pays out USDT, and settles in USDC. USDT arrives as USDT0, an omnichain USDT over LayerZero, and is swapped to USDC in the user's own wallet. Stellar's LayerZero endpoint ID is 30600.

## Deposit

<Steps>
  <Step title="Fee top-up">
    In `deposit_address` mode, Pesa's relayer sends the quoted LayerZero fee plus 20%, in the chain's native coin, to the user's smart wallet. It sends only to an address with an open transfer, and never more than the quote plus the buffer.
  </Step>

  <Step title="Trustlines">
    The user's Stellar account needs USDT0 and USDC trustlines before the send. If one is missing, the next action is `stellar_trustline`, and Pesa's onboarding sponsors it.
  </Step>

  <Step title="OFT send">
    The wallet calls the USDT0 OFT `send` with `dstEid = 30600`, `to` = the user's Stellar ed25519 public key, `amountLD` = `minAmountLD` = the amount, and the quoted native fee as `value`. On Ethereum an `approve` of the adapter comes first.
  </Step>

  <Step title="Delivery">
    LayerZero delivers USDT0 to the user's Stellar account. Pesa tracks the message by its GUID on LayerZero Scan and confirms the arrival on Stellar.
  </Step>

  <Step title="Swap to USDC">
    The user signs a strict-send path payment from USDT0 to USDC, with `destMin` from a fresh DEX quote. The transfer is `CREDITED` when the USDC arrives.
  </Step>
</Steps>

If the price moves past the bound before the swap, the transfer goes to `SWAP_REQUOTE` at a lower output. Signing the new swap is the user's approval. Until then the USDT0 stays in the user's wallet and the app shows it as USDT0.

## Withdraw

1. Pesa tops up the XLM the LayerZero fee needs inside the contract call, at most 2 XLM.
2. Prompt 1: the user signs the USDC to USDT0 swap.
3. Prompt 2: the user signs the Stellar OFT `send` to the destination chain's endpoint ID, with the recipient padded to 32 bytes and a fresh native fee.
4. LayerZero delivers. The transfer is `DELIVERED` when the destination chain's `OFTReceived` log is observed.

If the user stops between the two prompts, the transfer expires after 24 hours and the USDT0 stays in their wallet.

## Depth

The Stellar DEX book for USDT0 to USDC is deep for small amounts and thin for large ones. Quotes always show the exact output, and the per-transfer limit keeps swaps in the deep part of the book.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.