## Deploy order (protocol)

1. **Registry** — `cd contracts && forge script script/DeployRegistry.s.sol --rpc-url $BASE_RPC_URL --broadcast`
2. **PUM** — launch protocol token via Clanker (same path as creator tokens)
3. **Backend** — configure `.env` from `.env.example`, fund protocol wallet with ETH + operational USDC
4. **Verify** — `npx tsx backend/scripts/avantis-test.ts read`
5. **Frontend** — set `VITE_API_BASE`, deploy static/Vite build

## Backend environment

Copy `backend/.env.example` → `backend/.env`.

### Required

| Variable | Purpose |
| --- | --- |
| `PROTOCOL_PRIVATE_KEY` | Signs all onchain engine txs |
| `PROTOCOL_TOKEN_ADDRESS` | PUM token |
| `REGISTRY_CONTRACT_ADDRESS` | Enrolled token registry |
| `DIEM_TOKEN_ADDRESS` | DIEM endowment token |
| `BASE_RPC_URL` | Primary RPC |

### Recommended

| Variable | Purpose |
| --- | --- |
| `BASE_RPC_FALLBACKS` | Comma-separated RPC fallbacks |
| `CLANKER_FEE_LOCKER_ADDRESS` | Fee claim target (defaults in `config.ts`) |
| `DEPLOY_BLOCK` | Registry deploy block for log indexing |

### Optional (feature flags)

| Variable | Purpose |
| --- | --- |
| `VENICE_API_KEY` | Venice LLM desk agent; or stake VVV + `VENICE_AUTO_MINT_KEY=true` |
| `VENICE_AGENT_ENABLED` | Set `false` to skip LLM and use momentum signals only |
| `PINATA_JWT` | IPFS pin for creator token images at launch |
| `NEYNAR_API_KEY` / `NEYNAR_CLIENT_ID` | Farcaster integration |
| `SIGNAL_*` | Momentum/volatility entry filters (see [Agents & signals](/engine/agents-and-signals)) |

### Ignore (legacy placeholders)

These keys exist in `.env.example` but **no production worker reads them**:

- `CLANKER_API_KEY` — deploy is onchain via `clanker-sdk`, not a REST API
- `ONEINCH_API_KEY` — swaps use Uniswap routers in `uniswap.ts` / `univ4.ts`

Never commit `.env` or secrets.

## Local development

```bash
# Contracts
cd contracts && forge test

# Backend
cd backend && cp .env.example .env && npm install && npm run dev

# Frontend (repo root)
npm install && npm run dev
```

Backend default port: **3001**. Frontend: Vite dev server (see `vite.config.js`).

## Documentation site

This repo (`pumperp-docs`):

```bash
cp .env.example .env.local
pnpm install
pnpm dev          # http://localhost:3000
pnpm check:frontmatter
pnpm build
```

Production env:

```
NEXT_PUBLIC_DOCS_BASE_URL=https://docs.pumperp.com
NEXT_PUBLIC_GITHUB_REPO_URL=https://github.com/fraserbrownirl/pumperp-docs
NEXT_PUBLIC_GITHUB_BRANCH=main
```

### Vercel + DNS

1. Import `pumperp-docs` repo (git push → auto deploy)
2. Set env vars above
3. **One** DNS record for `docs`: A → `76.76.21.21` (do not also CNAME the same host)

## Docs vs app repos

| Repo | Host |
| --- | --- |
| `pumperp` | pumperp.com + API |
| `pumperp-docs` | docs.pumperp.com |

Keep docs in sync when API or fee model changes.