blockchain-etl / ethereum-etl

Python scripts for ETL (extract, transform and load) jobs for Ethereum blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions. Data is available in Google BigQuery https://goo.gl/oY5BCQ
https://t.me/BlockchainETL
MIT License
2.96k stars 849 forks source link

Token prices #476

Open SriramV739 opened 9 months ago

SriramV739 commented 9 months ago

Hello: Thanks for making this repo, very useful. I see that we have a value column representing the token quantity for each txn. How do I interpret the value, should I divide by some power of 10 to get the actual txn quantity? For a txn with 300 token transfers in etherscan.io I see a value column in your repo at around 3000000.

Also is there a place where I can get the unit price of the token for each txn. I will like to use this to get the $ value of the txn. This information is available in etherscan.io website but I will love to get it from this repo.

vonum commented 6 months ago

Hey @SriramV739 , each token has it's decimals defined in the contract. so you can do the following: amount / POW(10, decimals)

For ether, that would be amount / POW(10, 18)