galleon-sparklend-position
SparkLend position review
Resolve the product
Ask for or discover chain, account, asset, amount and requested action. Confirm this is the SparkLend Pool. Spark Isolated Markets use Morpho; sUSDS and Spark Savings Vaults are savings products. Do not map every Spark-branded position onto an Aave SDK deployment. Resolve the current Pool, addresses provider, data provider and oracle from Spark's registry and match their verified interfaces.
Read one coherent position
Read Pool.getUserAccountData(account), getUserConfiguration(account), getUserEMode(account) and getReserveData(asset). Use the matching data provider for getUserReserveData(asset, account) and reserve configuration; preserve raw token decimals, oracle base units and WAD health factor. Read the oracle route, current prices, liquidation thresholds, borrowing LTV, debt balances, supply/borrow caps, pause/freeze flags, eMode category and isolation debt ceiling. Verify the actual deployment still supports the requested action; a historical network listing is insufficient.
Read underlying liquidity held by the reserve's spToken (its aToken-interface receipt contract) separately from total supply. Compare fresh accrued debt, available borrowing capacity and proposed post-state. Never infer withdrawable collateral solely from the wallet's spToken balance.
Prepare only the requested sequence
- Supply uses
supply(asset, amount, onBehalfOf, referralCode)with underlying allowance. Check whether first supply automatically enables collateral in the current configuration. - Borrow uses
borrow(asset, amount, interestRateMode, referralCode, onBehalfOf). Check the live rate-mode flag; implemented stable-rate code does not mean a reserve enables stable borrowing. A different debt owner requires explicit credit-delegation evidence. - Repay uses
repay(asset, amount, interestRateMode, onBehalfOf); approval alone does not reduce debt. Repay with aTokens is a different path and requires the same reserve asset. - Withdrawal uses
withdraw(asset, amount, recipient). Simulate its post-withdraw health and liquidity; do not reuse an earlier maximum after prices or accrued debt change.