Degen Code

Degen Code

Aave — Part VII

Unraveling Complexity

Mar 24, 2026
∙ Paid

Part VI closed with a simple demonstration of building collateral positions using a simple process: look for Supply events, then decode them to inspect the user address, the reserve address, and the amount supplied.

But that’s a naive approach that ignores a lot of detail. Critically, it scales poorly — every successive update would have to scan for new events since the last block, discover new users, add them to the previous users, then do a full re-scrape of all of the previous plus new positions.

So instead of rely on that structure, I built the updater from the ground up. Along the way, I dug through many layers of unexpected complexity. It required a lot of untangling, but yielded valuable information about how Aave handles position accounting, upgrades, and changing incentives.

I will cover several areas where position tracking required additional layers of decoding and tracking. This will be particularly useful if you need to understand how the Aave contracts are wired together across a particular market.

User's avatar

Continue reading this post for free, courtesy of BowTiedDevil.

Or purchase a paid subscription.
© 2026 BowTiedDevil · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture