> ## 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.

# Non-custodial execution

> How the build tools produce transactions without ever touching keys.

Spiral's execution tools are **non-custodial**. The server never signs, sends, or holds keys — it only *constructs* the transaction the user's own wallet will sign.

## The output of a build

`build_leverage_tx` and `build_manage_tx` return:

```json theme={null}
{
  "path": "swapAndLeverage",
  "approvals": [{ "to": "0x…token", "data": "0x…" }],
  "tx": { "to": "0x…contract", "data": "0x…", "value": "0" },
  "meta": {
    "positionPreview": { "leverage": "3.0", "effectiveLtv": "66.7", "expectedLeverageApy": "5.64" },
    "amountFlashLoan": "…",
    "minTokenOut": "…",
    "expiresAt": "2026-01-01T00:00:00.000Z",
    "signingUrl": "https://app.spiralstake.xyz/…"
  }
}
```

## Two ways to execute

<CardGroup cols={2}>
  <Card title="Sign the payload (agents)" icon="signature">
    Send `approvals[]` first (if any), then `tx`, from `userAddress` — with any wallet, signer library, or Safe. This is the canonical path.
  </Card>

  <Card title="Hand off the link (humans)" icon="link">
    Open `meta.signingUrl` — a one-click link into the Spiral app, prefilled, so a person reviews and signs in their own wallet.
  </Card>
</CardGroup>

## Safety built into every bundle

* **Approvals are exact** — scoped to the precise contract that pulls the funds, for the exact amount (never infinite).
* **Every swap carries a `minTokenOut` floor** (≥ 99% of the quote; slippage capped at 1%) — it can't be sandwiched to zero.
* **The tx targets the market you chose** and `onBehalfOf` is the signer's address.
* **`meta.expiresAt`** — the embedded swap calldata is time-sensitive (\~60s). Rebuild if it lapses before signing.

<Note>
  Building a transaction for an address you don't control is inert — it can't be signed without that wallet's key, and it reveals only on-chain-public data.
</Note>
