agent0.core.hyperdrive.agent.hyperdrive_wallet

Empty accounts for engaging with smart contracts.

Classes

Long

An open long position.

Short

An open short position.

HyperdriveWallet

Stateful variable for storing what is in the agent's wallet.

Module Contents

class agent0.core.hyperdrive.agent.hyperdrive_wallet.Long

An open long position.

balance: fixedpointmath.FixedPoint

The amount of bonds that the position is long.

maturity_time: int

The maturity time of the long.

class agent0.core.hyperdrive.agent.hyperdrive_wallet.Short

An open short position.

balance: fixedpointmath.FixedPoint

The amount of bonds that the position is short.

maturity_time: int

The maturity time of the short.

class agent0.core.hyperdrive.agent.hyperdrive_wallet.HyperdriveWallet

Bases: agent0.core.base.EthWallet

Stateful variable for storing what is in the agent’s wallet.

lp_tokens: fixedpointmath.FixedPoint

The LP tokens held by the trader.

withdraw_shares: fixedpointmath.FixedPoint

The amount of unclaimed withdraw shares held by the agent.

longs: dict[int, Long]

The long positions held by the trader. The dictionary is keyed by the maturity time in seconds.

shorts: dict[int, Short]

The short positions held by the trader. The dictionary is keyed by the maturity time in seconds.

copy() HyperdriveWallet

Return a new copy of self.

Returns:

A deep copy of the wallet.

Return type:

HyperdriveWallet