Spotify Wrapped, but for any crypto wallet. Point it at an address and it turns the wallet's on-chain life into a shareable card β net worth, chain & token mix, DeFi protocols, a diversification score, and a tongue-in-cheek wallet persona β all powered by the CoinStats Crypto API.
The image below is regenerated every 12 hours by GitHub Actions and committed straight back into the repo β so this README is its own running demo.
Every number on that card comes from two CoinStats Crypto API endpoints:
GET /wallet/balancefor the token holdings, andGET /wallet/defifor the DeFi positions.
wallet-wrapped has two faces, one engine:
πΌοΈ card |
Renders a self-contained .svg "Wrapped" card (the one above). Pure stdlib, no browser, GitHub-safe. Drop it in any README or profile and let CI keep it fresh. |
π₯οΈ show |
Prints the same Wrapped β net worth, persona, allocation bar, top tokens & protocols, and a diversification gauge β straight to your terminal. |
It reads any public wallet address, so you can wrap your own, a friend's, or a famous one.
git clone https://github.com/scsona/wallet-wrapped.git
cd wallet-wrapped
pip install -e . # installs `rich`; the card generator needs only stdlibGrab a key (free tier available) at https://api.coinstats.app/, then:
cp .env.example .env # paste your key into .env
# or: export COINSTATS_API_KEY=your_key_herewallet-wrapped show 0x94845333028B1204Fbe14E1278Fd4Adde46B22ce # terminal report
wallet-wrapped card 0x94845333028B1204Fbe14E1278Fd4Adde46B22ce # β assets/wrapped.svg
wallet-wrapped card 0xYourAddress -o me.svg # render somewhere else
wallet-wrapped show --chain ethereum 0xYourAddress # single chain onlyNo key handy? Every command supports --demo for an offline preview using bundled sample data:
wallet-wrapped show --demo
wallet-wrapped card --demoYour persona is the best-fitting archetype for your portfolio mix β a deliberately playful, fully transparent heuristic (the scoring lives at the top of wallet_wrapped/wrapped.py). Each archetype scores itself from a handful of signals and the highest wins:
| Persona | You get it when⦠|
|---|---|
| πΎ Yield Farmer | a big share of your stack is working in DeFi across several protocols |
| π Blue-chip Whale | large net worth, dominated by BTC/ETH |
| π Diamond Hands | blue-chip heavy, barely any DeFi β just holding |
| π‘οΈ Stable Captain | most of the book is in stablecoins |
| π Multichain Nomad | spread across many chains |
| π² Degen | lots of small-cap tokens, low concentration |
| π§Ί Diversified Trader | spread out, holding spot, no single dominant bag |
| π± Crypto Curious / π» Ghost Wallet | a tiny or empty wallet |
A transparent 0β100 number β not a risk rating. It blends two signals over your combined holdings (each token and each DeFi protocol counts as one asset):
- Spread (70%) β
1 β HHI, where HHI is the Herfindahl index of asset weights. All-in on one bag β0; evenly spread β approaches1. - Breadth (30%) β how many distinct assets you hold, saturating at 12.
The weights live in DIVERSIFICATION_WEIGHTS at the top of wallet_wrapped/wrapped.py β change them and you change the meaning.
This repo ships a GitHub Action (.github/workflows/update-card.yml) that regenerates the card on a schedule and commits it. To use it in your repo:
- Add a repository secret named
COINSTATS_API_KEY(Settings β Secrets and variables β Actions). Get the value from the CoinStats Crypto API dashboard. - Set the
WALLET_ADDRESSenv in the workflow to the wallet you want to feature. - Embed the card anywhere in your README:
<img src="assets/wrapped.svg" width="820">
- That's it β the workflow runs every 12 hours (and on demand via Run workflow). Without the secret it falls back to demo data, so forks never break.
All requests go to https://openapiv1.coinstats.app with your key in the X-API-KEY header.
| Endpoint | Used for |
|---|---|
GET /wallet/balance |
token holdings, prices and net worth across 120+ chains |
GET /wallet/defi |
DeFi positions (lending, LP, staking, yield) across protocols |
Both accept address plus either blockchain (a chain id, comma-separated list, or all) or connectionId. See the full reference and grab a key at api.coinstats.app.
wallet_wrapped/
api.py # stdlib CoinStats client (X-API-KEY, retries) for the two wallet endpoints
wrapped.py # the engine: net worth, allocation, personas, diversification score
svgcard.py # GitHub-safe SVG "Wrapped" card renderer (pure stdlib)
report.py # the rich terminal report
sample_data.py # frozen snapshot for --demo
cli.py # `wallet-wrapped show` / `wallet-wrapped card`
scripts/generate_card.py # entry point for the GitHub Action
.github/workflows/ # CI + the self-updating card job
pip install -e ".[dev]"
pytest -qMIT Β© scsona