agent0.ethpy.hyperdrive.transactions

Helper functions for interfacing with hyperdrive.

Functions

get_hyperdrive_pool_config(...)

Get the hyperdrive config from a deployed hyperdrive contract.

get_hyperdrive_pool_info(...)

Get the block pool info from the Hyperdrive contract.

get_hyperdrive_checkpoint(...)

Get the checkpoint info for the Hyperdrive contract at a given block.

get_hyperdrive_checkpoint_exposure(...)

Get the checkpoint exposure for the Hyperdrive contract at a given block.

Module Contents

agent0.ethpy.hyperdrive.transactions.get_hyperdrive_pool_config(hyperdrive_contract: hyperdrivetypes.types.IHyperdriveContract) hyperdrivetypes.fixedpoint_types.PoolConfigFP

Get the hyperdrive config from a deployed hyperdrive contract.

Parameters:

hyperdrive_contract (Contract) – The deployed hyperdrive contract instance.

Returns:

The hyperdrive pool config.

Return type:

dict[str, Any]

agent0.ethpy.hyperdrive.transactions.get_hyperdrive_pool_info(hyperdrive_contract: hyperdrivetypes.types.IHyperdriveContract, block_identifier: web3.types.BlockIdentifier) hyperdrivetypes.fixedpoint_types.PoolInfoFP

Get the block pool info from the Hyperdrive contract.

Parameters:
  • hyperdrive_contract (Contract) – The contract to query the pool info from.

  • block_identifier (BlockIdentifier) – The block identifier to query from the chain.

Returns:

A dictionary containing the Hyperdrive pool info returned from the smart contract.

Return type:

dict[str, Any]

agent0.ethpy.hyperdrive.transactions.get_hyperdrive_checkpoint(hyperdrive_contract: hyperdrivetypes.types.IHyperdriveContract, checkpoint_time: web3.types.Timestamp, block_identifier: web3.types.BlockIdentifier) hyperdrivetypes.fixedpoint_types.CheckpointFP

Get the checkpoint info for the Hyperdrive contract at a given block.

Parameters:
  • hyperdrive_contract (IHyperdriveContract) – The contract to query the pool info from.

  • checkpoint_time (Timestamp) – The block timestamp that indexes the checkpoint to get.

  • block_identifier (BlockIdentifier) – The block number to query from the chain.

Returns:

The dataclass containing the checkpoint info in fixed point

Return type:

CheckpointFP

agent0.ethpy.hyperdrive.transactions.get_hyperdrive_checkpoint_exposure(hyperdrive_contract: hyperdrivetypes.types.IHyperdriveContract, checkpoint_time: web3.types.Timestamp, block_identifier: web3.types.BlockIdentifier) fixedpointmath.FixedPoint

Get the checkpoint exposure for the Hyperdrive contract at a given block.

Parameters:
  • hyperdrive_contract (IHyperdriveContract) – The contract to query the pool info from.

  • checkpoint_time (Timestamp) – The block timestamp that indexes the checkpoint to get. This must be an exact checkpoint time for the deployed pool.

  • block_identifier (BlockIdentifier) – The block number to query from the chain.

Returns:

The dataclass containing the checkpoint info in fixed point.

Return type:

CheckpointFP