HubAssetKey.
Read first: Accounts and risk,
Markets, and
Health factor.
Supply
account_id = 0 creates a new account owned by caller and bound to
spoke_id. Existing accounts keep their stored spoke; the supplied spoke_id
must match that account.
Preconditions
callerauthorizes the call and token transfers.- Each
HubAssetKeyis listed in the pool. - The account’s spoke lists the hub asset.
- The spoke asset is collateralizable and not blocked for increases.
- Supply caps and position limits leave enough headroom.
Example
Common Errors
| Error | Cause | Fix |
|---|---|---|
#104 NotCollateral | Spoke asset cannot be used as collateral. | Use a collateralizable asset or another spoke. |
#311 SpokeSupplyCapReached | Spoke supply cap exceeded. | Supply less or wait for cap headroom. |
#109 PositionLimitExceeded | Account already holds max supply positions. | Consolidate positions or wait for a limit change. |
#315 SpokeAssetPaused | Spoke asset is paused. | Wait for governance to unpause or use another asset. |
#316 SpokeAssetFrozen | Position increase is frozen. | Exit-only actions may still be available. |
Borrow
account_id. Tokens go to to when set, otherwise to
caller.
Preconditions
callerowns the account or is authorized for it.- Each borrowed hub asset is listed by the account’s spoke and borrowable.
- Borrow caps, liquidity, and utilization caps leave enough headroom.
- Post-borrow LTV and health factor pass.
- Strict oracle policy passes for every priced asset.
Example
Common Errors
| Error | Cause | Fix |
|---|---|---|
#107 AssetNotBorrowable | Spoke asset is not borrowable. | Borrow an allowed asset. |
#312 SpokeBorrowCapReached | Spoke borrow cap exceeded. | Borrow less or wait for cap headroom. |
#100 InsufficientCollateral | LTV gate fails. | Add collateral or borrow less. |
#102 HealthFactorTooLow | Post-borrow health factor is below one. | Reduce borrow or add collateral. |
#112 InsufficientLiquidity | Pool cash is below requested amount. | Borrow less or wait for liquidity. |
#126 MinBorrowCollateralNotMet | Debt remains but collateral is below the configured floor. | Add collateral or reduce debt. |
#127 UtilizationAboveMax | Post-borrow utilization is too high. | Borrow less or wait for more supply. |
Verification
Successful supply or borrow emits controller position and market-state events. Read back state through controller views such asget_account_positions,
collateral_amount_for_hub_asset, borrow_amount_for_hub_asset, and
health_factor.
Next
Withdraw and repay
Exit collateral and repay debt.
Flash loans
Borrow and repay inside one callback.

