Skip to content

Commit

Permalink
Minor documentation fixes and fixing dependencies. Version bump to v0…
Browse files Browse the repository at this point in the history
….26.2 (#1741)

- Fixes to code examples in readme.
- Removing broken link in tutorial. The documentation for output event
types were removed when moving event objects from agent0 to pypechain.
Ideally this would point to documentation within the hyperdrive repo
where events are defined in solidity.
- Only pinning minimum versions in hyperdrivepy and hyperdrivetypes.
- Version bump of agent0 to v0.26.2 in preparation for release.
  • Loading branch information
Sheng Lundquist authored Jan 9, 2025
1 parent edbb7f0 commit 10120b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,17 @@ hyperdrive_agent0 = chain.init_agent(base=FixedPoint(100_000), eth=FixedPoint(10

# Run trades.
chain.advance_time(datetime.timedelta(weeks=1))
open_long_event = hyperdrive_agent0.open_long(base=FixedPoint(100), eth=FixedPoint(10))
open_long_event = hyperdrive_agent0.open_long(base=FixedPoint(100))
chain.advance_time(datetime.timedelta(weeks=5))
close_event = hyperdrive_agent0.close_long(
maturity_time=open_long_event.maturity_time, bonds=open_long_event.bond_amount
maturity_time=open_long_event.args.maturity_time, bonds=open_long_event.args.bond_amount
)

# Analyze.
pool_info = hyperdrive.get_pool_info(coerce_float=True)
pool_info.plot(x="block_number", y="longs_outstanding", kind="line")
trade_ticker = hyperdrive_agent0.get_trade_events()
positions = hyperdrive_agent0.get_positions(show_closed_positions=True)

# Shut down the chain.
chain.cleanup()
Expand All @@ -87,7 +89,7 @@ chain.cleanup()

```python
import os
from agnet0 import Chain, Hyperdrive
from agent0 import Chain, Hyperdrive

# We recommend you use env variables for sensitive information.
PUBLIC_ADDRESS = os.getenv("PUBLIC_ADDRESS")
Expand All @@ -114,7 +116,7 @@ with Chain(RPC_URI) as chain:

```python
import os
from agnet0 import Chain, Hyperdrive
from agent0 import Chain, Hyperdrive

# We recommend you use env variables for sensitive information.
PRIVATE_KEY = os.getenv("PRIVATE_KEY")
Expand Down
3 changes: 1 addition & 2 deletions examples/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
"metadata": {},
"source": [
"The output of these trades represents the corresponding emitted event from Hyperdrive. For example, the open long event\n",
"is shown below. See [here](https://agent0.readthedocs.io/en/latest/autoapi/agent0/core/hyperdrive/interactive/event_types/index.html)\n",
"for documentation on the output event types.\n"
"is shown below.\n"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "agent0"
version = "0.26.1"
version = "0.26.2"
# Authors are the current, primary stewards of the repo
# contributors can be found on github
authors = [
Expand Down Expand Up @@ -32,8 +32,8 @@ dependencies = [
"eth-account>=0.13.3",
"fixedpointmath>=0.2.1",
"hexbytes>=1.2.1",
"hyperdrivepy==0.17.1",
"hyperdrivetypes==1.0.20.13",
"hyperdrivepy>=0.17.1",
"hyperdrivetypes>=1.0.20.13",
"ipython>=8.26.0",
"ipykernel>=6.29.5",
"matplotlib>=3.9.2",
Expand Down

0 comments on commit 10120b6

Please sign in to comment.