fix(liquidity): classify fee retries as pool probes

This commit is contained in:
Ricardo Guilherme Schmidt
2026-07-18 19:56:38 -03:00
parent a8cd820802
commit e3e06ae8a6
2 changed files with 31 additions and 2 deletions
@@ -1432,11 +1432,15 @@ AmmActionCard {
if (root.poolFeeBps > 0 && root.selectedFeeBps !== root.poolFeeBps) {
root.selectedFeeBps = root.poolFeeBps
root.localErrors = []
root.quoteRequested(true, {
var retry = {
"ok": true,
"errors": [],
"request": root.poolProbeRequest(root.pairRequest())
})
}
retry.poolDiscoveryProbe = root.activePool
&& root.amountA.length === 0
&& root.amountB.length === 0
root.quoteRequested(true, retry)
return
}
@@ -473,6 +473,31 @@ TestCase {
compare(form.localErrors.length, 0)
}
function test_feeTierCorrectionKeepsEmptyDraftProbeNonSubmittable() {
var form = createForm()
quoteRequestedSpy.target = form
quoteRequestedSpy.clear()
form.flowState = flowState({
"schema": "new-position.v2",
"status": "error",
"code": "fee_tier_mismatch",
"tokenAId": tokenHigh,
"tokenBId": tokenLow,
"poolStatus": "active_pool",
"poolFeeBps": 5,
"errors": [{
"code": "fee_tier_mismatch",
"details": { "poolFeeBps": 5 }
}]
})
tryCompare(quoteRequestedSpy, "count", 1)
var retry = quoteRequestedSpy.signalArguments[0][1]
compare(retry.request.feeBps, 5)
compare(retry.poolDiscoveryProbe, true)
}
function test_submissionSnapshotCarriesPoolAccountForProbe() {
var form = createForm()
form.flowState = flowState({