#[repr(C)]pub struct PoolBooks {
pub pool_ct: u8,
pub _pad: [u8; 7],
pub metas: [PoolMeta; 32],
pub books: [L2Book; 32],
}Expand description
Per-pool depth books delivered to multi-venue algos.
Written to WASM memory at POOL_BOOKS_WASM_OFFSET (0x14000) on a
separate cadence from NBBO — typically per-block, not per-tick.
Algos read this on demand during on_nbbo() via fixed WASM offset.
~23 KB total. Conditional memcpy: skipped when pool_ct == 0.
Fields§
§pool_ct: u8Number of valid pool slots (0..MAX_POOLS).
_pad: [u8; 7]§metas: [PoolMeta; 32]Metadata for each pool slot.
books: [L2Book; 32]L2 books for each pool. books[i] corresponds to metas[i].
Implementations§
Source§impl PoolBooks
impl PoolBooks
Sourcepub fn book_for_pool(&self, addr: &[u8; 32], pair_index: u16) -> Option<&L2Book>
pub fn book_for_pool(&self, addr: &[u8; 32], pair_index: u16) -> Option<&L2Book>
Look up the L2Book for a specific pool by address and pair_index.
Sourcepub fn book_at_slot(&self, slot: usize) -> &L2Book
pub fn book_at_slot(&self, slot: usize) -> &L2Book
Direct access to the L2Book at a given slot index.
Sourcepub fn meta_at_slot(&self, slot: usize) -> &PoolMeta
pub fn meta_at_slot(&self, slot: usize) -> &PoolMeta
Direct access to the PoolMeta at a given slot index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PoolBooks
impl RefUnwindSafe for PoolBooks
impl Send for PoolBooks
impl Sync for PoolBooks
impl Unpin for PoolBooks
impl UnsafeUnpin for PoolBooks
impl UnwindSafe for PoolBooks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more