Token Transfers Not Tracked by Transfer() Events

Hi, I am currently conducting an analysis of Lido StETH holders and their balances over time. To do this quickly and cheaply I am using etherscans method of subtracting outbound tokens from inbound tokens to get the balance of an address at any point in time.

This has been successful in principal, however it seems that there is sometimes some unaccounted for transfers (I suspect from mints?) that are causing balances to return as negative.

Here is one such example:

At block 16546200: Etherscan value ~-4183336466029845598375,
balanceOf() Value: 2798160878585542078071

Strangely though in the contract code it seems that mints do in fact emit a transfer() from NULL → Msg.Sender on successful mints.

if anybody has any information that could help me fill in the gaps here it would be greatly appreciated.


sorry, but have you accounted for stETH shares mechanics?

This definitely could be it. Do you happen to know if the rebase emits an event or transaction?

The best approach in my opinion would be to use our Subgraph.

In a single request you can get shares of an address with protocol totals (total shares and pooled ETH) at any block. Then, you just need to calculate the balance.

  shares (id: "0x123", block: {number: 123}) {
  totals (id: "", block: {number: 123}) {

Empty string is correct here for the totals id

You will get:

  "data": {
    "shares": {
      "shares": "123"
    "totals": {
      "totalShares": "123",
      "totalPooledEther": "123"

To get the balance:

const balance = shares * totalPooledEther / totalShares

Make sure to parse as big numbers eg use BigInt in JS

If you are going to do this manually, you can use the Subgraph Playground.

If automating, I highly recommend using graph-client to make requests.