Skip to content

Commit

Permalink
Fixed bug in Omnipool arbitrager
Browse files Browse the repository at this point in the history
  • Loading branch information
poliwop committed Jul 12, 2023
1 parent acbd1dc commit b11f448
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hydradx/model/amm/trade_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@ def strategy(state: GlobalState, agent_id: str) -> GlobalState:
if delta_Qi > 0:
dr[i] = r[asset] * delta_Qi / (q[asset] + delta_Qi) * (1 - asset_fees[i])
else:
dr[i] = r[asset] * delta_Qi / (q[asset] + delta_Qi) / (1 - lrna_fees[i])
delta_Qi_fee_adj = delta_Qi / (1 - lrna_fees[i])
dr[i] = r[asset] * delta_Qi_fee_adj / (q[asset] + delta_Qi_fee_adj)
profit = sum([dr[i] * prices[i] for i in range(len(prices))])
if profit < 0:
if j > 0:
Expand Down

0 comments on commit b11f448

Please sign in to comment.