Expand live money launch requirements

This commit is contained in:
Theodore Song
2026-07-12 17:07:07 -04:00
parent f66155da69
commit b4a1cd709e
5 changed files with 158 additions and 24 deletions
+74 -9
View File
@@ -21,22 +21,34 @@ provider, wallet-signing, reconciliation, and monitoring steps below are done.
- Terms, risk disclosures, privacy policy, and jurisdiction policy.
- KYC / KYB provider.
- Age, location, sanctions, and restricted-market checks.
- Market category policy for elections, sports, finance, crypto, geopolitical
events, manipulated markets, disputed markets, and restricted outcomes.
- Record of user consent to every active terms, privacy, and risk-disclosure
version.
2. Account and wallet
- Real authentication.
- Production account database.
- Password reset, sign-out, session expiry, and optional MFA path.
- Non-custodial wallet connection or Polymarket deposit-wallet flow.
- User-controlled permissions for each agent.
- Revocation path so a user can stop agent trading immediately.
3. Funds
- Deposit provider.
- Withdrawal provider.
- Payment webhooks and failure handling.
- Balance reconciliation, statements, support, and accounting exports.
- Withdrawal review rules for fraud, sanctions, chargeback, and settlement
edge cases.
4. Execution
- Backend order router.
- Polymarket CLOB API credentials.
- EIP-712 order-signing flow.
- Order placement, cancellation, fill tracking, and position reconciliation.
- Idempotency keys, retry policy, rate limits, and stale-order protection.
- Server-side enforcement of user permissions and risk limits.
5. Risk and controls
- Per-agent max allocation.
@@ -45,11 +57,23 @@ provider, wallet-signing, reconciliation, and monitoring steps below are done.
- Manual approval mode.
- Emergency pause and cancel-all.
- Always-available withdrawal path.
- Admin kill switch.
- Market blacklist and category exclusion controls.
6. Audit and monitoring
- Durable append-only audit log.
- Signal, approval, order, fill, cancellation, deposit, and withdrawal events.
- Admin monitoring and incident response.
- Error tracking, uptime monitoring, webhook monitoring, and alert routing.
- Customer support process and data retention policy.
7. Testing and launch operations
- Paper-to-live parity tests.
- Test wallets and dry-run order intents.
- KYC, payments, wallet, CLOB, and webhook integration tests.
- Reconciliation tests for partial fills, cancellations, market resolution,
withdrawals, failed deposits, and duplicate webhooks.
- Rollback plan and incident response drill.
## Environment variables expected by `/api/live`
@@ -60,9 +84,23 @@ production.
- `KYC_PROVIDER`
- `KYC_API_KEY`
- `KYC_WEBHOOK_SECRET`
- `SANCTIONS_PROVIDER`
- `SANCTIONS_API_KEY`
- `GEOIP_PROVIDER`
- `GEOIP_API_KEY`
- `RESTRICTED_JURISDICTIONS`
- `TERMS_VERSION`
- `PRIVACY_VERSION`
- `RISK_DISCLOSURE_VERSION`
- `MARKET_POLICY_STORE`
- `AUTH_PROVIDER`
- `DATABASE_URL`
- `SESSION_SECRET`
- `ENCRYPTION_KEY`
- `PAYMENTS_PROVIDER`
- `PAYMENTS_API_KEY`
- `PAYMENTS_WEBHOOK_SECRET`
- `WEBHOOK_BASE_URL`
- `WALLET_PROVIDER`
- `WALLET_PROJECT_ID`
- `WALLET_API_KEY`
@@ -74,8 +112,14 @@ production.
- `POLYMARKET_CLOB_API_KEY`
- `POLYMARKET_CLOB_SECRET`
- `POLYMARKET_CLOB_PASSPHRASE`
- `RECONCILIATION_STORE`
- `ACCOUNTING_EXPORT_STORE`
- `RATE_LIMIT_STORE`
- `AUDIT_LOG_STORE`
- `MONITORING_DSN`
- `INCIDENT_WEBHOOK_URL`
- `ADMIN_ALERT_EMAIL`
- `CUSTOMER_SUPPORT_EMAIL`
- `LIVE_TRADING_ENABLED=true` only after final approval and end-to-end testing
Even when all variables are present, live order placement remains intentionally
@@ -97,12 +141,33 @@ Useful official docs:
## Final setup checklist
1. Choose and contract the KYC / eligibility provider.
2. Choose the deposit and withdrawal provider.
3. Choose the wallet or embedded-wallet provider and create a deposit wallet.
4. Derive or create Polymarket CLOB credentials for the approved signing flow.
5. Create durable append-only audit storage.
6. Add all environment variables in Vercel.
7. Run dry-runs against `/api/live` and verify audit events.
8. Complete legal review, terms, restricted jurisdiction rules, and support
procedures.
9. Only then set `LIVE_TRADING_ENABLED=true`.
2. Choose and contract the sanctions/watchlist and geo-IP/geofencing providers.
3. Choose the deposit and withdrawal provider.
4. Choose the wallet or embedded-wallet provider and create a deposit wallet.
5. Build production accounts: auth, sessions, password reset, sign-out, account
database, consent records, and portfolio history storage.
6. Derive or create Polymarket CLOB credentials for the approved signing flow.
7. Build the live order router with signing, submission, cancellation, fill
tracking, idempotency, rate limits, and stale-order protection.
8. Build continuous reconciliation for cash, open orders, fills, positions,
withdrawals, fees, and resolved markets.
9. Enforce every user permission and risk limit on the server, not only in the
browser.
10. Create durable append-only audit storage, statements, exports, monitoring,
alerting, and support procedures.
11. Complete legal review, terms, privacy policy, risk disclosures, restricted
jurisdiction rules, market category policy, and incident response plan.
12. Add all environment variables in Vercel.
13. Run dry-runs and test-wallet trades; verify webhooks, audit events,
reconciliation, and user withdrawal paths.
14. Only then set `LIVE_TRADING_ENABLED=true`.
## What still cannot be completed from code alone
- Legal approval and jurisdiction-specific advice.
- KYC/KYB, sanctions, payments, wallet, and support vendor contracts.
- Real provider API keys, webhook secrets, CLOB credentials, and deposit wallet
addresses.
- Bank, stablecoin, or payment settlement relationships.
- Production security review and incident-response ownership.
- Final decision to enable live trading.