Skip to main content
Avana logo

Borrow Assets

Borrow an approved debt asset on the Aave V4 account that holds one market's collateral. Any asset the CDP Spoke lists can be borrowed, such as GHO and USDC today.

Overview

Each wallet has one PositionProxy per market, so each market is its own Aave account with its own health factor and nothing is cross-collateralized. A borrow goes wallet → AaveAdapter → the wallet's proxy for that market → CDP Spoke. The proxy holds no logic and executes only the Adapter's calls; every check lives in the AaveAdapter and the RiskModule.

The borrowed asset is drawn from the reserve's funding Hub into the proxy, and the proxy forwards exactly that amount to the receiver in the same call. A borrow changes no vault token, record or cap counter. There is no combined pledge-and-borrow call, no batched borrow and no multicall: pledge and borrow are separate calls, and each borrow names one debt reserve and carries its own nonce.

Avana enforces no opening health floor above Aave's 1.00. The app recommends borrowing to a health factor of 1.10 and shows the protocol maximum at 1.00 beside it. Interest raises the debt over time, so the health factor can fall even when collateral value does not change.

Debt Assets

Any asset the CDP Spoke lists as a debt reserve can be borrowed. Governance enables a debt reserve per CDP Spoke with enableDebtReserve through the chain's Timelock. The call records the funding Hub and asset, and checks the credit line and the swap routes from every pool token of the Spoke's markets into the asset.

AssetDecimalsAave price sourceStatus
GHO18Aave's fixed $1 sourceEnabled per CDP Spoke with enableDebtReserve
USDC6Its DebtOracle on Chainlink USDC/USDEnabled per CDP Spoke with enableDebtReserve
USDT6Its DebtOracle on Chainlink USDT/USDEnabled per CDP Spoke with enableDebtReserve
WETH18Its DebtOracle on Chainlink ETH/USDEnabled per CDP Spoke with enableDebtReserve
  • Each non-GHO debt reserve is priced by its own DebtOracle, which reads a primary, an alternate and a standby Chainlink route with the same freshness, failover and agreement rules as the collateral legs. When Expired, it serves the accepted price raised by debtStressRiseBps, so debt is never undervalued.
  • The draw is bounded by the Aave drawCap of the reserve's (funding Hub, asset, CDP Spoke), which is the credit line. At launch every debt reserve is funded by the Spoke's home Hub, the Avana Hub of its chain.
  • One account can owe several debt reserves. The market's collateral, and only it, backs every debt reserve of that proxy.

The Borrow Call

borrow(uint256 marketId, uint256 debtReserveId, uint256 amount, address receiver, uint256 deadline, uint256 minHealthFactor, uint256 expectedNonce) returns (uint256 drawn)
ParameterTypeMeaning
marketIduint256The market. With the caller it names the account; the wallet never names its proxy.
debtReserveIduint256The debt reserve to borrow. It must be approved for the market's CDP Spoke.
amountuint256Amount in the asset's base units (18 decimals for GHO and WETH, 6 for USDC and USDT). Any positive amount: Avana has no minimum debt.
receiveraddressRecipient of the borrowed asset. The app defaults it to the wallet. Protocol contracts and frozen addresses are refused.
deadlineuint256Last valid block timestamp, in seconds on both chains.
minHealthFactoruint256The caller's own minimum health factor after the borrow, in WAD (1e18 = 1.00). 0 means no extra bound.
expectedNonceuint256Must equal the proxy's borrowNonce, read on-chain when the call is prepared. It is consumed by a successful borrow, so a signed borrow cannot be replayed.

The call returns the amount drawn, which always equals the requested amount. The app keeps one pending borrow per proxy, because one nonce sequence per proxy covers every debt asset.

Borrow Checks

In execution order. The checks cover the account's market and every debt reserve the account owes, plus the one being borrowed. Before checking prices, the RiskModule pokes the market's LPOracle and each non-GHO DebtOracle so that a disagreement or failure first seen by this borrow starts its window on time.

