Skip to main content
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

1

Toolchain

node --version          # ≥ 22.13 (pnpm@9 hard-requires this)
pnpm --version          # ≥ 9.0.0
sui --version           # ≥ 1.40 (testnet client)
docker --version        # any recent
If nvm complains about ~/.npmrc globalconfig/prefix, either pin with nvm alias default 22.13 or clean those lines out of ~/.npmrc.
2

Sui CLI on testnet

sui client switch --env testnet
sui client active-address
Note the address. The deploy + keeper signer.
3

Funded testnet DUSDC

DUSDC is the only quote asset Predict accepts. Request testnet DUSDC via the DeepBook tally form. Verify your balance:
sui client gas
sui client objects --json | jq '.[] | select(.data.type | endswith("dusdc::DUSDC"))'

Bootstrap

1

Clone + install

git clone https://github.com/abhimanyu14/sui-overflow-26
cd sui-overflow-26
pnpm install
cp .env.example .env
2

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.
Full schema: see Environment Variables.
3

Bring up infrastructure

docker compose up -d redis postgres
pnpm --filter @darkpool/server db:migrate
Verify both are up:
docker ps --format 'table {{.Names}}\t{{.Status}}'
4

Build + test Move

pnpm typecheck
pnpm --filter @darkpool/shared build
cd packages/move && sui move build && sui move test
# → 17/17 tests pass
cd ../..
5

Publish DarkPool to testnet

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 + all shared object IDs back to .env. Verify:
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
6

Start the backend stack

One command:
docker compose up -d --build
Builds one backend image and starts:
  • api on :8081 (REST + WebSocket)
  • indexer (Sui events → Postgres)
  • quote-worker (Redis cache + WS pubsub)
  • resolver on :8082 (settlement endpoint + auto-settle keeper)
  • redis + postgres
Verify:
curl -s http://localhost:8081/health | jq
The agent runtime is opt-in: docker compose --profile agent up -d (status on :8083).
7

Run the frontend

pnpm --filter @darkpool/frontend dev
# → http://localhost:5173
You should see the landing page with the lime CTA.

First trade

1

Connect a wallet

Click Connect Wallet (Suiet/Slush) or Sign in with Google (Enoki zkLogin). The address chip on the right populates.
2

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

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

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

Watch the indexer pick it up

Within ~5s, your fill lands in /profile activity. Refresh /positions to see the row marked to live fairPerToken.

Next steps

End-to-end walkthrough

Run every flow: Predict price trade, scaffolded event market, vault deposit, agent fleet, optimistic oracle.

Scaffold an event market

Publish a full YES + NO + Settlement Move package for any binary question.

Run an AI agent

Spin up an LLM-backed agent with a markdown mandate, on its own status port.

Architecture deep-dive

The component diagram, the three augmentations on top of Predict, and why each tradeoff.