@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / LendReserve

Interface: LendReserve

Defined in: packages/sdk/src/lend/types.ts:43

One SomniaLend reserve (a listed asset), decoded from the UiPoolDataProvider aggregate — config, caps, live rates/indexes, liquidity, and the oracle price.

Details

Rates and indexes are Aave ray values (1e27) — convert a rate for display with lendRayRateToApy. Token amounts (availableLiquidity, totalVariableDebt, totalSupplied) are raw decimals-scaled units, accrued to the read's block timestamp.

Gotchas

borrowCap/supplyCap are WHOLE tokens (Aave convention), not raw units — 0 means uncapped.

Properties

underlying

underlying: `0x${string}`

Defined in: packages/sdk/src/lend/types.ts:45

The underlying ERC-20 the reserve lends (approve/supply/borrow this token).


symbol

symbol: string

Defined in: packages/sdk/src/lend/types.ts:47

Underlying token ticker, e.g. "USDso".


name

name: string

Defined in: packages/sdk/src/lend/types.ts:49

Underlying token full name.


decimals

decimals: number

Defined in: packages/sdk/src/lend/types.ts:51

Underlying token decimals (scales every raw amount on this row).


aToken

aToken: `0x${string}`

Defined in: packages/sdk/src/lend/types.ts:53

The interest-bearing aToken minted on supply (balance grows in place).


variableDebtToken

variableDebtToken: `0x${string}`

Defined in: packages/sdk/src/lend/types.ts:55

The variable-debt token minted on borrow (balance grows with interest).


ltvBps

ltvBps: number

Defined in: packages/sdk/src/lend/types.ts:57

Max borrowing power per unit of this collateral, bps (8000 = 80%).


liquidationThresholdBps

liquidationThresholdBps: number

Defined in: packages/sdk/src/lend/types.ts:59

Collateral value threshold (bps) past which a position can be liquidated.


liquidationBonusBps

liquidationBonusBps: number

Defined in: packages/sdk/src/lend/types.ts:61

Liquidator bonus, bps over par (10500 = 5% bonus).


reserveFactorBps

reserveFactorBps: number

Defined in: packages/sdk/src/lend/types.ts:63

Slice of borrow interest diverted to the protocol treasury, bps.


usageAsCollateralEnabled

usageAsCollateralEnabled: boolean

Defined in: packages/sdk/src/lend/types.ts:65

Whether supplying this reserve can back borrows at all.


borrowingEnabled

borrowingEnabled: boolean

Defined in: packages/sdk/src/lend/types.ts:67

Whether the reserve can be borrowed.


isActive

isActive: boolean

Defined in: packages/sdk/src/lend/types.ts:69

Reserve is listed and operational (false ⇒ every action reverts).


isFrozen

isFrozen: boolean

Defined in: packages/sdk/src/lend/types.ts:71

Frozen: existing positions stand but new supplies/borrows revert.


isPaused

isPaused: boolean

Defined in: packages/sdk/src/lend/types.ts:73

Paused: every action on the reserve reverts.


flashLoanEnabled

flashLoanEnabled: boolean

Defined in: packages/sdk/src/lend/types.ts:75

Whether the reserve is flash-loanable.


borrowCap

borrowCap: bigint

Defined in: packages/sdk/src/lend/types.ts:77

Borrow cap in WHOLE tokens (0 = uncapped).


supplyCap

supplyCap: bigint

Defined in: packages/sdk/src/lend/types.ts:79

Supply cap in WHOLE tokens (0 = uncapped).


availableLiquidity

availableLiquidity: bigint

Defined in: packages/sdk/src/lend/types.ts:81

Un-borrowed underlying sitting in the aToken, raw units.


totalVariableDebt

totalVariableDebt: bigint

Defined in: packages/sdk/src/lend/types.ts:83

Total variable debt outstanding, raw units, accrued to the read time.


totalSupplied

totalSupplied: bigint

Defined in: packages/sdk/src/lend/types.ts:85

Total supplied (available + borrowed), raw units, accrued to the read time.


liquidityRateRay

liquidityRateRay: bigint

Defined in: packages/sdk/src/lend/types.ts:87

Annual supply rate, ray (1e27) — lendRayRateToApy for display.


variableBorrowRateRay

variableBorrowRateRay: bigint

Defined in: packages/sdk/src/lend/types.ts:89

Annual variable borrow rate, ray (1e27).


liquidityIndexRay

liquidityIndexRay: bigint

Defined in: packages/sdk/src/lend/types.ts:91

Supply index, ray — current aToken balance = scaled balance × this.


variableBorrowIndexRay

variableBorrowIndexRay: bigint

Defined in: packages/sdk/src/lend/types.ts:93

Variable borrow index, ray — current debt = scaled debt × this.


lastUpdateTimestamp

lastUpdateTimestamp: number

Defined in: packages/sdk/src/lend/types.ts:95

Unix seconds the reserve's stored rates/indexes were last written on-chain.


priceInBaseCurrency

priceInBaseCurrency: bigint

Defined in: packages/sdk/src/lend/types.ts:97

Oracle price of one whole token, in base-currency units (baseCurrencyDecimals).


baseCurrencyDecimals

baseCurrencyDecimals: number

Defined in: packages/sdk/src/lend/types.ts:99

Decimals of the base currency (USD-denominated deployments use 8).