Adding On-chain Transaction Data and USD Prices

Balancer V1.0 comes with scripts to plug on-chain transaction data into the cadCAD model, and add USD price data for rich analysis.

The simulation operates on Actions, which are interactions between users and the Balancer Pool reconstructed from Ethereum log events. Google BigQuery Ethereum ETL maintains an easy to query SQL database of most log events, but not all. Therefore in addition to a Google Cloud BigQuery account, you will need access to an archive node.

There is a data script data/pulldata.py that creates said Actions from the Ethereum log events and interleaves fiat prices of the tokens in the Balancer Pool in between the Actions. The fiat price data can come from Tradingview CSVs or Coingecko's API - however, for pricing data more than 1 year old, Coingecko's API only returns daily prices, not hourly.

To use Tradingview CSV exports, you must have a paid account. Put the CSV files in a subdirectory with pool address (see here for an example). The naming scheme is not fixed - just make sure the fiat symbol and the token symbol are somewhere in the filename.

For Coingecko, you do not need anything.

Follow the instructions here.

Last updated