Operations

Environment variables

Every variable for the site and API on Vercel, and for the engine.

Vercel (site, app and API)

Also listed in .env.example. Variables starting with NEXT_PUBLIC_ are built into the site, so changing one needs a redeploy.

VariableNeeded?What it does
DATABASE_URLYesNeon pooled connection string. Without it the app shows live prices and on-chain data only
ADMIN_TOKENRecommendedTurns on the admin calls. 24+ characters
MOTION_TOKENAfter launchMOTION's token address. Must match the engine
STANDIN_TOKENNoThe Montra pool used before launch. Must match the engine if set there
HL_ACCOUNTLive modeThe protocol's HyperCore account; linked in the app
SWAP_ADAPTER_ADDRESSLive modeShown in the app's contract list
NAV_REPORTER_ADDRESSLive modeShown in the app's contract list
ELYSIUM_RPC_URLNoDefault https://rpc.elysium.kinetiq.xyz
HL_NETWORKNotestnet makes /config report Hyperliquid testnet
NEXT_PUBLIC_API_URLNoOnly if the API runs somewhere else (the app appends /api/v1)
NEXT_PUBLIC_MOCK_DATALeave empty1 shows invented data to every visitor. Never on the public site

Engine

Also listed in engine/.env.example. Validated at start; a bad value stops the engine and the log names it.

Core

VariableDefaultWhat it does
DATABASE_URLrequiredNeon direct string. Same database as Vercel
EXECUTION_MODEpaperpaper = simulated fills. live = real money
PORT8080HTTP port (Render sets it)
ELYSIUM_RPC_URLhttps://rpc.elysium.kinetiq.xyz
MOTION_TOKENnoneMOTION's address once launched
STANDIN_TOKENUNSEEN 0x6d15…2819The live Montra pool to practise on before launch
ENGINE_SERVES_APIfalsetrue also serves /api/v1 from the engine
LOG_FORMATnonejson for hosted logs
LOG_LEVELinfodebug, info, warn, error

Paper

VariableDefaultWhat it does
PAPER_CAPITAL_USD25000Size of the pretend treasury
PAPER_RESETfalsetrue wipes the paper books on the next start. Set it back afterwards

Strategies and risk

VariableDefaultWhat it does
HEDGE_RATIO0.5Share of held HYPE kept short on the perp
MAX_DRAWDOWN_BPS1000Drawdown from the 24 h peak that halts everything (10 %)
MM_MARKETSHYPE-USDC,KNTQ-USDCHyperCore spot markets to quote
MONTRA_BAND_BPS600How far the pool must stray from fair value before trading
MONTRA_MAX_TRADE_HYPE1Largest single pool trade, in HYPE
MIN_HARVEST_HYPE0.25Pending fees before the engine claims them (live)
ARB_HL_COINnoneMOTION's HyperCore spot coin (like @1234). Turns arbitrage on
SNAPSHOT_SECONDS60How often the vault's value is saved

Live mode only (secrets)

Put them in the host's secret store, never in a file in git.

VariableWhat it is
CONFIRM_LIVEMust be exactly yes, together with EXECUTION_MODE=live
OPERATOR_KEYPrivate key of the Treasury's keeper. Also pays gas for fee claims
HL_ACCOUNTThe protocol's HyperCore account address
HL_AGENT_KEYPrivate key of a Hyperliquid API wallet approved by that account. It can trade but not withdraw
HL_NETWORKmainnet (default) or testnet
SWAP_ADAPTER_ADDRESSThe deployed MontraSwapAdapter (required for live Montra trading)
NAV_REPORTER_ADDRESSThe deployed NavReporter (read but not used by the engine yet)
ADMIN_TOKENOnly with ENGINE_SERVES_API, for admin calls on the engine's port

Addresses must be 0x + 40 hex characters and keys 0x + 64. The engine refuses to start in live mode unless CONFIRM_LIVE, OPERATOR_KEY, HL_ACCOUNT and HL_AGENT_KEY are all set.

Maintenance

VariableWhat it does
MIGRATE_ONLY1 applies the migrations and exits (cd engine && npm run migrate)
MIGRATIONS_DIROverrides where the migrations are read from