Olive Docs
Smart Contract

Smart Contract

Smart Contract

This section documents the current smart contract instruction logic file by file.

The goal is to make each instruction easy to review in order. Each page lists the relevant Rust file, then writes the current execution flow as numbered steps.

Liquidity Rule Used In This Section

token_owned is the total custody accounting balance.

token_locked is the portion reserved as backing for open positions.

free liquidity is:

token_owned - token_locked

The audit rule is:

If a payout uses the same asset that was locked, it can use locked backing, but the payout must be bounded by the released locked amount.

If a payout uses the other asset, it must use free liquidity.

If a new position creates a new lock, it must use free liquidity at the moment the lock is created.

Pages

On this page