File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -654,7 +654,7 @@ def _lrna_swap(
654654 denom = (self .liquidity [tkn ] * (1 - asset_fee ) - delta_ra )
655655 delta_qa = - self .lrna [tkn ] * delta_ra / denom
656656 if "LRNA" not in agent .holdings or delta_qa + agent .holdings ["LRNA" ] < 0 :
657- return self .fail_transaction ('Agent has insufficient LRNA' , agent )
657+ return self .fail_transaction ('Agent has insufficient LRNA' )
658658 delta_qm = - asset_fee * (1 - asset_fee ) * (self .liquidity [tkn ] / denom ) * delta_qa * self .lrna_mint_pct
659659 delta_q = - delta_qa + delta_qm
660660
Original file line number Diff line number Diff line change @@ -922,7 +922,7 @@ def _find_solution_unrounded(
922922 if approx == "linear" : # linearize the AMM constraint
923923 if tkn not in omnipool_directions :
924924 c1 = 1 / (1 + epsilon_tkn [tkn ])
925- c2 = 1 / (1 - epsilon_tkn [tkn ])
925+ c2 = 1 / (1 - epsilon_tkn [tkn ]) if epsilon_tkn [ tkn ] < 1 else 1e15
926926 A4i = np .zeros ((2 , k ))
927927 b4i = np .zeros (2 )
928928 A4i [0 , i ] = - omnipool_lrna_coefs [tkn ]
@@ -933,7 +933,7 @@ def _find_solution_unrounded(
933933 cone_sizes4 .append (2 )
934934 else :
935935 if omnipool_directions [tkn ] == "sell" :
936- c = 1 / (1 - epsilon_tkn [tkn ])
936+ c = 1 / (1 - epsilon_tkn [tkn ]) if epsilon_tkn [ tkn ] < 1 else 1e15
937937 else :
938938 c = 1 / (1 + epsilon_tkn [tkn ])
939939 A4i = np .zeros ((1 , k ))
You can’t perform that action at this time.
0 commit comments