mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 14:11:09 +00:00
feat(amm): let LPs choose the LP-token destination account
Add-liquidity minted a fresh LP account every time, fragmenting a position across holdings. The New position form now has an LP-destination selector (the same Input-mode component as the token funding rows): add-liquidity preselects the wallet's existing LP holding so deposits consolidate, while create-pool has none and mints a fresh one. - addLiquidityQuote returns lpDefinitionId (base58) so the form matches holdings - createPool/addLiquidity submit into the chosen holding, else create-fresh - e2e: add-liquidity waits for the preselect; create-pool asserts fresh-account
This commit is contained in:
@@ -1036,7 +1036,8 @@ LogosMap AmmModuleImpl::addLiquidityQuote(const LogosMap& request) {
|
||||
if (!quoteResult.ok)
|
||||
return error(quoteResult.error.empty() ? "backend_error" : quoteResult.error);
|
||||
|
||||
// Success: wrap { amountA, amountB, expectedLp, minimumLp, price }.
|
||||
// Success: wrap { amountA, amountB, expectedLp, minimumLp, price, lpDefinitionId }.
|
||||
// (lpDefinitionId is the pool's LP token so the UI can offer existing LP holdings.)
|
||||
LogosMap out = quoteResult.value;
|
||||
out["status"] = "ok";
|
||||
out["error"] = "";
|
||||
|
||||
Reference in New Issue
Block a user