Check borrowing headroom
Each borrow entry is(HubAssetKey, amount) in token base units. Amounts must
be positive; duplicate market entries are summed.
Before submitting, check that:
- Each market exists on an active hub and is listed as borrowable on the account’s spoke.
- The protocol and each listing are unpaused; listings are unfrozen.
- Borrow caps, position limits, pool cash, and utilization limits permit the request.
- The resulting account passes LTV coverage, health factor, and the minimum-borrow-collateral floor.
- If debt remains, each collateral position below 3 decimals holds at least two token base units.
- Every asset needed for account valuation has a valid price.
Build and authorize the call
to when supplied, otherwise to caller. The recipient cannot be
the controller or pool. Changing to does not change whose authority is checked.
Verify the borrow
Readget_borrow_amount(account_id, hub_asset) in token base units and
get_health_factor(account_id) in WAD (1e18). Confirm the recipient’s token
balance as well as the account’s resulting debt.
The controller emits UpdatePositionBatchEvent at
["position", "batch_update"], with Borrow legs. The pool emits
PoolMarketStateBatchEvent at ["market", "batch_state_update"].
Common errors
Use Repay to reduce debt, or
Strategies to change debt and collateral in
one transaction.

