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

# Quickstart

> Clone the repo, publish the Move package, and run the full local stack.

This guide takes you from a fresh clone to a running local DarkPool stack in roughly 30 minutes. Move package published to testnet, backend services on Docker, and the React frontend trading against your own oracle ids.

## Prerequisites

<Steps>
  <Step title="Toolchain">
    ```bash theme={"system"}
    node --version          # >= 22.13 (pnpm@9 hard-requires this)
    pnpm --version          # >= 9.0.0
    sui --version           # >= 1.40 (testnet client)
    docker --version        # any recent
    ```

    <Tip>
      If `nvm` complains about `~/.npmrc` `globalconfig`/`prefix`, either pin with `nvm alias default 22.13` or clean those lines out of `~/.npmrc`.
    </Tip>
  </Step>

  <Step title="Sui CLI on testnet">
    ```bash theme={"system"}
    sui client switch --env testnet
    sui client active-address
    ```

    Note the address. The deploy and keeper signer.
  </Step>

  <Step title="Funded testnet DUSDC">
    DUSDC is the only quote asset Predict accepts. Request testnet DUSDC via the [DeepBook tally form](https://tally.so/r/Xx102L). Verify your balance:

    ```bash theme={"system"}
    sui client gas
    sui client objects --json | jq '.[] | select(.data.type | endswith("dusdc::DUSDC"))'
    ```
  </Step>
</Steps>

## Bootstrap

<Steps>
  <Step title="Clone + install">
    ```bash theme={"system"}
    git clone https://github.com/AbhimanyuAjudiya/DarkPool.git
    cd DarkPool
    pnpm install
    cp .env.example .env
    ```
  </Step>

  <Step title="Fill .env">
    At minimum:

    * `RESOLVER_KEY`. Run `sui keytool export --key-identity $(sui client active-address)` and paste the `suiprivkey1…` string. The auto-settle keeper signs with this.
    * `SPONSOR_KEY`. Same shape. Pays gas for self-sponsored user trades via `/v1/sponsor`. Falls back to `RESOLVER_KEY` when blank. Fund it with 0.5 SUI or more on testnet.
    * `AGENT_KEY`. Only required if you're running the AI Agent fleet. Fine to reuse the resolver key for dev.
    * `PYTH_BTC_USD_PRICE_INFO_OBJECT`. See [Pyth Sui docs](https://docs.pyth.network/price-feeds/core/contract-addresses/sui).

    Full schema: see [Environment Variables](/deployment/environment).
  </Step>

  <Step title="Bring up infrastructure">
    ```bash theme={"system"}
    docker compose up -d redis postgres
    pnpm --filter @darkpool/server db:migrate
    ```

    Verify both are up:

    ```bash theme={"system"}
    docker ps --format 'table {{.Names}}\t{{.Status}}'
    ```
  </Step>

  <Step title="Build + test Move">
    ```bash theme={"system"}
    pnpm typecheck
    pnpm --filter @darkpool/shared build
    cd packages/move && sui move build && sui move test
    # -> 17/17 tests pass
    cd ../..
    ```
  </Step>

  <Step title="Publish DarkPool to testnet">
    ```bash theme={"system"}
    cd packages/move
    sui client publish --json --gas-budget 200000000 > /tmp/dp-publish.json
    cd ../..
    pnpm env:from-publish /tmp/dp-publish.json
    ```

    `env:from-publish` writes the new `DARKPOOL_PACKAGE_ID` plus all shared object IDs back to `.env`. Verify:

    ```bash theme={"system"}
    grep -E "^(DARKPOOL_PACKAGE_ID|MARKET_REGISTRY_ID|AGENT_REGISTRY_ID|AUTO_REDEEM_QUEUE_ID|OO_CONFIG_ID|VOTE_LEDGER_ID)=" .env
    # -> all set to 0x-prefixed 64-char addresses
    ```
  </Step>

  <Step title="Start the backend stack">
    One command:

    ```bash theme={"system"}
    docker compose up -d --build
    ```

    Builds one backend image and starts:

    * **api** on `:8081` (REST + WebSocket)
    * **indexer** (Sui events to Postgres)
    * **quote-worker** (Redis cache + WS pubsub)
    * **resolver** on `:8082` (settlement endpoint + auto-settle keeper)
    * **redis** + **postgres**

    Verify:

    ```bash theme={"system"}
    curl -s http://localhost:8081/health | jq
    ```

    The agent runtime is opt-in: `docker compose --profile agent up -d` (status on `:8083`).
  </Step>

  <Step title="Run the frontend">
    ```bash theme={"system"}
    pnpm --filter @darkpool/frontend dev
    # -> http://localhost:5173
    ```

    You should see the landing page with the lime CTA.
  </Step>
</Steps>

## First trade

<Steps>
  <Step title="Connect a wallet">
    Click **Connect Wallet** (Suiet/Slush) or **Sign in with Google** (Enoki zkLogin). The address chip on the right populates.
  </Step>

  <Step title="Pick a market">
    Go to `/markets`. The crypto tab opens with the **Up or Down** quick cards (15 Min / Hourly / Daily). Click any card or pick a BTC oracle.
  </Step>

  <Step title="Create + fund a PredictManager">
    Go to `/profile`. If you don't have a PredictManager yet you'll see a **Create PredictManager** card. Click it, then deposit DUSDC.
  </Step>

  <Step title="Place a trade">
    Back on the market page, type `$10` in the buy panel and click **Trade**. Gas is sponsored. You don't need SUI in your address.
  </Step>

  <Step title="Watch the indexer pick it up">
    Within about 5s, your fill lands in `/profile` activity. Refresh `/positions` to see the row marked to live `fairPerToken`.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="End-to-end walkthrough" icon="route" href="/guides/end-to-end">
    Run every flow: Predict price trade, scaffolded event market, vault deposit, agent fleet, optimistic oracle.
  </Card>

  <Card title="Scaffold an event market" icon="plus" href="/guides/create-event-market">
    Publish a full YES + NO + Settlement Move package for any binary question.
  </Card>

  <Card title="Run an AI agent" icon="robot" href="/guides/running-agent">
    Spin up an LLM-backed agent with a markdown mandate, on its own status port.
  </Card>

  <Card title="Architecture deep-dive" icon="sitemap" href="/architecture">
    The component diagram, the three augmentations on top of Predict, and the tradeoffs behind each pick.
  </Card>
</CardGroup>
