Skip to main content

Crate percli_core

Crate percli_core 

Source
Expand description

percli-core: Offline simulation adapter for the Percolator risk engine.

Wraps the Percolator engine with human-readable account names, serde-compatible snapshots, and ergonomic defaults.

Modules§

agent
scenario

Structs§

Account
Unified account (spec §2.1)
AccountSnapshot
Serializable snapshot of a single account’s state.
CrankOutcome
Outcome of a keeper crank operation
EngineSnapshot
Complete serializable snapshot of the engine state.
I128
InsuranceFund
Insurance fund state
NamedEngine
Human-readable wrapper around the Percolator RiskEngine.
ParamsConfig
Serde-friendly risk parameter configuration with sensible defaults.
RiskEngine
Main risk engine state (spec §2.2)
RiskParams
Risk engine parameters
U128
BPF-safe unsigned 128-bit integer using [u64; 2] for consistent alignment. Layout: [lo, hi] in little-endian order.

Enums§

EngineError
Errors from the NamedEngine wrapper layer.
LiquidationPolicy
Liquidation policy (spec §10.6)
RiskError
SideMode
Side mode for OI sides (spec §2.4)

Constants§

ADL_ONE
ADL_ONE = 1_000_000 (spec §1.3)
MAX_ACCOUNTS
MAX_ORACLE_PRICE
MAX_ORACLE_PRICE = 1_000_000_000_000 (spec §1.4)
MAX_VAULT_TVL
POS_SCALE
POS_SCALE = 1_000_000 (spec §1.2)