CheckRuleError
Deadline and amountThe deadline has not passed and the amount is above 0.DeadlineExpired / ZeroAmount
Home Hub pause stateThe market's home Hub, and the debt reserve's funding Hub, are in state None. Borrowing is new risk and runs only in None.ApplicationFrozen / ApplicationPaused
Sequencer gate (Base)The Base sequencer is up and restarted more than 3,600 seconds ago. Ethereum's gate is always Up.SequencerDown / SequencerGrace
Address freezeNeither the wallet nor the receiver is a frozen address; the wallet is checked first.AddressIsFrozen
Account, reserve and receiverThe wallet has a proxy for the market, the debt reserve is approved for the CDP Spoke, and the receiver is not a protocol contract, Hub, Spoke, listed token or proxy.NoProxy / UnknownDebtReserve / InvalidReceiver
Credit lineAt launch every debt reserve is funded by the Spoke's home Hub, and the line is the Aave drawCap of (Hub, asset, Spoke). Cross-Hub credit lines are off at launch.FundingHubPaused / CreditLineClosed / CreditLineExceeded
NonceThe expected nonce equals the proxy's borrowNonce, which then increases by 1. A later revert restores it.BadNonce
Market priceThe market's price state is Live. Each collateral feed's age is at most borrowPriceMaxAge: its own heartbeat plus 1,800 seconds.PriceNotLive / PriceTooOld
Second-source agreementEach price's independent second source (a deep-pool TWAP or a second oracle network) agrees with the served price within its toleranceBps. A disagreement blocks the borrow but leaves the state Live and does not affect liquidation.SecondSourceDisagrees
Debt pricesEvery debt reserve the account owes, plus the one borrowed, is on its recorded price source and unpaused. Each non-GHO reserve's DebtOracle is Live and no older than its feed's borrowPriceMaxAge.DebtPriceTooOld / UnexpectedDebtPriceSource / DebtReservePaused
Aave reserve and market statusThe vault-token reserve is not paused or frozen on Aave and the market is not Offboarding.AaveReservePaused / ReserveFrozen / MarketOffboarding
Configuration driftThe Spoke is the approved standard Aave V4 Spoke, active and not halted; the standard-Spoke settings that keep liquidation with LPVaultSwap are unchanged; the collateral factor, liquidation bonus and target health factor match what Avana expects; Hub shares equal assets.ConfigDrift / HubSharesNotEqualAssets
Liquidation can runAt least one unfrozen committed operator is registered on the chain's LPVaultSwap (keeperFloor is 1), and every debt reserve in scope has a usable swap route from each pool token. The registry gates no liquidation: any address can liquidate.LiquidationHalted / DebtLiquidationHalted
Circuit breakersThe market breaker is not tripped (pool share above the pool's listed cap, pool depth, token issuer, configuration drift, or a manual guardian trip), and the borrowed reserve's debt breaker is not tripped (including an outstanding GHO deficit above 10,000 GHO on the Spoke).BreakerTripped / DebtBreakerTripped
Aave borrowAave checks the reserve, the drawCap including any reported deficit, Hub liquidity, and that Aave's health factor stays at least 1.00.DrawCapExceeded / InsufficientLiquidity / HealthFactorBelowThreshold
Health after the borrowThe rescue-excluded health factor is at least the largest of 1.00, minHealthFactor and the market's optional hard floor (off by default).HealthFactorTooLow

Price freshness

Freshness is per feed. A Chainlink feed publishes on a deviation trigger or after its heartbeat, so the limit is the feed's own heartbeat plus a 1,800-second publication margin. Because a 24-hour feed can stay silent for a day while inside its deviation threshold, a borrow also needs the second source to agree.

  • 86,400-second feeds (USDT/USD, GHO/USD and the Base stablecoin feeds): fresh for 88,200 seconds.
  • 82,800-second feeds (USDC/USD and USDS/USD on Ethereum): fresh for 84,600 seconds.
  • 3,600-second feeds (DAI/USD, ETH/USD): fresh for 5,400 seconds.

Health Check

After the Spoke call, the RiskModule reads the account's health factor from Aave and removes the contribution of the account's rescue units, the collateral admitted through the top-up slice or a rescue exemption. Aave counts rescue units in full, but they never support new debt.

hfEx ≥ max(1.00, minHealthFactor, hardHealthFloor(marketId))

The hard floor is off (0) on every launch market and is set only for a market whose stress tests justify it. Aave's own borrow check already requires a health factor of at least 1.00, and a higher on-chain floor would refuse borrows Aave accepts without protecting solvency, which the liquidation path guarantees. A failure undoes the whole call, including the transfer to the receiver.

For the full calculation and how the collateral factor applies, see Health Factor.

Borrow Rate and Fees

Interest is Aave V4's: the debt reserve's drawn rate on its funding Hub plus the account's risk premium, which Aave refreshes on each borrow. Interest accrues every second and raises the debt to repay; the repay page shows how the live debt is read. Avana takes no fee on borrow interest.

Avana Labs charges an app fee in its own app, outside the contracts. No contract computes, holds or enforces it, and calling the contracts directly does not pay it.

Accrual and repayment are covered in Repay Loans.

Availability by State

The most restrictive state over the account's market and every debt reserve it owes applies. The wallet's other markets, held by other proxies, never gate this borrow.

StateBorrow
Home Hub None, sequencer Up, market Live with its second source agreeing, every debt price fresh, no breaker tripped, wallet and receiver not frozenAllowed
Home Hub FrozenRefused (ApplicationFrozen)
Home Hub Paused with reason General or MintPathSuspectRefused (ApplicationPaused)
Another Hub on the chain pausedAllowed
Base sequencer Down, or within 3,600 seconds of a restartRefused (SequencerDown, SequencerGrace)
Wallet or receiver frozenRefused (AddressIsFrozen)
Market breaker trippedRefused (BreakerTripped)
Debt breaker of the borrowed reserve trippedRefused (DebtBreakerTripped)
Debt breaker of another reserve the account owes trippedAllowed
Price drop of 3% in 2 hours, more than 20% of a market seized in 1 hour, or 3 route failures in 1 hour, with no guardian tripAllowed: monitoring alerts only
Market Drifting, Cached or Expired, or Live with a disagreeing second sourceRefused
Any feed older than its heartbeat plus 1,800 secondsRefused (PriceTooOld, DebtPriceTooOld)
Market Offboarding, or its vault-token reserve frozen or paused on AaveRefused
No active committed operator on the chainRefused (LiquidationHalted)
Another market of the same wallet frozen, paused or in breachAllowed: that market is another account
Borrowed reserve frozen on Aave, or its drawCap exhaustedRefused by Aave
Aave V3 Pool flash liquidity short or paused, or one swap route down while another can settleAllowed
Any positive amount, however smallAllowed: no minimum debt

Breakers stop new debt at once and never stop liquidation, repay, top-ups or debt-free withdrawal. A temporary price or depth gate clears after 30 minutes of healthy observations; a deficit freeze stays until the guardian or the timelock reopens it.

Events

  • LPOracle and DebtOracle state events, only when a poke changes stored state.
  • Funding Hub Draw and Spoke Borrow, with Aave's risk-premium events when the premium changes.
  • The asset's Transfer from the proxy to the receiver.
  • Borrowed(wallet, marketId, debtReserveId, receiver, amount, nonce, healthFactorAfter)

Failures

Every failure reverts the whole transaction, including the nonce increment, every oracle poke and the transfer to the receiver.

ErrorCause
HealthFactorTooLowThe rescue-excluded health factor after the borrow is below 1.00, below minHealthFactor, or below the market's hard floor when one is set.
PriceNotLive / SecondSourceDisagrees / PriceTooOldThe market's price is not Live, its second source disagrees, or a collateral feed is too old.
DebtPriceTooOld / UnexpectedDebtPriceSourceA debt reserve's DebtOracle is stale or not Live, or the reserve is on an unexpected price source.
ApplicationFrozen / ApplicationPausedThe home Hub is Frozen or Paused.
SequencerDown / SequencerGraceThe Base sequencer is down or within its 3,600-second grace window.
AddressIsFrozenThe wallet or the receiver is frozen.
BreakerTripped / DebtBreakerTrippedA market breaker or the borrowed reserve's debt breaker is tripped.
LiquidationHalted / DebtLiquidationHaltedNo active committed operator, or no usable swap route into a debt asset of the account.
ConfigDrift / HubSharesNotEqualAssetsAave's configuration differs from what Avana expects.
AaveReservePaused / DebtReservePaused / ReserveFrozen / MarketOffboardingThe market's reserve or a debt reserve is paused or frozen, or the market is offboarding.
BadNonceThe expected nonce is not the proxy's current borrowNonce.
NoProxy / UnknownMarket / UnknownDebtReserve / InvalidReceiverThe account, market, debt reserve or receiver is not valid.
DeadlineExpired / ZeroAmount / LockHeldCall bounds.
BalanceDeltaMismatch / UnitsMismatchThe proxy did not receive and forward exactly the amount.
DrawCapExceeded / InsufficientLiquidity / HealthFactorBelowThresholdAave refuses the borrow; the error passes through unchanged.

Worked Example

Example values; each market's parameters are set at listing. Carol's account in market 3 (USDC/USDT, Uniswap v3 on Ethereum) from the Deposit LP example holds 10,000 whole vault tokens at $2.00: collateral $20,000, CF-weighted $16,000, no debt and borrowNonce 0. The USDC debt reserve is funded by the Avana Ethereum Hub's USDC credit line and priced by the USDC DebtOracle at $0.9999 on an 86,400-second feed (fresh for 88,200 seconds) with an agreeing second source. The USDC borrow rate is 6.00%. The Hub is in state None.
  • Her app calls previewBorrowRecommended for USDC with a deadline of now + 600: recommended 16,000 / 1.10 / 0.9999 = 14,546.91 USDC (HF 1.10); maximum, with margin (1 + 0.06 × 600 / 31,536,000) × 1.005 = 1.0050011, is 16,000 / 1.0050011 / 0.9999 = 15,921.97 USDC (HF 1.00).
  • She borrows 13,000 USDC: borrow(3, r_USDC, 13,000,000,000, Carol, now + 600, 1.20e18, 0).
  • The Adapter reads the Hub state (None), the freeze list, the account and the reserve, then consumes nonce 0.
  • The RiskModule pokes market 3's LPOracle and the USDC DebtOracle: both Live, the USDC round is 30,000 seconds old (at most 88,200), no drift, an active keeper, no breaker tripped.
  • No cap step runs: Carol's $20,000 charge has been booked since her pledge and a borrow books no charge.
  • The proxy borrows 13,000 USDC from the Spoke and forwards exactly 13,000 USDC to Carol.
  • Health check: debt value 13,000 × 0.9999 = $12,998.70, so HF = 16,000 / 12,998.70 = 1.2309, above max(1.00, 1.20).
  • Event Borrowed with nonce 0 and HF 1,230,892,320,001,230,892; borrowNonce becomes 1.

Failing variants

  • 14,000 USDC gives HF 16,000 / 13,998.60 = 1.1430 and reverts with HealthFactorTooLow against Carol's own 1.20. With minHealthFactor 0 it succeeds.
  • A USDC/USD round 88,300 seconds old reverts with DebtPriceTooOld.
  • A Hub that is Frozen or Paused reverts with ApplicationFrozen or ApplicationPaused.
  • A tripped market breaker reverts with BreakerTripped.
  • On a Base market, 1,800 seconds after a sequencer restart the borrow reverts with SequencerGrace; with the feed reporting down it reverts with SequencerDown.
  • A 1 USDC borrow succeeds: there is no minimum debt, and Avana's own keepers liquidate small accounts at Avana's gas cost.

Rescue units and the maximum

In market 3, wallet V owes 10,000 GHO against CF-weighted collateral of $12,000 (Aave HF 1.2000). $1,000 of the collateral is rescue units, worth $800 CF-weighted, so the rescue-excluded health factor is (12,000 − 800) / 10,000 = 1.1200. Borrowing 2,000 GHO would bring Aave's HF to 1.00 but the rescue-excluded HF to 0.9333, so it reverts with HealthFactorTooLow. 1,200 GHO is the largest borrow the check allows. At a 5.00% GHO rate the app shows a recommended 181.82 GHO and a maximum of about 1,144.27 GHO.

To keep the loan healthy after borrowing, see Manage Loans.