─── scenario: position-buildup ──────────────────────────────────── HEADLINE ✓: Two market buys, 10@100 then 10@110, leave Alice long 20 contracts at avg_entry 105 — VWAP via the clearing layer. DESCRIPTION: A single trader builds a long position over two market buys at different prices, demonstrating the clearing layer's VWAP-style `avg_entry` computation. Alice first buys 10 contracts at 100 (avg_entry = 100), then buys another 10 at 110 (avg_entry weighted to 105). The maker takes the matching short side at the same VWAP. Useful for asking: how does the engine track entry price across multiple fills? What is the unrealized P&L baseline an account is compared against? Final mark settles back to 100 via a small mark-book so the scenario doesn't trigger liquidations — this is a `walkthrough`, not stress. TIMELINE (per-block): height mark src trades fills deposits liqs adl fund ------ ------ --------------- ------ ----- -------- ---- --- ---- 1 100 stub-empty-book 1 0 2 0 — — 2 100 stub-empty-book 1 1 0 0 — — 3 100 stub-empty-book 1 0 0 0 — — 4 100 stub-empty-book 1 1 0 0 — — 5 100 clob 2 0 0 0 — — ACCOUNT DELTA (final − initial): account collateral position avg_entry ------- ---------- -------- --------- 10 5000 20 105 100 5000 -20 105 (initial account count: 0, final account count: 2) OUTCOMES: ✓ Exactly 2 accounts touched by trades (Alice + maker) ✓ Exactly two fills (the two staged market buys) ✓ No surprise fills beyond the two buys ✓ Alice's collateral covers her position; zero liquidation scan-hits (this is a walkthrough, not stress) ✓ Alice ends with +20 long after both market buys ✓ Alice's avg_entry is the VWAP of the two fills: (10×100 + 10×110) / 20 = 105 ✓ Maker ends with the matching -20 short at the same VWAP ✓ Maker's avg_entry is symmetrically the same VWAP of 105 8 of 8 outcome(s) verified. NOTE: v1 runs the scenario in-process against a unit-provider `LiveRethEvmBridge<()>` (no Reth boot). For the production-shape run (real Reth + Malachite + JSON-RPC), use: openhl reth-devnet --chain-history scenarios/position-buildup.json --rounds 5 NEXT: • Adopt this engine : https://github.com/psyto/rdk • Custom build : https://fabrknt.com/waitlist.html?product=evm-perp&intent=build • Hosted access : https://fabrknt.com/waitlist.html?product=evm-perp&intent=hosted