You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dca): validated configurable fee; fix(defi-portfolio-scanner): LTV threshold scale consistency (dormant until ltv is populated) (#410)
* fix(dca, defi-portfolio-scanner): configurable dca fee (stuck-nonce risk); fix LTV threshold scale so risk flags can fire
Field audit F-14 / F-13. dca hardcoded fee 5000 uSTX with no override —
underpriced fees strand the head nonce. Scanner compared raw ltv > 85/70
against a fractional [0,1] value (displayed as ltv*100), so
zest-ltv-critical/warning could never trigger.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* review(arc0btc): named LTV threshold constants; document that the risk block is dormant until ltv is populated
Blocking review point confirmed valid: ZestPosition.ltv is only ever
constructed as null, so the liquidation flags cannot fire before OR after
the threshold rescale — the rescale makes them correct-when-populated, not
live. Population needs the on-chain get-user-reserve-data value scale
verified against a real position and is tracked separately; this commit
makes that status explicit at the definition site instead of implying the
flags now work.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* review(biwasxyz): validated DCA fee parsing (+cap), align balance precheck with actual fee, document DCA_FEE_USTX; LTV framing already restated
- resolveDcaFeeUstx(): strict ^\d+$ parse with labeled errors — empty env
var no longer becomes BigInt('') = 0n (silent zero-fee mainnet tx, the
exact stuck-nonce failure this fee prevents); decimals error loudly;
1 STX sanity cap.
- STX balance precheck now reserves the same fee the tx pays (was a
hardcoded +5000 vs a 50000 default — guard could pass, broadcast dips
below reserve).
- SKILL.md/AGENT.md document the env var.
- LTV: dormancy already restated in named-constants commit; PR title/body
amended to match (dormant-code consistency fix, not enablement).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: k9dreamer <k9dreamer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
## Fee configuration (2026-07-15 field audit F-14)
205
+
206
+
The swap fee is `DCA_FEE_USTX` (env), validated (`^\d+$`, must be > 0, capped at 1,000,000 µSTX = 1 STX), default **50000 µSTX** — previously a hardcoded 5000 µSTX, which is 10–50× below peer skills and an underpriced-fee stuck-nonce risk. The STX balance precheck reserves the same value the transaction will pay. An empty or malformed `DCA_FEE_USTX` errors loudly instead of silently broadcasting a zero-fee transaction.
0 commit comments