agent0.core.base
The agent0 base module exports some types here.
Submodules
Attributes
Classes
Market action specification |
|
Stateful variable for storing what is in the agent's wallet. |
|
Config object with frozen attributes. |
|
A type of market. |
|
An amount with a unit. |
|
A type of token. |
|
A trade for a market. |
Package Contents
- class agent0.core.base.BaseMarketAction
Bases:
Generic[T]Market action specification
- action_type: T
- class agent0.core.base.EthWallet
Stateful variable for storing what is in the agent’s wallet.
- address: hexbytes.HexBytes
The associated agent’s eth address.
- balance: agent0.core.base.types.Quantity
The base assets that held by the trader.
- check_valid_wallet_state(dictionary: dict | None = None) None
Test that all wallet state variables are greater than zero.
- Parameters:
dictionary (dict | None, optional) – The dictionary to check. If not provided, it will use self.__dict__.
- agent0.core.base.WEI
- class agent0.core.base.Freezable
Config object with frozen attributes.
- freeze() None
Disallows changing existing members.
- disable_new_attribs() None
Disallows adding new members.
- astype(new_type)
Cast all member attributes to a new type.
- Parameters:
new_type (Any) – The type to cast to.
- property dtypes: dict[str, type]
Return a dict listing name & type of each member variable.
- Returns:
The named types of the class.
- Return type:
dict[str, type]
- class agent0.core.base.MarketType
Bases:
enum.EnumA type of market.
- HYPERDRIVE = 'hyperdrive'
- BORROW = 'borrow'
- class agent0.core.base.Trade
Bases:
Generic[MarketAction]A trade for a market.
- market_type: MarketType
- market_action: MarketAction