Skip to content

Commit

Permalink
corrected back_and_forth trade strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
jepidoptera committed Jul 12, 2023
1 parent 2d70410 commit 0db222f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hydradx/model/amm/trade_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ def back_and_forth(
def strategy(state: GlobalState, agent_id: str):
omnipool: OmnipoolState = state.pools[pool_id]
agent: Agent = state.agents[agent_id]
for i in range(len(agent.asset_list)):
asset = omnipool.asset_list[i]
assets = list(set(agent.asset_list) & set(omnipool.asset_list))
for asset in assets:
# asset = agent.asset_list[i]
dr = percentage / 2 * omnipool.liquidity[asset]
lrna_init = state.agents[agent_id].holdings['LRNA']
oamm.execute_swap(omnipool, agent, tkn_sell=asset, tkn_buy='LRNA', sell_quantity=dr, modify_imbalance=False)
Expand Down

0 comments on commit 0db222f

Please sign in to comment.