Encoded per-whole-from rates floor to 0 on XECX→FIRMA (1 XECX is less than 1 FIRMA atom), so priceImpactPct compared two zeros and Cashtab showed Impact: 0.00% on a ~0.6% constant-product move. Compute the percent from fill and reserve atoms instead. Templates, AMM discovery quotes, and Telegram settle messages all share the helper. Pricing and settle validation are unchanged.
Details
Details
- Reviewers
Fabien - Group Reviewers
Restricted Project - Commits
- rABC9a004a151ed7: [alp-dex] Compute price impact from reserve atoms
- cd apps/alp-dex && npm test
- Quote XECX→FIRMA at a size around 0.6% of FIRMA inventory; template priceImpactPct is ~0.6 (not 0)
- Cashtab AlpSwap Impact line matches that percent
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Build Bitcoin ABC Diffs / Diff Testing (ai-review) passed.
CodeRabbit Review
Diff : committed changes only
Compare : HEAD → master
Directory : work
────────────────────────────────────────
(\(\
(• .•) I void warranties and segfaults.
────────────────────────────────────────
Review complete
No findings ✔
5 files reviewed:
- apps/alp-dex/src/pricing/templates.ts
- apps/alp-dex/src/routes/quotes.ts
- apps/alp-dex/src/routes/settle.ts
- apps/alp-dex/test/pricing.test.ts
- apps/alp-dex/test/quotes.test.ts
────────────────────────────────────────
| apps/alp-dex/src/pricing/templates.ts | ||
|---|---|---|
| 82–86 ↗ | (On Diff #61228) | |