Skip to content

add a hyperdrive api#870

Merged
dpaiton merged 32 commits intomainfrom
dpaiton/hyperdrive-api
Sep 25, 2023
Merged

add a hyperdrive api#870
dpaiton merged 32 commits intomainfrom
dpaiton/hyperdrive-api

Conversation

@dpaiton
Copy link
Copy Markdown
Contributor

@dpaiton dpaiton commented Sep 15, 2023

This PR is to create a higher-level interface for the hyperdrive contract. Presently, the primary consumer of this API will be agent0.

The api is primarily following specs from the front-end team's hyperdrive-js sdk. It will ultimately wrap

  • pypechain: types, errors, structs, etc
  • pyperdrive: static functions such as get_max_long, get_spot_price, etc
  • ethpy.hyperdrive: more convenient interface for trades (open_long, etc), getting the pool state & config, etc

This PR is a first step, and does not include all of the desired features.

The API currently provides the following endpoints:

  • hyperdrive.web3
  • hyperdrive.hyperdrive_contract
  • hyperdrive.base_token_contract
  • hyperdrive.get_get_eth_base_balances(address)
  • hyperdrive.last_state_block_number
  • hyperdrive.pool_config
  • hyperdrive.pool_info
  • hyperdrive.latest_checkpoint
  • hyperdrive.current_block
  • hyperdrive.current_block_number
  • hyperdrive.current_block_time
  • hyperdrive.spot_price
  • hyperdrive.get_max_long(FixedPoint(1000))
  • hyperdrive.get_max_short(FixedPoint(1000))

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
elf-simulations ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2023 9:55pm

@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from e678bea to ff4b688 Compare September 15, 2023 02:56
@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from ff4b688 to dd7f1c4 Compare September 15, 2023 02:59
@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from dd7f1c4 to a70c0f9 Compare September 15, 2023 03:20
@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from 6077f20 to 35cc805 Compare September 15, 2023 20:16
@dpaiton dpaiton changed the title adds a hyperdrive api add a hyperdrive api Sep 20, 2023
@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from 8d65d44 to d09fba7 Compare September 22, 2023 07:19
@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from d09fba7 to 0150d86 Compare September 22, 2023 07:20
@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from 0150d86 to c6e074a Compare September 22, 2023 07:21
@dpaiton dpaiton force-pushed the dpaiton/hyperdrive-api branch from ff573b1 to dbd2571 Compare September 22, 2023 18:39
@dpaiton dpaiton added the enhancement A feature or refactor request label Sep 22, 2023
@dpaiton dpaiton added this to the Trading competition V2 milestone Sep 22, 2023
@dpaiton dpaiton linked an issue Sep 22, 2023 that may be closed by this pull request
Comment thread lib/agent0/agent0/hyperdrive/exec/execute_agent_trades.py Outdated
Comment thread lib/agent0/agent0/hyperdrive/exec/execute_agent_trades.py Outdated
Comment thread lib/agent0/agent0/hyperdrive/exec/execute_agent_trades.py Outdated
Comment thread lib/ethpy/ethpy/hyperdrive/api.py Outdated
Comment thread lib/ethpy/ethpy/hyperdrive/api.py Outdated
Comment thread lib/ethpy/ethpy/hyperdrive/interface.py
Comment thread lib/ethpy/ethpy/hyperdrive/api.py
Comment thread lib/ethpy/ethpy/hyperdrive/api.py
Comment thread lib/ethpy/ethpy/hyperdrive/api.py Outdated
@dpaiton dpaiton merged commit ff42980 into main Sep 25, 2023
@dpaiton dpaiton deleted the dpaiton/hyperdrive-api branch September 25, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A feature or refactor request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent0: Fix fixed rate and spot price in the parameter passed into bots

3 participants