alina schanz
home / methods

where the numbers come from

every figure on this site or in a post, with the endpoint and the formula behind it.

this page holds the method behind each number on the site: the endpoint, the formula, what can go wrong.

the rules

  • public endpoints only. if i cannot show you how to fetch a number, i do not use it.
  • python 3.10 or newer, standard library only, so you install nothing and no dependency changes under me.
  • every script prints the block number or timestamp it read, so you can pin a number to a moment.
  • when a source rate-limits, the script falls back to another public source and says so. where it got no answer, it leaves a gap.

sources

numbersourcehow
btc, eth, sol pricecoingecko simple/priceusd, with the 24-hour change the api reports. when coingecko limits your ip, the front page falls back to coinbase (its 24-hour open gives the same change) and then kraken (spot only, and it says so). the 7-day chart uses coingecko market_chart, then coinbase or kraken hourly candles.
eth base feepublic json-rpc, eth_feeHistorythe base fee of the next block, from the chain itself, and the blob base fee from the same call. the page tries the nodes in order: publicnode, drpc, tenderly, mevblocker. the moving line behind the front page is the same call for the last 256 blocks, with each block's gasUsedRatio as the bar behind the line; the page refreshes it every twelve seconds while the tab is open.
what a transfer costssame call, last 20 blocksbase fee plus the median priority fee of the last 20 blocks, times 21,000 gas for a transfer, times the eth price.
fear & greedalternative.me fngtoday's value and the value seven days back. alternative.me computes the index; i quote it.
tvl by chaindefillama v2/chainsas defillama reports it; i quote the figure.
btc dominancecoingecko globalas coingecko reports it.
berlin weatheropen-meteocurrent temperature and weather code for 52.52, 13.405, for the status line.

gasweek: when is ethereum cheapest

gasweek pages eth_feeHistory 1,024 blocks at a time until it has a week, 50,400 blocks. the base fee of each block is exact. it fetches timestamps for the first and last block of each page only and interpolates in between, so the hour a block lands in is right to within a few seconds. it then bins the base fees by hour of day and by weekday and summarises each bin as min, p25, median, p75, p90 and max. a github workflow writes one such row a day into the daily dataset at 00:17 utc, with the block range it covered.

bigmoves: large transfers

bigmoves asks eth_getLogs for the erc-20 Transfer topic in windows of 25 blocks, for usdt, usdc, dai, weth, wbtc and a few more. it reads symbol and decimals from each contract instead of assuming them, prices weth and wbtc with coingecko and the stablecoins at one dollar, and names addresses from a public label set (the 2023 etherscan labels dataset) plus a short list i keep by hand: exchange hot and cold wallets, bridges, routers, a lending pool. a label is a hint about who holds an address; check it before you build on it.

stablepeg: are the stablecoins still a dollar

for each coin stablepeg asks the uniswap v3 factory for the pool against usdc at every fee tier, takes the pool with the most liquidity, and reads the spot price from its slot0 and a ten-minute time-weighted average from observe(). ten minutes is short because the question is the price now. curve 3pool answers what 100,000 usdt or dai returns in usdc through get_dy. coingecko sits in the last column as a check. a coin fifty basis points or more off gets a flag; frax and lusd carry one most weeks, and for those two a flag is the usual state.

ens-lookup: names and addresses

namehash needs keccak-256, and python ships nist sha3 which pads differently, so the package carries its own keccak, which i checked against hashlib and the published test vectors. lookups go registry → resolver → addr or text. the script confirms every reverse lookup with a forward lookup before it shows one, because anyone can set a reverse record to any name.

what can go wrong

  • public nodes lag a block or two, and two nodes can disagree for a moment. each script prints the block number so you can tell.
  • a base fee is what the chain charges. you pay a tip on top, and wallets overestimate it.
  • percentiles over a week hide the spikes, so the max column is there.
  • labels age. an exchange rotates a wallet and the label stays on the old one.
  • coingecko limits requests per ip, so the front page may show the fallback source. the caption names it.

rerun it

git clone https://github.com/alinaschanz/onchain-notes
cd onchain-notes
python daily_card.py

if the card does not match a post of mine from the same hour, write to hello@alinaschanz.life. mistakes go on the corrections list, the post stays up.