diff --git a/hydradx/model/amm/omnipool_amm.py b/hydradx/model/amm/omnipool_amm.py index c629c4a9..f635e884 100644 --- a/hydradx/model/amm/omnipool_amm.py +++ b/hydradx/model/amm/omnipool_amm.py @@ -923,10 +923,6 @@ def execute_add_liquidity( if (state.total_value_locked + quantity * usd_price(state, tkn_add)) > state.tvl_cap: return state.fail_transaction('Transaction rejected because it would exceed the TVL cap.', agent) - if (state.liquidity[tkn_add] + quantity) > 10 ** 12: - # TODO: this may not actually exist as part of the protocol - return state.fail_transaction('Asset liquidity cannot exceed 10 ^ 12.', agent) - # assert quantity > 0, f"delta_R must be positive: {quantity}" if tkn_add not in state.asset_list: for sub_pool in state.sub_pools.values(): diff --git a/hydradx/model/amm/trade_strategies.py b/hydradx/model/amm/trade_strategies.py index 98653888..eba420b0 100644 --- a/hydradx/model/amm/trade_strategies.py +++ b/hydradx/model/amm/trade_strategies.py @@ -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: