Documentation
Everything the interface shows is either read from a contract, read from a labelled data provider, or explicitly marked unavailable. This page explains each source and how to configure it.
LarkPerps is a unified market protocol interface: perpetual futures and binary prediction markets on assets referenced across Robinhood Chain. The application is production-oriented in the strict sense — it is ready to talk to real contracts, and it does not simulate anything it cannot verify.
Network settings live in src/config/chains.ts and are read from NEXT_PUBLIC_CHAIN_ID, NEXT_PUBLIC_CHAIN_NAME, NEXT_PUBLIC_RPC_URL and NEXT_PUBLIC_EXPLORER_URL. Robinhood Chain (4663) is the default. Current deployment: Robinhood Chain · id 4663 · source: default.
Browser reads go through the same-origin relay /api/rpc (read-only method allow-list), so a keyed server RPC (RPC_URL) never enters the bundle. Wallets broadcast signed transactions through their own provider.
Five addresses gate every write path. Empty means disabled — the UI says so instead of pretending.
| Contract | Env | Status |
|---|---|---|
| Perp ManagerPerpetual markets: positions, mark price, funding, open interest, liquidation. | NEXT_PUBLIC_PERP_MANAGER_ADDRESS | not configured |
| Prediction FactoryCreates and lists prediction markets; each market is its own contract. | NEXT_PUBLIC_PREDICTION_FACTORY_ADDRESS | not configured |
| Collateral VaultDeposits and withdrawals of the collateral asset; margin accounting. | NEXT_PUBLIC_COLLATERAL_VAULT_ADDRESS | not configured |
| Oracle AdapterOn-chain price and resolution feed consumed by markets. | NEXT_PUBLIC_ORACLE_ADDRESS | not configured |
| Collateral TokenERC-20 accepted by the vault (e.g. USDG). | NEXT_PUBLIC_COLLATERAL_TOKEN_ADDRESS | not configured |
The contracts are real and live in contracts/ (Foundry, solc 0.8.24): CollateralVault, OracleAdapter, PerpManager, PredictionMarket + MarketFactory, and a LarkDeployer that creates, wires, freezes and hands over all of them in one transaction. Deploy from /deploy with your own wallet — no private key ever touches the server. ABIs in src/contracts/ are generated from the build; adapters live in src/lib/contracts/; components never call contract methods directly.
pnpm keeper, or /api/keeper). Trades revert on stale feeds.Two adapters, tried in order: the on-chain oracle (NEXT_PUBLIC_ORACLE_ADDRESS, Chainlink-style getPrice(symbol)) and an off-chain oracle service (ORACLE_API_URL + ORACLE_API_KEY). Health is derived from the feed timestamp: ≤5 min healthy, ≤1 h delayed, otherwise unavailable. Stale data is shown as stale.
Reference quotes and candles come from key-free, server-side adapters in src/lib/data/providers/marketDataProvider.ts. A licensed real-time provider can be plugged into keyedQuote() and enabled with MARKET_DATA_API_KEY / MARKET_DATA_PROVIDER. Timeframes 1m–1d; 4h is aggregated from hourly candles. Realtime updates use Server-Sent Events (/api/stream) with polling fallback.
Set INDEXER_URL (and INDEXER_API_KEY) to a service exposing /stats, /funding/:market, /probability/:market and /activity/:address. Without it, stats read “Data unavailable”, history charts are empty, and wallet activity is reconstructed from RPC event logs over the last 200k blocks.
When the PerpManager exposes marketConfig() its values are used. Otherwise the UI displays the fallbacks in src/config/risk.ts and labels them as such: max leverage 10×, maintenance margin 5%. Position health: ≥2× maintenance is Healthy, ≥1.25× is Warning, below is Liquidation Risk.
LarkPerps does not sell private-company equity. Private markets are referenced: markets settle on public valuation reports, events or public data. Every such page shows: “This market provides market exposure or event-based settlement and does not by itself represent ownership of the referenced company.”
eth_call (estimate)See Stats for live configuration and connectivity.