Repository navigation
feat: paper trading mode against live Hyperliquid data (#61) - #62
Merged
Merged
Conversation
Paper mode runs the full command surface against real mainnet Hyperliquid public market data (info + WS l2Book/trades/bbo, meta, funding) and never signs or submits: no Privy session, approveAgent or deposit. Enable it with the global --paper flag, config set mode paper (going back to live requires --yes) or run --paper. - deterministic simulator: market/IOC book walking with slippage, resting limits filled on trade-through, reduce-only, TP/SL triggers, HL taker/maker fees plus the 1 bp builder fee, hourly funding accrual, cross/isolated leverage with an approximate margin and liquidation model - locked, restartable paper state under ~/.bloxwap/paper (state, trades, events, audit, runner pid/socket/logs) fully separated from live state - paper runner engine streams live books/trades to fill resting orders, accrues funding and liquidates on a timer, without a signer - every envelope and event labels mode/paper; order/cancel/modify/leverage keep the same validation, normalized errors, risk limits, builder fee and audit trail; init/fund/rotate/revoke refuse paper mode - paper reset/summary commands; status/balance/positions/orders/events/logs read paper state - fixture-book unit tests for the simulator, store, exchange adapter, engine, mode routing and dispatch flows; env-gated mainnet smoke test
SKILL.md recommends paper first, then fund and go live, with paper envelope examples; READMEs, a new docs/paper page (repo markdown and MDX), config reference updates for mode/paper.startingBalance/BLOXWAP_MODE, regenerated command reference and embedded skill content, and a PROGRESS entry.
metaAndAssetCtxs 'funding' is already the hourly funding rate (paid every hour), so the simulator charges notional * rate * hours instead of rate/8. Update simulator math and comments, funding test expectations, and the paper trading docs that described the eight-hour division.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #61
Built with the Kimi CLI (kimi-code v2.2.0).
Paper mode (
--paper,config set mode paper,run --paper) runs the full command surface against real mainnet Hyperliquid market data. A local simulator handles fills: book walking, resting limits, reduce-only, TP/SL, taker/maker and builder fees, hourly funding, and approximate margin/liquidation. It never signs or submits anything, and needs no Privy, approveAgent or deposit. State lives under~/.bloxwap/paper/;paper reset/paper summarymanage it. Every envelope and event carriesmode/paperlabels, and going live requiresconfig set mode live --yes. SKILL.md, README and the docs site (new paper page) are updated. Locally: build, lint, typecheck, 286 tests, docs build/check all pass.