Cascade
Architecture

Onchain System

Core contracts, libraries, and parameter surfaces that govern Cascade settlement

Cascade’s on-chain kernel is lean by design: every collateral movement runs through Perpetual, and every rule is enforced directly in these contracts to keep settlement deterministic.

Core Contracts

  • Perpetual – canonical settlement surface that tracks balances, positions, and per-market parameter vectors Θ_i. Every fill, funding update, or margin movement enters here so custody remains single-sourced.
  • InvariantLib – deterministic rulebook invoked before any state transition. It authenticates signatures, enforces maker/taker flags, clamps clearing prices to oracle bounds, verifies post-trade margin, and ensures open interest plus lot sizing remain valid.
  • MarginLib / PositionLib / FillLib – shared math libraries that compute NAV, notional size, and fee accrual, update position basis, and derive the maker-priced match between two orders.

Together these pieces guarantee that matchers cannot push invalid states on-chain; a bundle only settles after every invariant passes.

Liquidity Vault Integration

The Liquidity Vault lives as an internal ledger inside Perpetual. Depositors credit collateral directly to managed sub-accounts without wrapper contracts, and vault delegates receive trading authority that is scoped by allowance. Residual protocol fees automatically flow back into the vault, compounding the collateral base that backs future markets.

Delegated Deposits & Controls

Account owners can whitelist deposit and trading delegates with rate limits. Deposits land in the target account immediately, and revoking a delegate only blocks new actions—it never seizes existing balances. This keeps capital composable for integrators building custom treasury routines on top of Cascade.

Governance & Parameters

Each market carries a parameter set Θ_i that packages margin ratios, fee splits, deviation limits, open-interest caps, and feature toggles (e.g., reduce-only pauses). A single owner (typically a DAO-controlled multisig) updates these parameters directly on Perpetual, with every setter clamping values to [p_min, p_max] ranges baked into the contract. All changes emit structured events so off-chain risk monitors can rebuild the same surfaces.

The governance token implements ERC20Votes with capped exponential inflation S_max(t) = S_genesis · e^{r_inflation · Δt}. Transfers are permissioned by default and can be progressively opened by governance.

Upgrade Surface

Core contracts are deployed as upgradeable units governed by the on-chain owner. Evolution happens by:

  1. adding new markets via additional Θ_i slots,
  2. rotating ownership to broader community control, or
  3. coordinating explicit migrations to new contract versions.

No helper contracts or privileged escape hatches can bypass solvency or price checks, keeping on-chain behavior deterministic even during upgrades.