Aave V3 reserve data is a packed risk map
How to decode Aave V3 reserve configuration data: shift and mask each field, then read basis points, whole-token caps and flags in their proper units.
Merkle Street Newsroom#623ea24 min read
Aave V3 reserve configuration data packs a reserve’s risk settings into one uint256, so you can decode LTV, caps and flags from a single call. The pool returns this word as a ReserveConfigurationMap when you call getConfiguration(asset).
Each field occupies a set of bits. Shift the word right until the field starts at bit zero, then apply a mask wide enough to keep only that field. Think of the word as a row of labeled slots: shifting lines up the slot you want, and masking clears the others.
Shift each field, then read its units
Aave V3 stores each reserve parameter at a defined bit offset and width. Bits 0–15 hold LTV; 16–31 hold the liquidation threshold; 32–47 hold the liquidation bonus; and 48–55 hold the reserve’s decimals.
For the first two fields, the formulas are ltv = data & 0xFFFF and threshold = (data >> 16) & 0xFFFF. A decoded value of 8000 means 80%, because LTV and liquidation threshold are expressed in basis points: 10,000 is 100%. Reserve factor and liquidation protocol fee use the same scale.
Bits 56–60 contain flags: active at 56, frozen at 57, borrowing enabled at 58, and paused at 60. Bit 59 is a stable-borrow setting in older layouts; later V3 versions deprecated it. The eMode-category bits were also deprecated in later versions, so check the deployment’s version before interpreting those positions.
Bits 64–79 hold the reserve factor. The borrow cap occupies bits 80–115, and the supply cap bits 116–151. Caps are whole tokens, not wei: a cap value of 500 means 500 tokens, while zero means no cap. Bits 152–167 hold the liquidation protocol fee. The debt ceiling uses bits 212–251 and is denominated in USD with two decimal places.
On SparkLend, the same shift-and-mask approach applies to the reserve word returned by its Aave V3-compatible pool. The SparkLend topic covers how its lending market uses supplied assets as collateral to borrow other listed assets. Use the configuration from the deployment you are querying, since version differences can change how some positions should be read.
The liquidation bonus includes its 100% base
The liquidation bonus field stores the full bonus rate, including a 10,000 basis-point base. A decoded value of 10,500 therefore means a 5% bonus over the repaid amount, not a 105% bonus.
That distinction matters when comparing reserves. Take two otherwise identical collateral positions with the same value and threshold. If one reserve has an LTV of 8,000, it permits borrowing against up to 80% of that collateral value before other protocol constraints. If the other has an LTV of zero, that reserve contributes no borrowing capacity. The changed LTV drives the different result; the liquidation threshold remains a separate parameter used in liquidation risk.
In practice, a developer can call getConfiguration for WETH or wstETH, decode the word, and inspect the reserve’s parameters before building a risk display or checking a borrowing path. Keep decimals separate from caps: decimals describe token precision, while cap values already represent whole tokens.
Related
How do you read the Aave V3 user configuration bitmap?
The user configuration bitmap records reserve-level borrowing and collateral status for an account. Read it separately from ReserveConfigurationMap: the reserve word describes a market’s settings, while the user bitmap describes that user’s position flags.
What does the liquidation protocol fee mean in Aave V3?
The liquidation protocol fee is the share of the liquidation bonus directed to the protocol, and its field is read in basis points. Decode bits 152–167, then divide by 10,000 to express the stored rate as a percentage.
For a reserve check, call the pool for the asset, confirm the deployment version, then shift and mask each field and apply its stated unit before using the result.