Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading