Skip to content

feat: mock Hyperliquid orders in the testnet lifecycle (#39) - #59

Merged
joeblau merged 1 commit into
mainfrom
cursor/mock-testnet-hl-orders-6391
Oct 19, 2026
Merged

joeblau merged 1 commit into
mainfrom
cursor/mock-testnet-hl-orders-6391

Conversation

@joeblau

@joeblau joeblau commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Joe asked that the nightly Testnet lifecycle job never place real Hyperliquid orders, including testnet post-only ones.

What changed

The existing test preload now mocks Hyperliquid order placement, modification and cancellation the same way Relay is already mocked:

  • CLI children set BLOXWAP_E2E_MOCK_HL_ORDERS=1 and receive fixture resting/cancel responses, a local order book for frontendOpenOrders, and injected orderUpdates WebSocket frames.
  • The parent harness loads the same preload without that flag, so account-cleanliness info reads stay live, while any escaped /exchange order (or fund-moving action) fails closed instead of reaching the exchange.
  • Mainnet Hyperliquid/Relay HTTP remains blocked. Unsigned order payloads and unexpected exchange actions throw.

Lifecycle reports now have an explicit orders coverage entry (Hyperliquid orders (mocked)). Approvals/account reads stay recorded as live Hyperliquid. Order stages are not claimed as live.

30 test USDC

Pre-funding is no longer required. Orders never hit the book, and the mocked Relay quote still has zero expected output, so settlement does not move funds. Preflight still requires a reachable testnet account with no positions, open orders, or leftover agent approvals.

Still live vs mocked

Live (no funds moved):

  • Privy wallet/app calls
  • Hyperliquid approveAgent / approveBuilderFee and revocation
  • Account info reads (clearinghouseState, extraAgents, live open-order preflight/cleanup checks, mids/meta)
  • Non-order WebSocket subscriptions (connection/readiness)

Mocked / blocked:

  • Hyperliquid order, cancel, batchModify/modify, and other order-like exchange actions
  • Order-book info used to reconcile those stages
  • Order-update WebSocket frames those stages depend on
  • Relay quote/status (unchanged)
  • Withdrawals, transfers, and any other fund-moving exchange action (blocked, not executed)

Missing-secret preflight failure is unchanged.

Do not merge until checks are green and a reviewer accepts the live-vs-mocked split.

Open in Web Open in Cursor 

Block order place/modify/cancel from reaching Hyperliquid in the nightly
harness, the same way Relay is mocked, while keeping approvals, account
reads and Privy live.

Co-authored-by: Joe Blau <[email protected]>
@joeblau
joeblau marked this pull request as ready for review October 19, 2026 00:17
@joeblau
joeblau merged commit e62d0a5 into main Oct 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants