07 / Launch guide
From empty repo to live ledger.
Three deploys, in this order: contracts on Elysium, backend on Railway, frontend on Vercel. Start in paper mode.
7.1Prerequisites
- Node 20+, pnpm 9, and Foundry (
foundryup). - A deployer wallet with HYPE on Elysium for gas, plus separate committer and reporter keys.
- A Hyperliquid master account with sub-accounts created and one API wallet approved per sub-account.
- Railway and Vercel accounts connected to the repository; a WalletConnect project id.
7.2Deploy contracts (Foundry)
cd packages/contracts
forge install
forge test -vv
export ELYSIUM_RPC_URL=https://rpc.elysium.kinetiq.xyz
export DEPLOYER_KEY=0x… # funded with HYPE on Elysium; use a hardware wallet in production
forge script script/Deploy.s.sol:Deploy \
--rpc-url $ELYSIUM_RPC_URL \
--private-key $DEPLOYER_KEY \
--broadcast --verify --chain-id 99901
# Output:
# ProofRegistry 0x…
# BuybackVault 0x…After deploy, grant the committer role on ProofRegistry and the reporter and keeper roles on BuybackVault, then set the initial high-water mark to the starting bankroll. Record both addresses; they go into both Railway and Vercel.
7.3Backend on Railway
Create a service from the repo with root apps/api, add the Postgres plugin, and set:
# Railway → backend service → Variables
EXECUTION_MODE=PAPER_SIMULATION # PAPER_SIMULATION | HYPERLIQUID_TESTNET | HYPERLIQUID_MAINNET
ELYSIUM_RPC_URL=https://rpc.elysium.kinetiq.xyz
ELYSIUM_CHAIN_ID=99901
PROOF_REGISTRY_ADDRESS=0x…
BUYBACK_VAULT_ADDRESS=0x…
COMMITTER_PRIVATE_KEY=0x… # ProofRegistry committer role; holds a little HYPE for gas
REPORTER_PRIVATE_KEY=0x… # BuybackVault reporter role
HL_MASTER_ADDRESS=0x… # Hyperliquid master account (not the public desk address)
HL_API_WALLET_KEYS=0x…,0x…,0x… # agent keys, one per sub-account
HL_SUBACCOUNTS=0x…,0x…,0x…
ANTHROPIC_API_KEY=… # council model provider
MAX_LEVERAGE=5
MAX_POSITION_USD=25000
DAILY_DRAWDOWN_KILL_PCT=4
DATABASE_URL=postgresql://… # Railway Postgres plugin
PORT=8080
CORS_ORIGIN=https://your-site.vercel.appPrivate keys belong in Railway variables only, never in the repository or any NEXT_PUBLIC_ variable. Expose the service on a public domain; the WebSocket shares the HTTP port at /ws.
7.4Frontend on Vercel
# Vercel → project (root: apps/web) → Settings → Environment Variables
NEXT_PUBLIC_API_URL=https://desk-api.up.railway.app
NEXT_PUBLIC_WS_URL=wss://desk-api.up.railway.app/ws
NEXT_PUBLIC_ELYSIUM_RPC_URL=https://rpc.elysium.kinetiq.xyz
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=…
NEXT_PUBLIC_PROOF_REGISTRY=0x…
NEXT_PUBLIC_BUYBACK_VAULT=0x…
NEXT_PUBLIC_TOKEN_ADDRESS=0x…| Variable | Used for |
|---|---|
| NEXT_PUBLIC_API_URL | REST base for stats, trades, burns, council |
| NEXT_PUBLIC_WS_URL | Live updates on the desk and ledger |
| NEXT_PUBLIC_ELYSIUM_RPC_URL | In-browser verification and wallet chain config |
| NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID | RainbowKit / WalletConnect |
| NEXT_PUBLIC_PROOF_REGISTRY | getTrade() reads for independent verification |
| NEXT_PUBLIC_BUYBACK_VAULT | HWM and reserve reads |
| NEXT_PUBLIC_TOKEN_ADDRESS | Burned-balance reads at 0x…dEaD |
7.5Go-live checklist
- Run at least two weeks in
PAPER_SIMULATION; every paper trade should reachVERIFIED. - Switch to
HYPERLIQUID_TESTNET; confirm rotation, stops and receipts against testnet fills. - Trigger the kill switch deliberately on testnet and confirm the book flattens and entries halt.
- Fund mainnet sub-accounts, set
EXECUTION_MODE=HYPERLIQUID_MAINNET, redeploy. - Publish the contract addresses and the company wallet on the site and in
/llms.txt.