Closed dpaiton closed 1 year ago
elf-simulations/lib/ethpy/hyperdrive/interface.py
@sentilesdal task
get_hyperdrive_pool_config
and get_hyperdrive_pool_info
elf-simulations/lib/ethpy/hyperdrive/api.py
@dpaiton task
HyperdriveInterface object has attributes
interface._pool_info
interface.get_hyperdrive_pool_info
same for interface._pool_config
, interface._latest_checkpoint
, interface._block_info
interface.hyperdrive_market
my_interface = HyperdriveInterface()
my_market = my_interface.current_hyperdrive_market(block_number: int | None) # instantiation of the class
# everything is frozen to the "current block"
# everything is synced with "block_info"
my_market.pool_info
my_market.pool_config
# above are always the same no matter how when I access
new class that has interface.hyperdrive_market.
{pool_info
, pool_config
, checkpoint
, block_info
, and other derived values}
_ensure_current_state
so that everything is on the same blockthe subclasses (e.g. interface.hyperdrive_market.pool_info
) use elf-sims types (e.g. FixedPoint
, datetime.timestamp
, etc)
interface.get_max_long
pyperdrive.get_max_long(self._pool_config, self._pool_info)
pyperdrive.get_max_long
is a pypechain PoolConfig and PoolInfoget_max_long
is an example; all interface attributes that rely on underlying Pyperdrive functions will use the self._pool_config
and self._pool_info
arguments.pyperdrive
@sentilesdal task
for interface._ensure_current_state
@dpaiton task
TODO:
self.current_block_number
from being a property to a function self.get_current_block_number()
My tasks are achieved with #1063
Made some more progress centralizing type specifications & conversions in #1099
completed in #1113
This issue is a high-level proposal that includes task from #892 #905 #912 #917
We want to unify the types used by the different packages and create an intuitive interface for getting contract data