Skip to main content
This page summarizes the main on-chain types. Source definitions live in common/src/types.

HubAssetKey

HubAssetKey {
  hub_id: u32,
  asset: Address,
}
HubAssetKey is the market coordinate used by controller flows, pool storage, keeper config, views, events, and strategy inputs.

Account

Account {
  owner: Address,
  spoke_id: u32,
  mode: PositionMode,
  supply_positions: Map<HubAssetKey, AccountPositionRaw>,
  borrow_positions: Map<HubAssetKey, DebtPositionRaw>,
}
Accounts bind to a spoke id >= 1.

PositionMode

VariantMeaning
NormalStandard supply and borrow.
MultiplyLeveraged collateral/debt loop.
LongDirectional long strategy.
ShortDirectional short strategy.

AccountPositionRaw

FieldMeaning
scaled_amount_rayRAY-scaled supply shares.
liquidation_threshold_bpsSnapshot threshold used by health factor.
liquidation_bonus_bpsSnapshot liquidation bonus.
loan_to_value_bpsSnapshot LTV.

DebtPositionRaw

FieldMeaning
scaled_amount_rayRAY-scaled debt shares.

SpokeAssetConfig

FieldMeaning
is_collateralizableWhether supply counts as collateral.
is_borrowableWhether accounts can borrow it.
pausedBlocks risk-increasing use.
frozenBlocks new supply/borrow while allowing exits.
loan_to_valueLTV in BPS.
liquidation_thresholdHealth-factor collateral weight in BPS.
liquidation_bonusLiquidator bonus in BPS.
liquidation_feesProtocol fee in BPS.
supply_capSpoke supply cap in token units.
borrow_capSpoke borrow cap in token units.
oracle_overrideOptional per-spoke oracle config.

MarketParamsRaw

FieldMeaning
base_borrow_rate_rayBorrow rate at zero utilization.
slope1_raySlope below first kink.
slope2_raySlope between first and optimal utilization.
slope3_raySlope above optimal utilization.
max_borrow_rate_rayBorrow-rate cap.
mid_utilization_rayFirst utilization kink.
optimal_utilization_rayTarget utilization.
max_utilization_rayHard utilization cap.
reserve_factor_bpsProtocol share of borrower interest.
supply_capHub supply cap.
borrow_capHub borrow cap.
is_flashloanableFlash-loan eligibility.
flashloan_feeFlash-loan fee in BPS.
asset_idToken address.
asset_decimalsToken decimals.

Oracle Types

Oracle config is token-rooted under AssetOracle(asset) and can be overridden per spoke asset. It supports Reflector and RedStone sources, primary/anchor composition, tolerance bands, staleness bounds, resolution, decimals, and sanity bounds.