Protocol-wide live state, from one block.

"One consistent price snapshot" used to be a claim rather than a fact: the price was read in its own round trip and the dependent calls ran at whatever block came next (MK-013). Both reads are now pinned to blockNumber.

interface SystemState {
    blockNumber: bigint;
    isRecoveryMode: boolean;
    price: bigint;
    tcr: bigint;
}

Properties

blockNumber: bigint

The block price, tcr and isRecoveryMode were all read at.

isRecoveryMode: boolean

checkRecoveryMode(price), system TCR < CCR.

price: bigint

fetchPrice(), BTC/USD, 1e18-scaled.

tcr: bigint

getTCR(price), total collateral ratio, 1e18 fixed point.