ChainArgos
API
API
  • 🔌api-demos
  • Basic google-sheet-pivot-table-based gueries
    • 🦮API walkthrough
    • 🎬Basic ETL demo
    • 🎰Compute statistics on YGG flows
  • More complex Looker API queries
    • Looker API introduction
    • Downloading a look to pandas
    • Ethereum address inflows
    • Running a look via API
    • Running a look with several filters via API
  • Research
    • How empty are Heco blocks these days?
    • Tether minting vs BTC price
    • Wallet evaluation
Powered by GitBook
On this page
  1. More complex Looker API queries

Ethereum address inflows

PreviousDownloading a look to pandasNextRunning a look via API

Last updated 9 months ago

Specify:

  • addresses in the ADDRESSES list

  • token symbols in the TOKENS list

This demo retrieves a pandas dataframe and prints it out.

https://github.com/ChainArgos/api-demos/blob/main/looker/eth_flows/eth_flows.py
import looker_sdk

from looker.wallet_eval.helpers import create_query, run_query

looker = looker_sdk.init40("../looker.ini")

ADDRESS = [
    "0x346eF244464679b031750f70D750B3FA65165443",
    "0x9ed891f6b3209c3f3c6906bafdd2e8d89afd45a0"
]

TOKENS = [
    "ETH",
    "USDC",
    "USDT"
]

INFLOWS_LOOK_ID = 724

look = looker.look(look_id=str(INFLOWS_LOOK_ID))
query_filter = {
    "ethereum_txns.to_address": ",".join(ADDRESS),
    "tokens.symbol": ",".join(TOKENS),
}

q = create_query(looker, look.query, query_filter)
result = run_query(looker, q)
print(result)