Getting Started
Welcome to the AK Market developer documentation. This guide covers the platform architecture, setup, and how to get a local development environment running.
Prerequisites
- Node.js >= 18
- pnpm (recommended) or npm
- Foundry (forge, cast, anvil) for smart contract development
- PostgreSQL for the matcher and backend databases
- Docker (optional, for containerized deployments)
Repository Structure
contracts-new/
├── packages/
│ ├── ctf-upstream/ # ConditionalTokens vendor package
│ ├── exchange-upstream/ # CTFExchange vendor package
│ └── polymarket-mvp/ # Deploy scripts, oracle adapter, wallets
├── backend/ # NestJS app backend
├── clob/matcher/ # Fastify CLOB matching engine
├── frontend/dapp/ # Frontend dApp
├── scripts/ # Market creation & utility scripts
└── docs-site/ # This documentation siteQuick Start
1. Install Dependencies
bash
# Root monorepo
pnpm install
# Backend
cd backend && npm install
# Matcher
cd clob/matcher && npm install2. Deploy Contracts (Local)
bash
cd packages/polymarket-mvp
# Start a local Anvil node
anvil &
# Deploy the full suite
make full-suiteThis deploys ConditionalTokens, CTFExchange, collateral token, oracle adapter, wallet factories, and registers a test market.
3. Sync Environment
bash
# Auto-sync matcher .env with deployed addresses
make sync-matcher-env4. Start Services
bash
# Terminal 1: Matcher
cd clob/matcher && npm run dev
# Terminal 2: Backend
cd backend && npm run start:dev
# Terminal 3: Frontend
cd frontend/dapp && npm run dev5. Verify
- Backend Swagger UI: http://localhost:3000/docs
- Matcher Swagger UI: http://localhost:3001/docs
- Frontend: http://localhost:5173
Next Steps
- Architecture Overview — understand the system design
- Deployment Guide — deploy to testnet or production
- Backend API Reference — interactive API docs
- Smart Contracts — contract reference