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

# Quickstart

> Discover, simulate, build, and hand off for signing — in four calls.

<Steps>
  <Step title="Discover strategies (public)">
    ```bash theme={null}
    curl -s "https://api.spiralstake.xyz/v1/strategies?chainId=1"
    ```

    Pick a strategy by its risk facts. No key needed.
  </Step>

  <Step title="Simulate a position">
    ```bash theme={null}
    curl -s -X POST https://api.spiralstake.xyz/v1/partner/leverage/simulate \
      -H "authorization: Bearer $SPIRAL_KEY" \
      -H "content-type: application/json" \
      -d '{"strategyId":"0x…","payToken":"0x…","amount":"10000","leverage":3}'
    ```

    Returns the deterministic `positionPreview`.
  </Step>

  <Step title="Build the unsigned transaction">
    ```bash theme={null}
    curl -s -X POST https://api.spiralstake.xyz/v1/partner/leverage/build \
      -H "authorization: Bearer $SPIRAL_KEY" \
      -H "content-type: application/json" \
      -d '{"strategyId":"0x…","payToken":"0x…","amount":"10000","leverage":3,"userAddress":"0x…"}'
    ```

    Returns `{ approvals, tx, meta }`.
  </Step>

  <Step title="Your user signs">
    Send `approvals[]` first (if any), then `tx`, from `userAddress` — or hand them `meta.signingUrl`. See [Signing](/integration/guides/signing).
  </Step>
</Steps>

## TypeScript

```ts theme={null}
const H = { authorization: `Bearer ${process.env.SPIRAL_KEY}`, "content-type": "application/json" };
const api = "https://api.spiralstake.xyz";

const build = await fetch(`${api}/v1/partner/leverage/build`, {
  method: "POST", headers: H,
  body: JSON.stringify({ strategyId, payToken, amount: "10000", leverage: 3, userAddress }),
}).then((r) => r.json());

// build.approvals[], build.tx {to,data,value}, build.meta.signingUrl
```

<Note>
  `build.meta.expiresAt` — the embedded swap calldata is valid \~60s. Build right before the user signs, and rebuild if it lapses.
</Note>
