agent0.core.hyperdrive.interactive.local_hyperdrive_test
Tests interactive hyperdrive end to end.
Attributes
Functions
|
Deploy 2 pools, 3 agents, and test funding and each trade type. |
|
|
|
Ensure block timestamp interval is set correctly. |
|
Advance time by 3600 seconds then 1 week. |
|
Checkpoint creation with advance time. |
|
Save and load snapshot. |
|
Set the variable rate. |
|
Tests building of dashboard dataframes. |
|
Access the deployer account. |
|
Remove liquidity from the deployer account. |
|
Remove liquidity from the deployer account. |
|
Get pool config before executing any transactions. |
|
Get pool config after executing one transaction. |
|
Test liquidation. |
|
Test random liquidation. |
|
Share price when compounding by quincunx (one fifth of a year) should increase by more than the APR. |
|
Share price when compounding by annus (one year) should increase by exactly the APR (no compounding). |
|
The policy config is not passed in. |
|
The policy config has rng set to None. |
|
|
|
Tests proper saving/loading of policy state during snapshotting. |
The policy config has rng set to None. |
|
|
|
Deploy with nonstandard timestretch parameters. |
|
Tests lazy calc pnl values. |
|
Tests forking a chain. |
|
Tests backfilling data from a forked chain. |
|
Tests backfilling data from a forked chain. |
|
|
Tests dumping anvil state. |
|
Test to catch custom error when fees > close long proceeds. |
Module Contents
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.YEAR_IN_SECONDS = 31536000
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_funding_and_trades(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain, deploy_type: agent0.core.hyperdrive.interactive.local_hyperdrive.LocalHyperdrive.DeployType)
Deploy 2 pools, 3 agents, and test funding and each trade type.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_no_loss_in_precision()
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_bot_to_db(fast_hyperdrive_fixture: agent0.core.hyperdrive.interactive.local_hyperdrive.LocalHyperdrive, cycle_trade_policy: Type[agent0.core.test_utils.CycleTradesPolicy])
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_block_timestamp_interval(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Ensure block timestamp interval is set correctly.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_advance_time(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Advance time by 3600 seconds then 1 week.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_advance_time_with_checkpoints(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Checkpoint creation with advance time.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_save_load_snapshot(chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Save and load snapshot.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_set_variable_rate(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Set the variable rate.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_dashboard_dfs(fast_hyperdrive_fixture: agent0.core.hyperdrive.interactive.local_hyperdrive.LocalHyperdrive)
Tests building of dashboard dataframes.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_access_deployer_account(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Access the deployer account.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_access_deployer_liquidity(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Remove liquidity from the deployer account.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_remove_deployer_liquidity(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Remove liquidity from the deployer account.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_get_config_no_transactions(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Get pool config before executing any transactions.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_get_config_with_transactions(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Get pool config after executing one transaction.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_liquidate(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Test liquidation.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_random_liquidate(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Test random liquidation.
Share price when compounding by quincunx (one fifth of a year) should increase by more than the APR.
Share price when compounding by annus (one year) should increase by exactly the APR (no compounding).
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_policy_config_forgotten(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
The policy config is not passed in.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_policy_config_none_rng(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
The policy config has rng set to None.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_pool_creation_after_snapshot(chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_snapshot_policy_state(chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Tests proper saving/loading of policy state during snapshotting.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_load_rng_on_snapshot()
The policy config has rng set to None.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_hyperdrive_read_interface_standardized_variable_rate(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_deploy_nonstandard_timestretch(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain, time_stretch: float)
Deploy with nonstandard timestretch parameters.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_lazy_calc_pnl()
Tests lazy calc pnl values.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_fork()
Tests forking a chain.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_fork_backfill()
Tests backfilling data from a forked chain.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_fork_backfill_sample()
Tests backfilling data from a forked chain.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_anvil_dump_state(capsys)
Tests dumping anvil state.
capsys is a pytest fixture that captures output, which we need to get the crash report file.
- agent0.core.hyperdrive.interactive.local_hyperdrive_test.test_close_long_too_much_fees(fast_chain_fixture: agent0.core.hyperdrive.interactive.local_chain.LocalChain)
Test to catch custom error when fees > close long proceeds.