Skip to content

Commit

Permalink
.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
daviidarr committed Apr 23, 2024
1 parent a1473db commit f4181f5
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# https://poolhopper.streamlit.app/
# https://actualyield.streamlit.app/

Streamlit app
This Debank powered Streamlit app allows on-chain yield farmers to visualize their risk and understand what drives their pnl.

More details on

## Architecture
### 1) Data collection (plex/debank_api)
Leverages Debank API to decompose risk across all protocols, wallet holdings and nft.
### 2) Data storage (utils/db.py)
Raw data is stored on S3, and derived data is compiled into 'snapshot', 'transactions' and 'categories' SQLite databases.

Those files live on S3 and are unique to each user (ie. to each debank key). Please note: concurrent usage of a single debank key is not unsafe.
### 3) plex computations (plex/plex.py)
Performs pnl explain btw 2 snapshots, also displays all transactions.

One key feature is the ability to group tokens by underlying (eg ETH-pegged, USDC-pegged...) to separate impact of majors moves from basis moves (eg fluctuations from peg, yield accrual..)

This is driven by the user through the categorization feature.
### 5) configs (config/params.yaml)
mostly S3 paths
### 6) streamlit UI (./pnl_explain.py)
- enter debank key and addresses on the sidebar
- can trigger a live snapshot and store it
- displays either live or historical risk
- displays granular pnl explain + transactions btw 2 dates
- displays historical pnl explain stacked bars
### 7) headless snapshot script (./cli.py)
This is meant to be run as a cron job to regularly fetch data from debank to S3.
# guide
- to install, run `pip install -r requirements.txt`
- then run module streamlit `run pnl_explain.py` to launch the streamlit app

0 comments on commit f4181f5

Please sign in to comment.