> ## 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](https://docs.flashnet.xyz/api/authentication.md).

**1. 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](https://docs.flashnet.xyz/orchestra/routes-and-limits.md).

**2. 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"
```

**3. 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.

```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();
```

> [!NOTE]
>
> 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`.

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"
}
```

**4. 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.

For an EVM wallet integration, request `includeCalldata: true` to receive a ready-to-send funding transaction. See [EVM funding transactions](https://docs.flashnet.xyz/orchestra/quotes.md#evm-funding-transactions) for ERC-20 and native assets.

**5. 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](https://docs.flashnet.xyz/orchestra/status.md) covers polling, webhooks, and SSE. If detection misses the deposit, [submit its transaction](https://docs.flashnet.xyz/orchestra/quotes.md#when-to-call-submit); order creation may require deposit verification.

## Next

* [Quotes](https://docs.flashnet.xyz/orchestra/quotes.md) for deposit rules and the `/submit` body.
* [Pricing](https://docs.flashnet.xyz/orchestra/pricing.md) for estimate versus quote and amount modes; [Fees](https://docs.flashnet.xyz/orchestra/fees.md) for who pays what.
* [Fiat onramp](https://docs.flashnet.xyz/orchestra/onramp.md) for USD in over Lightning through one call.
* [Offramp](https://docs.flashnet.xyz/orchestra/offramp.md) to pay a Cash App username or Lightning address.


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