agent0.core.hyperdrive.policies.deterministic

Deterministically trade things.

Classes

Deterministic

Deterministic trading for testing and other purposes.

Module Contents

class agent0.core.hyperdrive.policies.deterministic.Deterministic(policy_config: Config)

Bases: agent0.core.hyperdrive.policies.hyperdrive_policy.HyperdriveBasePolicy

Deterministic trading for testing and other purposes.

classmethod description() str

Describe the policy in a user friendly manner that allows newcomers to decide whether to use it.

Returns:

The description of the policy, as described above.

Return type:

str

class Config

Bases: agent0.core.hyperdrive.policies.hyperdrive_policy.HyperdriveBasePolicy.Config

Custom config arguments for this policy.

trade_list: list[tuple[str, int]]
A list of tuples formatted as follows:
  • (<trade_type>, <amount>)

Allowed trade types are “open_long”, “close_long”, “open_short”, “close_short”.

starting_length
action(interface: agent0.ethpy.hyperdrive.HyperdriveReadInterface, wallet: agent0.core.hyperdrive.agent.HyperdriveWallet) tuple[list[agent0.core.base.Trade[agent0.core.hyperdrive.agent.HyperdriveMarketAction]], bool]

Specify actions.

Parameters:
Returns:

A tuple where the first element is a list of actions, and the second element defines if the agent is done trading.

Return type:

tuple[list[MarketAction], bool]