Skip to content

Instantly share code, notes, and snippets.

@rifkiamil
Created February 19, 2021 12:36
Show Gist options
  • Save rifkiamil/b2be164a845097a68f7814b0f4603803 to your computer and use it in GitHub Desktop.
Save rifkiamil/b2be164a845097a68f7814b0f4603803 to your computer and use it in GitHub Desktop.
Top 20 balances on Ethereum with correct decimal place
## Below is the query that will give you top 20 balances on Ethereum
SELECT Address as EthAddress,
CAST(eth_balance as NUMERIC)/1000000000000000000 as EthBalance
FROM `bigquery-public-data.crypto_ethereum.balances`
ORDER BY Eth_balance DESC
LIMIT 20
@ctrl-f-sebi
Copy link

ctrl-f-sebi commented Aug 29, 2021

Hiya,

I really like your Medium article on using the data set. I was wondering how you figured out to divide the amount by 1000000000000000000?

I actually only found your article because I was searching for why these balances seemed so inflated and what they were possibly representing.

Thanks,
Seb

@rifkiamil
Copy link
Author

https://github.com/blockchain-etl is the code that extract the data of the blockchain. Should be some place in the Repository. Does that help?

@ctrl-f-sebi
Copy link

Yeah, I think. I did not specifically find it in the code that extracts the data (I am not advanced enough), however, if balances are measured in Wei then that would explain division by 1000000000000000000

Thanks!

@rifkiamil
Copy link
Author

If you try the following discord group https://discord.com/invite/wukrezR you will find a channel for Ethereum ETL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment