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
- Branch
- alp-dex-price-impact
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 38094 Build 75606: Build Diff ai-review · alp-dex-tests Build 75605: arc lint + arc unit
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 | ||