-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agent refactor #1487
Agent refactor #1487
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1487 +/- ##
==========================================
- Coverage 83.89% 81.35% -2.54%
==========================================
Files 88 97 +9
Lines 5674 6762 +1088
==========================================
+ Hits 4760 5501 +741
- Misses 914 1261 +347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 apool
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 ininit_agent
, or by callingagent.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 aLocalChain
orChain
object.pool
argument for setting an initial active pool.PolicyAgent
has been deprecated in favor of usingLocalAccount
.Hyperdrive
andLocalHyperdrive
toChain
andLocalChain
respectively.get_wallet()
.get_long()
,get_short()
,get_lp()
, andget_withdrawal_shares()
.LocalHyperdrive
now has a flag for deploying on constructor, or attach to existing. This is necessary for the forking workflow.