Skip to content

Run controlled experiments on three financial mechanisms. Change one assumption, observe the new position, and reconcile the movement of assets, claims, returns, and risk.

Every lab uses deterministic decimal arithmetic and publishes its model boundary. The defaults, explanations, and result tables remain useful static HTML before any interactive controls load.

Experimental method

Change one assumption. Reconcile every consequence.

  1. Set a baseline

    Read the units, accounting model, and excluded behavior first.

  2. Change one input

    Keep the causal path visible instead of changing every control.

  3. Reconcile the state

    Trace who holds each asset or claim and who gains or loses value.

Three deterministic models

Choose the financial question to test.

Each lab starts with a complete example, then exposes the inputs that govern its state transition.

  1. Constant-product AMM

    How does one swap reshape pool inventory, execution price, and the invariant?

    Core modelx × y = k

    Read first: Automated market maker

    Change

    • Token reserves
    • Trade direction and size
    • Fee rate and external price

    Inspect

    • Quote and average execution price
    • Price impact and arbitrage direction
    • Reserve, fee, and invariant transition

    Trace

    • Capital flow
    • Return flow
    • Risk flow

    Model boundaryConstant-product reserves only; concentrated liquidity, integer rounding, hooks, and named protocol behavior are outside the model.

  2. Lending and liquidation

    When does a collateralized loan move from borrowing capacity to liquidation?

    Core modelHF = collateral value × threshold ÷ debt

    Read first: Lending pool

    Change

    • Collateral amount and price
    • Debt, rates, and elapsed time
    • LTV, threshold, and liquidation bonus

    Inspect

    • LTV, health factor, and capacity
    • Interest and liquidation price
    • Collateral seizure and remaining debt

    Trace

    • Capital flow
    • Claim flow
    • Risk flow

    Model boundarySimple interest and one-position liquidation only; oracle delay, auctions, close factors, gas, and named protocol rules are excluded.

  3. Vault share accounting

    How do deposits, returns, fees, and withdrawals change each share claim?

    Core modelshare price = NAV ÷ eligible shares

    Read first: Vault

    Change

    • Existing assets and shares
    • Deposit, profit, or loss
    • Fees and withdrawal shares

    Inspect

    • NAV, share price, and shares minted
    • Ownership and withdrawal value
    • Fee dilution and before/after value

    Trace

    • Capital flow
    • Claim flow
    • Return flow

    Model boundaryOne accounting transition with explicit fee assumptions; strategy execution, liquidity constraints, and named vault implementations are excluded.