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

# Quickstart

> Index a market, read its staking APY, and quote a stake — then point users at the on-chain deposit.

<Card title="Example Code" type="tip">
  Checkout the [frontend example
  code](https://github.com/robin-markets/frontend-integration-example) for easy
  integration.
</Card>

The fastest path to a Robin integration runs almost entirely through the read-only [Integration API](/developers/api-overview): index a Polymarket market, read its staking APY, and quote a personalized stake. Sending the deposit is the only on-chain step, covered in [Deposits](/developers/deposits).

The base URL is `https://app.robin.markets/api/v1`. There is no auth and CORS is open, so every call below works from the browser or a server.

<Info>
  All token and USDC amounts are **6-decimal integer strings** (`"1500000"` =
  1.5). APY values are plain numbers in **percent** (`6` = 6.00%). A
  `conditionId` is the Polymarket condition id (bytes32 hex) and is the primary
  key everywhere.
</Info>

<Steps>
  <Step title="Index the market">
    `POST /markets` is the only mutating call in the API. It indexes any `conditionIds` Robin doesn't know yet — pulling them from Polymarket — and returns the same `{ markets, notFound }` shape as `GET /markets`, so the response is directly usable.

    You can pass any Polymarket `conditionId`, whether or not Robin has seen it before.

    <CodeGroup>
      ```bash curl theme={null}
      curl -X POST https://app.robin.markets/api/v1/markets \
        -H "Content-Type: application/json" \
        -d '{"conditionIds":["0xabc…"]}'
      ```

      ```ts TypeScript theme={null}
      const res = await fetch("https://app.robin.markets/api/v1/markets", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ conditionIds: ["0xabc…"] }),
      });
      const { markets, notFound } = await res.json();
      ```
    </CodeGroup>

    <Note>
      Reads (`GET /markets`, `GET /markets/{conditionId}`) are pure — they never write. A `404` or a `notFound` entry just means "not indexed yet". Call `POST /markets` once to index it from Polymarket, then read.
    </Note>
  </Step>

  <Step title="Read the APY headline">
    Each entry in the returned `markets[]` carries an APY breakdown. The headline fields are numbers in percent:

    | Field      | Meaning                                                    |
    | ---------- | ---------------------------------------------------------- |
    | `apy.yes`  | Total projected APY for the YES side                       |
    | `apy.no`   | Total projected APY for the NO side                        |
    | `apy.min`  | Lower bound across both sides                              |
    | `apy.max`  | Upper bound across both sides                              |
    | `apy.base` | Organic on-chain yield component, floored at the guarantee |

    The total folds three Robin bonuses on top of the organic base: the **6% guarantee floor**, the **+1% matching bonus** for the minority (pool-balancing) side, and the **+1% points boost**. Points are abstracted away — they appear only as a line in the APY response, never as something you handle directly.

    Use `apy.min` and `apy.max` for user-friendly apy display.

    <Note>
      The three bonuses are an off-chain programme run by Robin: they are computed at withdrawal and paid in a single USDC transaction from Robin's operator wallet, separate from the on-chain withdrawal. The vault itself pays only the organic yield (`apy.base`).
    </Note>
  </Step>

  <Step title="Read the APY headline">
    Each entry in the returned `markets[]` carries an APY breakdown. The headline fields are numbers in percent:

    | Field      | Meaning                                           |
    | ---------- | ------------------------------------------------- |
    | `apy.yes`  | Total projected APY for the YES side              |
    | `apy.no`   | Total projected APY for the NO side               |
    | `apy.min`  | Lower bound across both sides                     |
    | `apy.max`  | Upper bound across both sides                     |
    | `apy.base` | Organic yield component, floored at the guarantee |

    The total folds three Robin bonuses on top of the organic base: the **6% guarantee floor**, the **+1% matching bonus** for the minority (pool-balancing) side, and the **+1% points boost**. Points are abstracted away — they appear only as a line in the APY response, never as something you handle directly.

    Use `apy.min` and `apy.max` for user-friendly apy display.

    <Note>
      The three bonuses are an off-chain programme run by Robin: they are computed at withdrawal and paid in a single USDC transaction from Robin's operator wallet, separate from the on-chain withdrawal. The vault itself pays only the organic on-chain yield (`apy.base`).
    </Note>
  </Step>

  <Step title="Quote a personalized stake">
    `GET /quote` projects the APY a specific wallet would earn for a given stake. Pass `wallet`, the `conditionIds`, and aligned `yesAmounts` / `noAmounts` (6-decimal strings).

    ```bash theme={null}
    curl "https://app.robin.markets/api/v1/quote?wallet=0x…&conditionIds=0xabc…&yesAmounts=1000000&noAmounts=0"
    ```

    The response includes a `projectedApy` breakdown for that wallet:

    ```jsonc theme={null}
    {
      "projectedApy": {
        "total": 8,      // percent
        "base": 6,       // organic on-chain yield, floored at the guarantee
        "matching": 1,   // +1% for the pool-balancing side, if applicable
        "points": 1      // +1% × points coverage, personalized to this wallet
      }
    }
    ```

    <Warning>
      `wallet` is the user's  Polymarket on-chain account (a DepositWallet or legacy Gnosis Safe proxy), **not** their EOA. The `points` component is personalized to that wallet, so resolving it correctly matters. See [Wallets](/developers/wallets).
    </Warning>
  </Step>

  <Step title="Quote a personalized stake">
    `GET /quote` projects the APY a specific wallet would earn for a given stake. Pass `wallet`, the `conditionIds`, and aligned `yesAmounts` / `noAmounts` (6-decimal strings).

    ```bash theme={null}
    curl "https://app.robin.markets/api/v1/quote?wallet=0x…&conditionIds=0xabc…&yesAmounts=1000000&noAmounts=0"
    ```

    The response includes a `projectedApy` breakdown for that wallet:

    ```jsonc theme={null}
    {
      "projectedApy": {
        "total": 8,      // percent
        "base": 6,       // organic yield, floored at the guarantee
        "matching": 1,   // +1% for the pool-balancing side, if applicable
        "points": 1      // +1% × points coverage, personalized to this wallet
      }
    }
    ```

    <Warning>
      `wallet` is the user's  Polymarket on-chain account (a DepositWallet or legacy Gnosis Safe proxy), **not** their EOA. The `points` component is personalized to that wallet, so resolving it correctly matters. See [Wallets](/developers/wallets).
    </Warning>
  </Step>

  <Step title="Let the user stake on-chain">
    Quoting is read-only. Actually staking means building and sending a deposit transaction from the user's resolved wallet — the only on-chain step in this flow.

    The transport depends on the wallet kind (DepositWallet push vs. Safe proxy pull or push), and a fresh TWAP is required before the vault accepts the deposit. See [Deposits](/developers/deposits) for the full transaction-building walkthrough.
  </Step>
</Steps>

## Next steps

<CardGroup cols={3}>
  <Card title="API overview" icon="server" href="/developers/api-overview">
    Conventions, rate limits, and the full endpoint surface.
  </Card>

  <Card title="Deposits" icon="arrow-down-to-bracket" href="/developers/deposits">
    Build and send the on-chain deposit transaction.
  </Card>

  <Card title="Wallets" icon="wallet" href="/developers/wallets">
    Resolve the user's Robin staking wallet before any read or write.
  </Card>
</CardGroup>
