Skip to main content
A u64 account holds supply and borrow positions keyed by HubAssetKey. Every account is bound to a spoke id >= 1; the spoke defines which assets the account can use and with which risk parameters. Read first: Markets.

Storage

Account state is split across three controller records:
RecordHolds
AccountMeta(account_id)Owner, active spoke id, and position mode.
SupplyPositions(account_id)Map<HubAssetKey, AccountPositionRaw>.
BorrowPositions(account_id)Map<HubAssetKey, DebtPositionRaw>.
Account {
  owner: Address,
  spoke_id: u32,
  mode: PositionMode,
  supply_positions: Map<HubAssetKey, AccountPositionRaw>,
  borrow_positions: Map<HubAssetKey, DebtPositionRaw>,
}
Existing-account operations require the owner or an authorized delegate, except for intentionally open flows such as repay and liquidation.

Positions

Supply and debt positions store scaled RAY balances. The live token amount is reconstructed from the current pool index:
supply_actual = scaled_supply * supply_index / RAY
borrow_actual = scaled_debt * borrow_index / RAY
Supply positions also store the collateral risk parameters used by LTV, health-factor, and liquidation math.

Spoke Risk

The account’s spoke provides SpokeAsset(spoke_id, HubAssetKey) configuration:
  • collateral and borrow flags;
  • paused and frozen flags;
  • LTV;
  • liquidation threshold;
  • liquidation bonus and protocol fee;
  • spoke-level supply and borrow caps;
  • optional oracle override.
There is no account category boost mode in the current protocol.

Position Limits

An account can hold a bounded number of supply and borrow positions. Governance updates those limits through timelock. Exceeding either side reverts #109 PositionLimitExceeded.

Risk Gates

GateWhenRule
LTVBorrow and indebted withdrawalWeighted collateral must cover total debt.
Health factorBorrow, indebted withdrawal, liquidationHF = weighted_collateral / total_debt; HF < 1e18 is liquidatable.
Minimum borrow collateralAny account with debtLTV-weighted collateral must stay above the configured USD floor.
Borrow and indebted withdrawal use strict oracle policy. Repay and debt-free withdrawal are de-risking flows.

Position Modes

PositionMode gates strategy entrypoints:
ModeMeaning
NormalStandard supply and borrow.
MultiplyLeveraged collateral/debt loop.
LongDirectional long strategy.
ShortDirectional short strategy.

Next

Risk parameters

Units, ranges, and configured values for market and spoke risk parameters.

Health factor

Health-factor formula and WAD examples.

Liquidations

Liquidation rules after health factor drops below one.

Strategies

Strategy modes and route-driven account flows.