Skip to content

Add AMM pool management and compose flows#192

Open
droplister wants to merge 19 commits intomainfrom
lp-asset-balance-pool-actions
Open

Add AMM pool management and compose flows#192
droplister wants to merge 19 commits intomainfrom
lp-asset-balance-pool-actions

Conversation

@droplister
Copy link
Copy Markdown
Member

@droplister droplister commented May 9, 2026

Adds full AMM pool management and compose support for LP assets.

What changed:

  • Add Counterparty pool API helpers for pool list/detail, address LP positions, quotes, compose, and XCP fee estimates.
  • Detect LP asset balances using Core's address pool-position model and show Manage Pool from LP balance views.
  • Add Manage Pools and Pool Position pages with reserves, LP balance, pool share, underlying estimates, and Deposit/Withdraw actions.
  • Add pool deposit and withdrawal compose flows using the existing Composer and ReviewScreen patterns.
  • Use quote-backed previews for pool ratios, estimated withdrawal receive amounts, and slippage-derived hidden minimum fields.
  • Keep outbound compose quantity conversion in the existing normalizeFormData path; read/query display uses Core verbose *_normalized fields.
  • Preserve LP asset display context for pool withdrawal reviews when Core resolves it to pair params.
  • Add tests for pool API helpers, compose endpoints, normalization, pool math, and LP review handling.

Notes:

  • Quote endpoints return raw current-state estimate fields, so the form converts those locally for previews and minimum calculations.
  • Pool list/detail/address queries and compose responses request verbose=true and prefer *_normalized values for display.
  • Fees-earned/PnL is not shown because the current API provides current reserves, LP balances, and quotes, but not a per-position historical basis.

Verification:

  • npm.cmd run compile
  • npx.cmd vitest src/utils/blockchain/counterparty/tests/compose.specialized.test.ts src/utils/blockchain/counterparty/tests/normalize.test.ts src/utils/blockchain/counterparty/tests/pool.test.ts src/utils/blockchain/counterparty/tests/api.test.ts --run

@droplister droplister force-pushed the lp-asset-balance-pool-actions branch from 6cac461 to d14a12c Compare May 9, 2026 03:36
@droplister droplister changed the title Add LP asset pool management entry point Add AMM pool management and compose flows May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant