Giter Site home page Giter Site logo

aaveanalyse's Introduction

Goal

Estimate Aave Health Factor for the given address at different points in time.

Contents

  • Script to query the list of interactions the given address had with Aave v1.
    • This was done using Aave GraphQL API but could have been done by querying Ethereum blockchain directly using e.g. Etherscan
  • Result Excel sheet: Contains the output of script plus price data and the calculated Health Factor at each point the address interacted with Aave. This can be automated (read TODO below)

Notes:

  • The Health Factor formula in the docs is based on prices in ETH but we use prices in USD because it's simpler and the calculation doesn't change as long as the quote currency is consistent.
  • In the sheet, the balance at the end is non-zero because of earned/owed interest. This also means that the Health Factor calculation at each time given is not 100% accurate because the amount borrowed/deposited changed since the time of the precious transaction. This can be fixed by querying for all of the address's balances at each timestamp we're interested in.

TODO:

Avoid using Excel by automating these steps:

  • Query block number based on transaction hash using Etherscan API
  • Query prices at certain times using e.g. CoinmarketCap API (paid subscription)
  • Query Liquidation Threshold, which is used in calculating Health Factor, at the time for which we are calculating the health factor using Aave API.
  • With that data, build address balance at any given point in time and calculate the Health Factor.
  • Make the calculation more accurate by updating our knowledge of the address's balances at each timestamp because the amount deposited/borrowed changes based on the interest earned/owed.

Resources used:

Final output (taken from Excel sheet)

Health Factor Block Num
Inf 10394277
1.48 10394295
2.38 10470088
1.62 10470095
2.10 10599809
7.41 10867350
Inf 10868596
Inf 10872624
Inf 10872633

aaveanalyse's People

Contributors

spacemonkeyforever avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.