-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
164 lines (140 loc) · 8.26 KB
/
Copy path.env.example
File metadata and controls
164 lines (140 loc) · 8.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# ───────────────────────────────────────────────────────────────────────────
# Polynuts environment variables
# Copy this file to `.env.local` (which is git-ignored) and fill in real values.
# Then restart `npm run dev` to pick up the changes.
# ───────────────────────────────────────────────────────────────────────────
# ── REQUIRED ──────────────────────────────────────────────────────────────
# Chain ID. 8453 = Base mainnet. Don't change unless you're testing
# against a different deployment.
NEXT_PUBLIC_CHAIN_ID=8453
# JSON-RPC endpoint for Base. The public URL works for browsing markets
# but will rate-limit hard on the leaderboard event scan and order
# polling. For anything beyond a quick demo, use a paid provider:
#
# - Alchemy: https://dashboard.alchemy.com (free tier is plenty)
# - QuickNode: https://quicknode.com
# - Infura: https://infura.io
#
# Example:
# https://base-mainnet.g.alchemy.com/v2/abc123-your-key-here
NEXT_PUBLIC_RPC_URL=https://base-mainnet.public.blastapi.io
# ── REQUIRED IN PRODUCTION ────────────────────────────────────────────────
# Referrer address. Every fill routes referrer fees to this address via
# the Thetanuts SDK's referrer parameter. Set to YOUR fee-earning address
# (a Gnosis Safe multisig in production per PRD §11) to actually collect
# fees. Leaving it at 0x0000…0000 burns every fee.
#
# REQUIRED in production: `next build` now THROWS when NODE_ENV=production
# and this is missing or the zero address (see src/lib/sdk/clients.ts), so a
# fee-leaking deploy can't ship. It must be set in your deploy platform's env
# (e.g. Vercel project settings), not only in a local .env.local. Dev still
# runs fine with it unset/zero.
#
# Check your fee split:
# await client.optionBook.getReferrerFeeSplit(YOUR_ADDRESS)
NEXT_PUBLIC_REFERRER_ADDRESS=0x0000000000000000000000000000000000000000
# WalletConnect v2 project ID. Without this, only browser-extension
# wallets work (MetaMask, Coinbase Wallet, Rainbow, injected). Mobile
# wallets via WalletConnect QR code require this.
#
# Get one free at: https://cloud.walletconnect.com
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
# ── OPTIONAL ──────────────────────────────────────────────────────────────
# Partner fee broker. When set to a deployed PartnerFeeBroker address, every
# fill routes THROUGH that broker so it skims its immutable feeBps (an
# alternative to the protocol referrer split above — and self-serve: deploy your
# own at the Thetanuts /partner page, no whitelisting needed).
#
# ⚠️ This makes the TAKER pay premium + fee. Leave it unset (or zero) to keep
# the default OptionBook path where the taker pays premium only — no added fee.
# Opt-in on purpose: set it only for testing or once you intend to charge.
# NEXT_PUBLIC_PARTNER_BROKER_ADDRESS=
# Display name. Used in the page title, RainbowKit modal header, and
# the OG win-card. Default is fine for most cases.
NEXT_PUBLIC_APP_NAME=Polynuts
# Comma-separated ISO country codes blocked by the geo-block edge proxy
# (src/proxy.ts). Server-only — do NOT add a NEXT_PUBLIC_ prefix, that would
# ship the blocklist to the browser (and the proxy ignores it anyway).
# Empty/unset means no country is blocked — the site is open to all regions,
# including the US. Set it to restrict specific regions, e.g.:
#
# BLOCKED_COUNTRIES=IR,KP,SY,CU,RU,BY
#
# The country is read from Vercel's `x-vercel-ip-country` header, so the block
# only takes effect on Vercel (or a host that sets that header); on any other
# host the header is absent and requests pass through.
# BLOCKED_COUNTRIES=
# Override the Thetanuts SDK's default WebSocket URL. The default
# (wss://ws.thetanuts.finance/v4) isn't reachable from public networks
# right now — Polynuts uses Deribit's public WS for live BTC/ETH price
# ticks instead. Setting this AND wiring `wsUrl` into the
# ThetanutsClient constructor in src/lib/sdk/clients.ts would re-enable
# the SDK's order-update subscriptions.
# NEXT_PUBLIC_THETANUTS_WS_URL=
# Sentry DSN. The custom logger at src/lib/sdk/logger.ts forwards
# warnings/errors from the SDK to globalThis.Sentry.captureMessage if
# Sentry is loaded. Install @sentry/nextjs and set this to start
# capturing.
# NEXT_PUBLIC_SENTRY_DSN=
# ── PRE-LAUNCH ("coming soon") GATE ───────────────────────────────────────
#
# While LAUNCH_MODE is on, the proxy (src/proxy.ts) funnels EVERY visitor to
# /waitlist — the landing page and the app (/markets, /portfolio, …) stay
# hidden. /admin stays reachable (it has its own password). On launch day,
# unset LAUNCH_MODE (or set it to `off`) and redeploy to open everything.
#
# Accepted "on" values: waitlist | prelaunch | coming-soon | 1 | true | on.
# Server-only — do NOT add a NEXT_PUBLIC_ prefix.
# LAUNCH_MODE=waitlist
# Owner preview bypass for the locked site. Visit any URL with
# `?preview=<this value>` once to set an httpOnly cookie that lets you browse
# the real app while LAUNCH_MODE is on (the secret is stripped from the URL
# afterward). Leave unset to disable previewing entirely. Use a long random
# value; server-only (never NEXT_PUBLIC_).
# LAUNCH_PREVIEW_SECRET=
# ── SUPABASE (leaderboard, waitlist, feedback) ────────────────────────────
#
# Required for the leaderboard + persisted activity: set all three SUPABASE_
# vars below (and CRON_SECRET if you run the cron sync route at
# /api/cron/sync-leaderboard); without them the app falls back to reading
# trade history directly from the indexer.
#
# The waitlist (/api/waitlist) and feedback (/api/feedback) write routes ALSO
# require SUPABASE_SERVICE_ROLE_KEY — they insert server-side with the service
# role (the public anon key can no longer write to those tables; see migration
# 0005). With the key unset, those forms render but return 503 on submit.
#
# When the three SUPABASE_ vars are set, /activity and /portfolio read
# trade history + realized PnL from your own Supabase. On each page
# visit the server fetches the user's data from the Thetanuts indexer,
# upserts to `trades` + `settlements`, and returns rows. No cron needed.
#
# When unset, the pages fall back to reading directly from the indexer.
#
# Setup:
# 1. Create a Supabase project at supabase.com (free tier is fine).
# 2. Apply supabase/migrations/0001_leaderboard.sql via SQL editor.
# 3. Copy URL + anon key + service-role key from Project Settings → API.
#
# NEVER expose SUPABASE_SERVICE_ROLE_KEY to the browser — it bypasses RLS.
# NEXT_PUBLIC_SUPABASE_URL=
# NEXT_PUBLIC_SUPABASE_ANON_KEY=
# SUPABASE_SERVICE_ROLE_KEY=
# CRON_SECRET — only needed if you ALSO want the optional cron at
# /api/cron/sync-leaderboard. That's for keeping inactive wallets'
# settlements current in a cross-user leaderboard. If you don't have a
# leaderboard or only care about active users, leave this unset.
# CRON_SECRET=
# ── ADMIN DASHBOARD (/admin) ──────────────────────────────────────────────
#
# Password that unlocks the internal /admin console (waitlist signups,
# activation, all trades, traders, feedback). The dashboard reads the
# write-only waitlist/feedback tables with the service role, so it ALSO needs
# the three SUPABASE_ vars + SUPABASE_SERVICE_ROLE_KEY above to show data.
#
# Set a long, random value (e.g. `openssl rand -base64 24`). It's the HMAC key
# for the session cookie too, so rotating it logs everyone out. With this
# unset, /admin shows a "not configured" notice and the gate can't be unlocked.
# Server-only — do NOT add a NEXT_PUBLIC_ prefix, that would ship it to the
# browser.
# ADMIN_PASSWORD=