SparkLend
Reports an account's per-reserve lending positions in SparkLend.
Reports an account's per-reserve lending positions in SparkLend. For each reserve it emits a supply/collateral leg (from the aToken balance) and a borrow leg (from variable debt). It enumerates reserves onchain from the SparkLend Protocol Data Provider, so it is a single fixed-scope contract.
Type: Plain adapter
protocolSubId:
keccak256("spark-lend")Source:
SparkLendBalanceAdapter.sol
Positions returned
Up to two legs per reserve that is both a SparkLend reserve and registered on NAVCalculator:
Supply
Supplied
false
aToken balance when usageAsCollateralEnabled == false
Collateral
Collateral
false
aToken balance when usageAsCollateralEnabled == true
Borrow
Borrowed
true
Variable + legacy stable debt, summed, one Borrowed leg per reserve
SparkLend is an Aave V3 fork: new stable borrows are deprecated, but legacy stable debt can still persist, so the adapter sums variableDebt + stableDebt into the borrow leg. Dropping the stable portion would understate debt and overstate NAV. Reserves with zero supply and zero debt are skipped.
For the same reason, if the account borrows a reserve whose asset is unregistered on NAVCalculator, the adapter reports nothing at all rather than emitting collateral without its offsetting debt. The borrowed set comes from the user-configuration bitmap, falling back to a full reserve scan when it is unavailable. See Never report collateral without its debt.
Balance calculation


Per reserve, the adapter reads getUserReserveData(asset, account) from the Protocol Data Provider:
The supply leg uses PositionKind.Collateral if asCollateral is true, else PositionKind.Supplied. The borrow leg is emitted with isDebt = true.
Identity
positionId:
abi.encode(address pool);poolis the SparkLend Pool resolved at construction; the reserve each leg refers to is carried inbalanceAsset, not thepositionIdpositionKind:
Supplied·Collateral·Borrowed
Constructor
dataProvider_
SparkLend Protocol Data Provider (must be a contract); source of the reserve list and per-user reserve data
navCalculator_
NAVCalculator address (must be a contract); source of the asset registry
The POOL address used in positionId is derived at construction from dataProvider_.ADDRESSES_PROVIDER().getPool().
Registration
Registered as a plain adapter with addBalanceAdapters([adapter]) (MANAGER-gated); removed with removeBalanceAdapters.
Last updated