Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
72 lines
3.7 KiB
Plaintext
72 lines
3.7 KiB
Plaintext
# ── Predikt CLOB Relay Operator — environment ─────────────────────────────
|
|
# Copy to .env and fill in. NEVER commit .env. The operator private key must
|
|
# never be logged; the relay redacts it from all structured logs.
|
|
|
|
# HTTP
|
|
PORT=8787
|
|
# Requests per minute per IP allowed against write endpoints (POST/DELETE /orders)
|
|
SUBMIT_RATE_LIMIT_PER_MIN=60
|
|
# Requests per minute per IP allowed against read endpoints (GET book/orders/trades/health)
|
|
READ_RATE_LIMIT_PER_MIN=600
|
|
# Comma-separated browser origins allowed via CORS. NEVER use `*`.
|
|
# Set to the deployed app origin(s), e.g. https://app.predikt.example
|
|
RELAY_ALLOWED_ORIGINS=http://localhost:3000
|
|
# Number of reverse-proxy hops in front of the relay (express `trust proxy`).
|
|
# Use 1 behind a single load balancer / ingress; 0 if directly exposed.
|
|
TRUST_PROXY=1
|
|
|
|
# Chain / RPC
|
|
CHAIN_ID=137
|
|
RPC_URL=https://polygon-rpc.com
|
|
|
|
# Predikt on-chain layer (deployed CTFExchange from predikt-contracts/ctf-exchange)
|
|
EXCHANGE_ADDRESS=0x0000000000000000000000000000000000000000
|
|
# Collateral (USDC, 6 decimals) and Conditional Tokens Framework (ERC1155) used
|
|
# by the exchange. Must equal the exchange's `collateral` and `ctf` addresses.
|
|
USDC_ADDRESS=0x0000000000000000000000000000000000000000
|
|
CTF_ADDRESS=0x0000000000000000000000000000000000000000
|
|
|
|
# Operator wallet. This EOA MUST have been granted the operator role on the
|
|
# exchange by the deployer via `CTFExchange.addOperator(<this address>)`.
|
|
# It is the msg.sender of every fillOrder / matchOrders tx. KEEP SECRET.
|
|
OPERATOR_PK=0x0000000000000000000000000000000000000000000000000000000000000000
|
|
|
|
# Persistence: path to the SQLite database file (created if missing).
|
|
DATABASE_PATH=./data/relay.db
|
|
|
|
# Optional: block to start scanning OrderFilled/OrdersMatched/OrderCancelled
|
|
# events from. Leave blank to start at the current head on first boot.
|
|
START_BLOCK=
|
|
|
|
# ── Market maker (npm run mm) ─────────────────────────────────────────────
|
|
# The on-chain market maker seeds two-sided liquidity into the relay book so
|
|
# single-side market orders have resting orders to match. It reuses the chain /
|
|
# exchange env above (CHAIN_ID, RPC_URL, EXCHANGE_ADDRESS, USDC_ADDRESS,
|
|
# CTF_ADDRESS). See MARKETMAKER.md. KEEP MM_PRIVATE_KEY SECRET — never commit it.
|
|
|
|
# Maker EOA key: the source of funds and the signer of every posted order. This
|
|
# is a NORMAL user account (NOT the operator OPERATOR_PK above). Fund it with
|
|
# USDC (for BUYs) and outcome tokens / MM_MINT_SETS (for SELLs).
|
|
MM_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000000
|
|
# Base URL of the running relay REST API (POST/DELETE /orders, GET /book).
|
|
RELAY_URL=http://localhost:8787
|
|
# Comma-separated markets to make: outcome token ids (uint256 decimal strings)
|
|
# and/or oracle market ids (discovered via ORACLE_API_URL). Each resolves to its
|
|
# YES + NO token pair on-chain.
|
|
MM_MARKETS=
|
|
# Half-spread per depth level, in basis points of the 0..1 probability.
|
|
MM_SPREAD_BPS=100
|
|
# Notional size per order, in whole USDC.
|
|
MM_ORDER_SIZE=10
|
|
# Depth: number of price levels quoted per side (max 20).
|
|
MM_LEVELS=3
|
|
# Refresh cadence in ms: cancel stale orders + re-post the fresh ladder.
|
|
MM_REFRESH_MS=30000
|
|
# When true, the maker mints outcome-token sets via ConditionalTokens.splitPosition
|
|
# (spends USDC) to fund the SELL side. Off by default; otherwise pre-mint/fund
|
|
# outcome tokens yourself and the SELL side is skipped when under-funded.
|
|
MM_MINT_SETS=false
|
|
# Optional oracle backend base URL used for the mid fallback (market probability)
|
|
# and for discovering token ids from oracle market ids. Same backend liquify uses.
|
|
# ORACLE_API_URL=https://api.oracle.markets/v0
|