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

# Developer Quickstart

> Go from zero to your first counsel API call and your first constructed bet in minutes.

counsel is an L1-native parimutuel prediction market on the XRP Ledger. There is no bridge, no smart contract, and no database of record: the ledger is the registry, the pool, and the audit trail. As a developer you read markets over a public REST API, construct an unsigned XRPL Payment, and sign it yourself in your own wallet.

This quickstart takes you through the canonical developer path: list markets, construct a bet, sign and submit it.

<Note>
  No API key is required. The REST API is read-only and public. counsel never holds your key and never signs for you: you always sign your own transactions in your own wallet. Non-custodial by construction.
</Note>

<Steps>
  <Step title="Call the public API and read live odds">
    List open markets and read the live tote board. Each outcome reports `implied_prob` (the outcome's share of the pool) and `payout_per_unit` (the indicative XRP returned per 1 XRP staked if that outcome wins, after the fee).

    <CodeGroup>
      ```bash curl theme={null}
      curl https://api.counsel.markets/markets
      ```

      ```ts counsel-js theme={null}
      import { Counsel } from "counsel-js";

      const counsel = new Counsel({ baseUrl: "https://counsel.markets" });
      const { markets } = await counsel.markets();
      console.log(markets[0]);
      ```
    </CodeGroup>

    Pick a market and the outcome index you want to back. The outcome index becomes the `DestinationTag` of your bet Payment.
  </Step>

  <Step title="Construct an unsigned bet">
    Ask the API to build the bet for you. `GET /markets/:id/bet-intent` takes your `account`, the `outcome` index, and the `amount` in XRP, and returns an unsigned XRPL Payment plus the projected odds after your stake is added to the pool.

    <CodeGroup>
      ```bash curl theme={null}
      curl "https://api.counsel.markets/markets/MARKET_ID/bet-intent?account=YOUR_ADDRESS&outcome=0&amount=5"
      ```

      ```ts counsel-js theme={null}
      const intent = await counsel.betIntent({
        marketId: markets[0].id,
        account: "YOUR_ADDRESS",
        outcome: 0,
        amount: 5,
      });
      console.log(intent);
      ```
    </CodeGroup>

    The Payment is a native XRP `Payment` to the market's pool account, with `DestinationTag` set to the outcome index and `SourceTag` set to counsel's attribution tag. The projected odds let you preview your stake's effect on the tote board before you commit.

    <Tip>
      Odds are indicative while a market is open and become final at `bet_cutoff`. A flat 3% fee is taken from the whole gross pool before the split, never selectively on winners.
    </Tip>
  </Step>

  <Step title="Sign and submit it">
    Sign the unsigned Payment with your own key in your own wallet (Xaman, GemWallet, Crossmark, or any XRPL client), then submit it to the XRP Ledger. counsel is non-custodial: the signature happens entirely on your side.

    The `counsel-js` SDK wraps fetch, sign, and submit into a single call when you bring your own seed.

    <CodeGroup>
      ```ts counsel-js theme={null}
      import { Counsel } from "counsel-js";

      const counsel = new Counsel({ baseUrl: "https://counsel.markets" });
      const { markets } = await counsel.markets();

      // fetch an unsigned bet intent, sign with your own key, submit
      const hash = await counsel.placeBet(process.env.BOT_SEED, markets[0].id, 0, 5);
      console.log("bet placed:", hash);
      ```
    </CodeGroup>

    Once the transaction validates, your stake is in the pool. The pool sits in a per-market account secured by a multisig SignerList with the master key disabled, so no single key can move funds, and everything is on-chain and recomputable.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="API Overview" href="/api/overview">
    The full read-only REST surface: markets, positions, feeds, profiles, and the leaderboard.
  </Card>

  <Card title="Building Bots" href="/guides/building-bots">
    A bot is an ordinary XRPL client. Read a market, fetch an unsigned intent, sign with its own key, and submit.
  </Card>
</CardGroup>
