Skip to content

Commit 8bd2c59

Browse files
fix: replace STE gate on fees check with hard check
The fees_gate STE was unnecessary — gamma (1 - fees) is either a static config value or a learnable param constrained to be nonzero, so the fee/zero-fee branch selection never benefits from soft gradients.
1 parent 1b9d1eb commit 8bd2c59

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

quantammsim/pools/reCLAMM/reclamm_reserves.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -987,10 +987,8 @@ def _skip_schedule_state(_):
987987
0,
988988
)
989989

990-
fees_gate = _ste_greater_than(
991-
jnp.abs(gamma - 1.0), jnp.asarray(1e-12, dtype=gamma.dtype), ste_temperature
992-
)
993-
optimal_arb_trade = _ste_select(fees_gate, fee_trade, zero_fee_trade)
990+
fees_are_being_charged = gamma != 1.0
991+
optimal_arb_trade = jnp.where(fees_are_being_charged, fee_trade, zero_fee_trade)
994992

995993
# Check profitability for arb
996994
profit_to_arb = -(optimal_arb_trade * prices).sum() - arb_thresh

0 commit comments

Comments
 (0)