agent0.chainsync.db.hyperdrive.chain_to_db
Functions for gathering data from the chain and adding it to the db
Functions
|
Function to query and insert pool config to dashboard. |
|
Function to query and insert data to dashboard. |
|
Function to query checkpoint events from all pools and add them to the db. |
|
Function to query trade events from all pools and add them to the db. |
Module Contents
- agent0.chainsync.db.hyperdrive.chain_to_db.init_data_chain_to_db(interfaces: list[agent0.ethpy.hyperdrive.HyperdriveReadInterface], session: sqlalchemy.orm.Session) None
Function to query and insert pool config to dashboard.
- Parameters:
interfaces (list[HyperdriveReadInterface]) – A collection of Hyperdrive interface objects, each connected to a pool.
session (Session) – The database session
- agent0.chainsync.db.hyperdrive.chain_to_db.pool_info_to_db(interfaces: list[agent0.ethpy.hyperdrive.HyperdriveReadInterface], block_number: int, session: sqlalchemy.orm.Session) None
Function to query and insert data to dashboard.
- Parameters:
interfaces (list[HyperdriveReadInterface]) – A collection of Hyperdrive interface objects, each connected to a pool.
block_number (int) – The block number to query the chain on.
session (Session) – The database session.
- agent0.chainsync.db.hyperdrive.chain_to_db.checkpoint_events_to_db(interfaces: list[agent0.ethpy.hyperdrive.HyperdriveReadInterface], db_session: sqlalchemy.orm.Session) None
Function to query checkpoint events from all pools and add them to the db.
- Parameters:
interfaces (list[HyperdriveReadInterface]) – A collection of Hyperdrive interface objects, each connected to a pool.
db_session (Session) – The database session.
- agent0.chainsync.db.hyperdrive.chain_to_db.trade_events_to_db(interfaces: list[agent0.ethpy.hyperdrive.HyperdriveReadInterface], wallet_addr: str | None, db_session: sqlalchemy.orm.Session) None
Function to query trade events from all pools and add them to the db.
- Parameters:
interfaces (list[HyperdriveReadInterface]) – A collection of Hyperdrive interface objects, each connected to a pool.
wallet_addr (str | None) – The wallet address to query. If None, will not filter events by wallet addr.
db_session (Session) – The database session.