Skip to main content
Supply assets to earn variable supply interest and, when the spoke allows, use them as collateral. Supplying lets you:
  • Create or fund a spoke-bound account
  • Accrue supply index growth (scaled balances)
  • Borrow against collateralizable listings
App path: Getting started. Integrators call the controller only.

Supplying

  1. Identify the market (HubAssetKey)
  2. Confirm the spoke allows collateral / supply
  3. Authorize token transfer to the pool
  4. Call supply

Identify the market

Use HubAssetKey { hub_id, asset }. Confirm pool listing and spoke SpokeAsset flags (collateral, not paused/frozen for increases, caps).

Call shape

Preconditions

  • caller authorizes the call and the token transfer.
  • The market exists and its hub is active.
  • The account’s spoke lists the asset and marks it collateralizable.
  • Supply caps and the position limit (at most 5 supply positions) have headroom.
  • Neither the protocol nor the listing is blocking entry.
  • Every amount is strictly positive. Zero is rejected — unlike withdraw, it is not a sentinel here.
Anyone can supply into someone else’s account, but only narrowly. A caller who is neither the owner nor a delegate may add only to assets the account already holds a supply position in. Anything else is #44 NotAuthorized. This stops a third party from filling up an account’s 5 supply-position slots.Creating an account (account_id = 0) skips the check, because the caller becomes the owner.
The amount credited is measured, not requested. A token that delivers less than it is sent credits only what arrived.

Common errors