Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR is the 3rd PR in a series of PRs for agent0 to support multiple pools. The agent classes in agent0 is reworked in this PR. Here, the main changes include `init_agent` being a function of the chain as opposed to the pool. Additionally, many functions now take a `pool` argument to specify what pool the agent is making a trade on. There are helper functions for setting an active pool to avoid passing this argument in various functions, by calling it either in `init_agent`, or by calling `agent.set_active(pool=...)`. Additionally, the policy is now untied from the agent, such that an agent can hot-swap policies on the fly by calling the `agent.set_active(policy=...)` function. - `init_agent` is now a function of a `LocalChain` or `Chain` object. - This function now takes an optional `pool` argument for setting an initial active pool. - Many functions now require an active pool to be set, or an explicit pool to be passed in as an argument. - `PolicyAgent` has been deprecated in favor of using `LocalAccount`. - Moving many logging and bookkeeping configs from `Hyperdrive` and `LocalHyperdrive` to `Chain` and `LocalChain` respectively. - No longer keeping track of wallet deltas, we get the wallet wrt a pool via `get_wallet()`. - Adding helper functions for `get_long()`, `get_short()`, `get_lp()`, and `get_withdrawal_shares()`. - `LocalHyperdrive` now has a flag for deploying on constructor, or attach to existing. This is necessary for the forking workflow. - Added tests for unit and system fuzzing.
- Loading branch information