Skip to Content
VPerpDocs

Execution Engine & Block Ordering

Zero-gas deterministic Rust execution, 5-class intra-block priority ordering, 10-step block financial lifecycle, parallel execution determinism, and congestion controls.

Trading Gas
0 Gas
Protected by Plan B quotas
Block Priority
5 Classes (0–4)
Cancel-First & ALO priority
Block Capacity
32,768 Ops
8 MiB (v120) · 32 MiB (v121+)
Congestion Guard
>= 90% Ops
Cancels NEVER throttled
Key Takeaways
  • Trading pays zero gas—all math executes in pure fixed-point Rust integers (zero floating-point drift) with bit-identical parallel and serial state roots.
  • Inside every block, VCore sorts transactions into 5 deterministic classes so Cancellations & Modifies (Class 1) and Pure ALO Quotes (Class 3) always execute ahead of Takers (Class 4).
  • Hourly funding ticks execute BEFORE Transaction #1 of the top-of-hour block; VIP volume flushes at the END of each block so volume upgrades take effect on Block H+1.
  • During severe volatility (>= 90% block capacity), only new opening orders throttle—cancellations are never throttled and reduce-only closes remain protected.

Once VCore consensus finalizes a block's transaction list, every validator and follower runs the VCore Execution Kernel (vcore-exec)—a deterministic, integer-arithmetic Rust state machine.


1. Deterministic 5-Class Intra-Block Priority Ordering

Before executing user transactions inside a committed block, VCore sorts them into 5 deterministic priority classes (preserving consensus order within each class and same-signer causal order via an O(N log N) causal DAG scheduler):

Intra-Block Execution Priority (Executed Left → Right)Same-signer causality preserved (O(N log N))
Class 0
System & Oracle
  • · ValidatorPrice
  • · Gov & Bridge
  • · Oracle / Halt

Fresh oracle index & halts visible first

Class 1
Cancel-First
  • · cancel / All
  • · cancelByCloid
  • · modify / batch

Cancels beat takers in the same block

Class 2
Margin & Account
  • · updateLeverage
  • · xfer / withdraw
  • · agents / PQ

Uses margin freed by Class 1 cancels

Class 3
Pure ALO Maker
  • · Pure Alo
  • · massQuote (Alo)

Maker quotes rest ahead of takers

Class 4
Taker & Mixed
  • · Gtc / Ioc / Mkt
  • · Triggers / TWAP
  • · Mixed batches

Matches post-cancel, post-ALO book

ClassCategoryIncluded ActionsPractical Impact for Traders & MMs
Class 0System & OracleValidator oracle price updates (ValidatorPrice*), governance & bridge actions, operator SetOracle / SetHaltFresh oracle prices and market halts are visible before any user order executes
Class 1Cancels & Modifies (Cancel-First)cancel, cancelByCloid, cancelAll, twapCancel, modify, batchModifyCancels and quote updates win same-block races against takers, curbing stale-quote sniping
Class 2Margin, Account & ConfigupdateLeverage, updateIsolatedMargin, usdClassTransfer, withdraw3, usdSend, spotSend, sendAsset, subAccount*, approveAgent*, scheduleCancel, setStpMode, reserveRequestWeight, bindPqLock, rotatePqKeyRuns after Class 1 so margin freed by a same-block cancel is immediately usable for leverage updates or transfers
Class 3Pure Post-Only Maker (Alo)Pure Alo orders and massQuote with tif: "Alo"Maker liquidity rests on the book before same-block taker orders match against it
Class 4Standard & Taker OrdersLimit (Gtc), Market / Ioc, mixed batches, conditional triggers, twapOrder, massQuote (Gtc / Ioc)Executes against the updated post-cancel, post-ALO order book

Best Practice for Market Makers

Keep Alo passive quotes in dedicated transactions rather than mixing Gtc or Ioc orders into the same batch—any mixed batch drops from Class 3 into Class 4.


