Layer 3: In-Memory Execution Engine (The Brain)

This is the heart and brain of BullChain, where all matching logic, risk management, and PnL calculations take place. To thoroughly resolve the Disk I/O bottleneck that makes older generation DEXs sluggish, BullChain applies a breakthrough Dual-State Architecture:

  • Volatile State (RAM Execution): All critical data structures, including the Orderbook and Position State, are loaded and operated entirely on the RAM of Validator Nodes. We utilize high-performance data structures such as Red-Black Trees or Skiplists to manage the Orderbook. Matching, balance updates, and liquidation calculations occur in micro-seconds (<10ms), delivering an Instant Execution experience.

  • Persistent State (Disk Storage): The hard drive (SSD) recedes to play the role of secure "Backup" storage. Data from RAM is only synchronized and written to disk (in the form of an IAVL Tree structure) at the EndBlock. This mechanism ensures data Persistence without slowing down transaction processing speeds. An intelligent Hydration process allows Nodes to reconstruct the entire state on RAM from the hard drive in just seconds if a restart is required.

Last updated