agent0.ethpy.hyperdrive.addresses

Helper class for storing Hyperdrive addresses

Functions

get_hyperdrive_registry_from_artifacts(→ str)

Fetch addresses for deployed contracts in the Hyperdrive system.

get_hyperdrive_addresses_from_registry(→ dict[str, ...)

Fetch addresses for deployed contracts in the Hyperdrive system.

get_hyperdrive_name(→ str)

Generates a name for a given hyperdrive address. The address generated is of the form

Module Contents

agent0.ethpy.hyperdrive.addresses.get_hyperdrive_registry_from_artifacts(artifacts_uri: str) str

Fetch addresses for deployed contracts in the Hyperdrive system.

Parameters:

artifacts_uri (str) – The URI for the artifacts endpoint.

Returns:

A dictionary that mirrors the artifacts json structure.

Return type:

dict[str, ChecksumAddress]

agent0.ethpy.hyperdrive.addresses.get_hyperdrive_addresses_from_registry(hyperdrive_registry_addr: str, web3: web3.Web3) dict[str, eth_typing.ChecksumAddress]

Fetch addresses for deployed contracts in the Hyperdrive system.

Parameters:
  • hyperdrive_registry_addr (str) – The address of the Hyperdrive registry contract.

  • web3 (Web3) – The instantiated Web3 instance that’s connect to a chain to use.

Returns:

A dictionary keyed by the pool name (e.g., StETHHyperdrive_14day) with a value of the address of the deployed hyperdrive pool.

Return type:

dict[str, ChecksumAddress]

agent0.ethpy.hyperdrive.addresses.get_hyperdrive_name(hyperdrive_address: eth_typing.ChecksumAddress, web3: web3.Web3) str

Generates a name for a given hyperdrive address. The address generated is of the form <vault_shares_token_symbol>_<position_duration>_day.

Parameters:
  • hyperdrive_address (ChecksumAddress) – The address of a hyperdrive pool.

  • web3 (Web3) – The instantiated Web3 instance that’s connect to a chain to use.

Returns:

The generated name of the hyperdrive pool.

Return type:

str