2. 10-Step Block Financial Lifecycle

Every committed block executes financial transitions in one strict, invariant order:

10-Step Deterministic Block Financial Pipeline
Phase A · Pre-Transaction
01
DMS & Funding Tick
Top of UTC hour: O(1) tick before Tx #1
02
Interest & Unified Sync
Accrue borrow/lend & collateral
03
Due TWAP Slices
30s cadence IOC slices (±3% mark)
Phase B · Core Matching
04
User Tx Loop (0→4)
Prepare → Match → Atomic Settle (parallel)
05
Mark Price & Queues
Aligned mark update · MMV & bridge queues
06
VIP Volume Flush
Writes 30d vol → VIP upgrades active Block H+1
Phase C · Post-Trade Risk
07
Trigger Firing
Mark TP/SL & normalTpsl / positionTpsl (≤256/blk)
08
5s Premium Sample
720 samples/hr for next funding rate
09–10
Liquidation & ADL
CLOB → Backstop (2/3 MM) → ADL → Final

Two Critical Timing Boundaries to Remember

  1. Funding Ticks Run First (Step 01): On the first block at or after the top of each UTC hour, VCore records the new hourly funding tick in O(1) time before Transaction #1 executes—so the very first trade of the hour already accounts for that hour's funding.
  2. VIP Volume Flushes After Matching (Step 06): Block trading volume accumulates in memory and flushes to state at end-of-block. Crossing a 30-day VIP cutoff during Block H activates your new lower fee rate starting on Block H+1 (never retroactively inside Block H).

3. Parallel Execution Determinism (cross_parallel)

To sustain exchange-grade throughput on multi-core validators without ever risking a consensus divergence:

  1. Phase 1 — Conservative Pre-Scan: Scans pure-trading bands (>= 16 transactions or >= 4 outer batches with >= 16 ops) using a 7-inequality safety envelope to partition disjoint markets and independent account sets.
  2. Phase 2 — Zero-Clone Rayon Lanes: Executes independent market lanes concurrently on copy-on-write state views. Because v120 open-order caps, 200 RO caps, and Plan B address limits are evaluated per-account in O(1), lanes never contend on cross-account locks.
  3. Phase 3 — Deterministic Rebase: Deterministically rebases oid, tid, and event sequences into canonical order, producing a 100% bit-identical state_hash to single-threaded serial execution.

4. Block Capacity & Congestion Throttling

GuardrailLimit / Rule
Block CapacityUp to 32,768 transactions / 32,768 order ops per block; 8 MiB (<= v120) expanding to 32 MiB (v121+ PQC blocks)
Cancel Byte CeilingCancellations are capped at <= 35% of block bytes so matching always progresses cleanly
Congestion TriggerActivates for the next block whenever the prior block consumed >= 90% op capacity (>= 29,491 / 32,768 ops)
Throttled Opening CapOpening ops per account cap at max⁡ ⁣(16, ⌈2×prev_utc_day_maker_share×32,768⌉)\max\!\big(16,\ \lceil 2 \times \text{prev\_utc\_day\_maker\_share} \times 32{,}768 \rceil\big)
Exempt Risk-Reducing OpsCancellations are NEVER throttled; reduce-only closes remain exempt up to 16 × open_positions (Protocol MMV family exempt)
Congestion Block Throttling
Worked Example

Suppose Block H hits 30,000 / 32,768 ops (91.6% >= 90%), triggering congestion throttling on Block H+1:

  • Retail Trader (0% prior-day maker share): Capped at the floor of 16 opening ops in Block H+1, while all cancels and up to 16 × open_positions reduce-only closes remain unrestricted.
  • Active Market Maker (2.5% prior-day maker share): Allowed up to ⌈2×0.025×32,768⌉=1,639\lceil 2 \times 0.025 \times 32{,}768 \rceil = \mathbf{1{,}639} opening ops in Block H+1, keeping deep liquidity online during volatility spikes.

Frequently Asked Questions

On this page