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

# Quickstart

> Swap 1 ETH → SOL end to end.

Four calls, always the same order: **quote → execute → complete → status.**

<Steps>
  <Step title="Get a quote">
    Price the swap. You get back the best route across every venue plus an opaque `quoteToken`.

    ```bash theme={null}
    curl -s -X POST https://app.ravn.exchange/api/v1/quote \
      -H 'content-type: application/json' -d '{
        "inputChainId": 1,
        "outputChainId": -2,
        "inputToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
        "outputToken": "So11111111111111111111111111111111111111112",
        "inputAmount": "1000000000000000000",
        "userAddress": "0xYourUser",
        "destinationAddress": "SoYourUser"
      }'
    ```
  </Step>

  <Step title="Execute">
    Hand the `quoteToken` back. RAVN returns *how* to complete the swap, tagged by `executionType`.

    ```bash theme={null}
    curl -s -X POST https://app.ravn.exchange/api/v1/execute \
      -H 'content-type: application/json' \
      -d '{ "quoteToken": "<from step 1>" }'
    # → { "executionType": "DEPOSIT", "deposit": { "address": "...", "amount": "..." }, "statusRef": "..." }
    ```
  </Step>

  <Step title="Complete it">
    Branch on `executionType` — the entire client-side contract:

    ```js theme={null}
    switch (res.data.executionType) {
      case "TRANSACTION": await wallet.sendTransaction(res.data.transaction); break;
      case "SIGNATURE":   { const sig = await wallet.signTypedData(res.data.typedData);
                            await submitSignature(quoteToken, sig); } break;
      case "DEPOSIT":     await wallet.send(res.data.deposit.address, res.data.deposit.amount); break;
    }
    ```
  </Step>

  <Step title="Track it">
    Poll `status` with the `statusRef` (from `execute`) or the `statusRef` from `submit-signature`.

    ```bash theme={null}
    curl -s "https://app.ravn.exchange/api/v1/status?quoteToken=<token>&ref=<statusRef>"
    # → { "status": "pending" | "processing" | "success" | "refunded" | "failed" }
    ```
  </Step>
</Steps>

<Note>
  Amounts are strings in the token's smallest unit. Native coin uses the sentinel
  `0xEeee…EEeE`. The `quoteToken` is opaque — never parse it; it expires, so re-quote if stale.
</Note>
