agent0.core.hyperdrive.policies.lpandarb_test

Test the ability of bots to hit a target rate.

Attributes

TRADE_AMOUNTS

PRECISION

YEAR_IN_SECONDS

Functions

interactive_hyperdrive(...)

Create interactive hyperdrive.

arbitrage_andy(...)

Create Arbitrage Andy interactive hyperdrive agent used to arbitrage the fixed rate to the variable rate.

create_arbitrage_andy(...)

Create Arbitrage Andy interactive hyperdrive agent used to arbitrage the fixed rate to the variable rate.

manual_agent(...)

Create manual interactive hyperdrive agent used to manually move markets.

test_open_long(interactive_hyperdrive, trade_amount, ...)

Open a long to hit the target rate.

test_open_short(interactive_hyperdrive, trade_amount, ...)

Open a short to hit the target rate.

test_close_long(interactive_hyperdrive, trade_amount, ...)

Close a long to hit the target rate.

test_already_at_target(interactive_hyperdrive, ...)

Already at target, do nothing.

test_reduce_long(interactive_hyperdrive, arbitrage_andy)

Reduce a long position.

test_reduce_short(interactive_hyperdrive, arbitrage_andy)

Reduce a short position.

test_safe_long_trading(interactive_hyperdrive, ...)

Test that the agent doesn't overextend itself.

test_safe_short_trading(interactive_hyperdrive, ...)

Test that the agent doesn't overextend itself.

test_matured_long(interactive_hyperdrive, arbitrage_andy)

Don't touch the matured long.

test_matured_short(interactive_hyperdrive, arbitrage_andy)

Don't touch the matured short.

Module Contents

agent0.core.hyperdrive.policies.lpandarb_test.TRADE_AMOUNTS = [0.003, 10000000.0]
agent0.core.hyperdrive.policies.lpandarb_test.PRECISION
agent0.core.hyperdrive.policies.lpandarb_test.YEAR_IN_SECONDS = 31536000
agent0.core.hyperdrive.policies.lpandarb_test.interactive_hyperdrive(fast_chain_fixture: agent0.core.hyperdrive.interactive.LocalChain) agent0.core.hyperdrive.interactive.LocalHyperdrive

Create interactive hyperdrive.

Parameters:

fast_chain_fixture (LocalChain) – Local chain fixture.

Returns:

Interactive hyperdrive.

Return type:

InteractiveHyperdrive

agent0.core.hyperdrive.policies.lpandarb_test.arbitrage_andy(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive) agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent

Create Arbitrage Andy interactive hyperdrive agent used to arbitrage the fixed rate to the variable rate.

Parameters:

interactive_hyperdrive (InteractiveHyperdrive) – Interactive hyperdrive.

Returns:

Arbitrage Andy interactive hyperdrive agent.

Return type:

InteractiveHyperdriveAgent

agent0.core.hyperdrive.policies.lpandarb_test.create_arbitrage_andy(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive) agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent

Create Arbitrage Andy interactive hyperdrive agent used to arbitrage the fixed rate to the variable rate.

Parameters:

interactive_hyperdrive (InteractiveHyperdrive) – Interactive hyperdrive.

Returns:

Arbitrage Andy interactive hyperdrive agent.

Return type:

InteractiveHyperdriveAgent

agent0.core.hyperdrive.policies.lpandarb_test.manual_agent(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive) agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent

Create manual interactive hyperdrive agent used to manually move markets.

Parameters:

interactive_hyperdrive (InteractiveHyperdrive) – Interactive hyperdrive.

Returns:

Manual interactive hyperdrive agent.

Return type:

InteractiveHyperdriveAgent

agent0.core.hyperdrive.policies.lpandarb_test.test_open_long(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, trade_amount: float, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, manual_agent: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Open a long to hit the target rate.

agent0.core.hyperdrive.policies.lpandarb_test.test_open_short(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, trade_amount: float, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, manual_agent: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Open a short to hit the target rate.

agent0.core.hyperdrive.policies.lpandarb_test.test_close_long(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, trade_amount: float, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent, manual_agent: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Close a long to hit the target rate.

agent0.core.hyperdrive.policies.lpandarb_test.test_already_at_target(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Already at target, do nothing.

agent0.core.hyperdrive.policies.lpandarb_test.test_reduce_long(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Reduce a long position.

agent0.core.hyperdrive.policies.lpandarb_test.test_reduce_short(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Reduce a short position.

agent0.core.hyperdrive.policies.lpandarb_test.test_safe_long_trading(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, manual_agent: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Test that the agent doesn’t overextend itself.

agent0.core.hyperdrive.policies.lpandarb_test.test_safe_short_trading(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, manual_agent: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Test that the agent doesn’t overextend itself.

agent0.core.hyperdrive.policies.lpandarb_test.test_matured_long(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Don’t touch the matured long.

agent0.core.hyperdrive.policies.lpandarb_test.test_matured_short(interactive_hyperdrive: agent0.core.hyperdrive.interactive.LocalHyperdrive, arbitrage_andy: agent0.core.hyperdrive.interactive.local_hyperdrive_agent.LocalHyperdriveAgent)

Don’t touch the matured short.