Skip to content

Preview: contracts not deployed on Elysium yet. Wallet connect works; no balances or transactions.

Cerebra
Documentation

Price oracle

Deposits are valued with a guarded on-chain price. Bounds, rate limits and a staleness check make a bad price hard to post and impossible to use for long.

Why an admin-set oracle

A new token has shallow liquidity, and a DEX time-weighted average price on shallow liquidity can be moved cheaply. Cerebra therefore starts with a price posted by a keeper and constrained on-chain. Because the USD value of a deposit is fixed at deposit time, a wrong price can mis-credit a deposit but cannot touch existing balances.

Safeguards

GuardDefaultEffect
Absolute boundsSet at deployThe price must stay between a minimum and a maximum.
Per-update deviation20%A keeper cannot move the price more than this in one update.
Update interval10 minutesAt most one keeper update per interval.
Force priceAdmin onlyThe admin (a Safe) can set a price outside the limits in an emergency. It emits an event.
Decimals8Prices use eight decimals. Billing converts to six-decimal USD.

Staleness

Billing stores how old the price is and refuses deposits when it exceeds maxPriceAge (6 hours by default). If the keeper stops, deposits stop. Existing balances, spending and staking are unaffected.

Reading the price

Billing.currentPrice() returns the price and the time it was last updated. The Deposit page shows both.

Upgrading the price source

Billing reads the price through a text-sm interface, so the admin can later point it at a decentralized source once liquidity supports it. Changing the source is admin-only and emits an event.