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

# Integration flow

> Follow the recommended Direct API sequence for loading assets, creating quotes, creating swaps, and polling status.

`POST /quote` gives you a short-lived estimate. `POST /swap` creates the actual swap and returns deposit instructions.

<Note>
  Deposit details are created only after `POST /swap`. Do not ask users to send funds from a quote response.
</Note>

## Recommended flow

<Steps>
  <Step title="Load assets">
    Call `GET /asset` when your app needs supported networks, token symbols, decimals, logos, and memo requirements.
  </Step>

  <Step title="Validate the payout address">
    Call `POST /address` after the user enters a destination address.
  </Step>

  <Step title="Create a quote">
    Call `POST /quote` with the send asset, receive asset, and exact send amount.
  </Step>

  <Step title="Create the swap">
    Call `POST /swap` with the quote ID and destination address.
  </Step>

  <Step title="Show deposit instructions">
    Display the `deposit.address`, `deposit.memo`, `deposit.amount`, `deposit.network`, `deposit.token`, and `deposit.deadline` from the swap response.
  </Step>

  <Step title="Track the swap">
    Call `GET /swap/{id}` every 30 seconds until the status is terminal.
  </Step>
</Steps>

## Retries

`POST /swap` is retry-safe per `quoteId`.

If you repeat the same create-swap call for a quote that already created a swap, LightSwap returns the existing swap instead of creating a new one.

## Amounts and rates

Amount fields are strings. Treat them as decimal strings, not JavaScript numbers.

Quote amounts are estimates. The final received amount can change with floating-rate swaps and network conditions before execution.
