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

# Quickstart

> Your first swap

This flow converts 50 USDC on Base into BTC on Spark: discover the route, quote it, fund it, and follow the order.

## Prerequisites

* An Orchestra account. Create one in the [dashboard](https://orchestra.flashnet.xyz/dashboard). Flashnet reviews new accounts before enabling API access.
* A server key (`fn_...`) from **API keys** in the dashboard. Keep it on your backend. For browsers and apps, use a scoped client key (`fnp_...`); see [Authentication](/api/authentication).

<Steps>
  <Step title="Read routes and limits">
    Both endpoints are public. `/routes` lists assets and their destinations; `/limits` gives amount bounds. Filter it to the pair:

    ```bash theme={null}
    curl "https://orchestration.flashnet.xyz/v2/orchestration/routes"

    curl "https://orchestration.flashnet.xyz/v1/orchestration/limits?sourceChain=base&sourceAsset=USDC&destinationChain=spark&destinationAsset=BTC"
    ```

    Read capability from the `route.to` set on the source asset, not from the symbol. Details in [Routes and limits](/orchestra/routes-and-limits).
  </Step>

  <Step title="Estimate">
    `/estimate` is public and stateless. Use it to preview the price as inputs change:

    ```bash theme={null}
    curl "https://orchestration.flashnet.xyz/v1/orchestration/estimate?sourceChain=base&sourceAsset=USDC&destinationChain=spark&destinationAsset=BTC&amount=50000000"
    ```
  </Step>

  <Step title="Quote">
    A quote returns deposit instructions and pricing valid for 2 minutes, subject to slippage. Amounts are integer strings in smallest units: `"50000000"` is 50 Base USDC.

    <CodeGroup>
      ```bash curl theme={null}
      curl -X POST "https://orchestration.flashnet.xyz/v1/orchestration/quote" \
        -H "Authorization: Bearer SERVER_KEY" \
        -H "Content-Type: application/json" \
        -H "X-Idempotency-Key: $(uuidgen)" \
        -d '{
          "sourceChain": "base",
          "sourceAsset": "USDC",
          "destinationChain": "spark",
          "destinationAsset": "BTC",
          "amount": "50000000",
          "recipientAddress": "RECIPIENT_ADDRESS"
        }'
      ```

      ```typescript TypeScript theme={null}
      const res = await fetch("https://orchestration.flashnet.xyz/v1/orchestration/quote", {
        method: "POST",
        headers: {
          Authorization: "Bearer SERVER_KEY",
          "Content-Type": "application/json",
          "X-Idempotency-Key": crypto.randomUUID(),
        },
        body: JSON.stringify({
          sourceChain: "base",
          sourceAsset: "USDC",
          destinationChain: "spark",
          destinationAsset: "BTC",
          amount: "50000000",
          recipientAddress: "RECIPIENT_ADDRESS",
        }),
      });
      const quote = await res.json();
      ```
    </CodeGroup>

    <Info>
      Replace `SERVER_KEY` with your `fn_...` key. Use a new `X-Idempotency-Key` for each operation and reuse it when retrying that same request. Amounts are integer strings in the asset's smallest unit: `"100000"` is 0.001 BTC; `"50000000"` is 50 USDC on Base. Read each asset's `decimals` from `/routes`.
    </Info>

    Illustrative response, trimmed; use the values from your own quote:

    ```json theme={null}
    {
      "quoteId": "q_...",
      "depositAddress": "0x...",
      "amountIn": "50000000",
      "estimatedOut": "45120",
      "expiresAt": "2026-09-10T18:02:00.000Z"
    }
    ```
  </Step>

  <Step title="Pay the deposit address">
    Send the returned `amountIn` of USDC to `depositAddress` on Base before `expiresAt`. Orchestra detects the deposit and creates the order without a confirm call. Eligible late funding uses refreshed pricing without the original price guarantee; acceptance is not assured.
  </Step>

  <Step title="Watch it settle">
    Poll the quote with a server key until `order` is non-null, then read the order by id:

    ```bash theme={null}
    curl "https://orchestration.flashnet.xyz/v1/orchestration/order?quoteId=QUOTE_ID" \
      -H "Authorization: Bearer SERVER_KEY"

    curl "https://orchestration.flashnet.xyz/v1/orchestration/status?id=ORDER_ID" \
      -H "Authorization: Bearer SERVER_KEY"
    ```

    A successful order reaches `completed`; intermediate stages vary by route. Handle failures and refunds too. [Status](/orchestra/status) covers polling, webhooks, and SSE. If detection misses the deposit, [submit its transaction](/orchestra/quotes#when-to-call-submit); order creation may require deposit verification.
  </Step>
</Steps>

## Next

* [Quotes](/orchestra/quotes) for deposit rules and the `/submit` body.
* [Pricing](/orchestra/pricing) for estimate versus quote and amount modes; [Fees](/orchestra/fees) for who pays what.
* [Fiat onramp](/orchestra/onramp) for USD in over Lightning through one call.
