Prepare the account and assets
Passaccount_id = 0 to create an account in Normal mode. The call returns its
id and mints the position NFT to caller. For an existing account, pass its id
and stored spoke_id; the spoke cannot change.
Each entry is (HubAssetKey, amount), where HubAssetKey is { hub_id, asset }
and amount is a strictly positive integer in token base units. Duplicate
market entries are summed in first-appearance order.
Before submitting, check that:
- The market exists on an active hub and is listed on the account’s spoke.
- The listing is collateralizable, unfrozen, and unpaused, and the protocol is unpaused.
- Supply caps and position limits leave enough headroom.
- A collateral asset below 3 decimals is the account’s only supply market.
- The caller holds and authorizes the tokens being supplied.
Build and authorize the call
CONTROLLER, IDENTITY,
and CALLER_ADDRESS as in the quickstart.
Replace the spoke, hub, and token inputs for the selected network.
The caller authorizes the controller call and one token transfer per aggregated
market from caller to the pool. Wallet integrations prepare the transaction
before signing. Contract integrations pre-authorize the nested transfer with
authorize_as_current_contract.
The pool credits the amount actually received. Supply shares round down; a
payment too small to mint a share reverts.
Verify the supply
Persist the returned account id. Readget_account_positions(account_id) and
get_collateral_amount(account_id, hub_asset) to confirm the supplied balance.
The balance view includes accrued interest and returns token base units with
half-up rounding. It is a display balance, not a full-withdrawal payout.
Use the v1 position arrays for
portfolio rendering; direct views are useful for transaction reconciliation.
The controller emits UpdatePositionBatchEvent at
["position", "batch_update"], with Supply legs. The pool emits
PoolMarketStateBatchEvent at ["market", "batch_state_update"].
Common errors
Continue with Borrow, or use
Withdraw to remove supplied collateral.

