@continuumdao/ctm-mpc-defi 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -164,6 +164,7 @@ MCP uses **classic ERC-20 approve** batches (Permit2 disabled), matching swaps.
164
164
 
165
165
  | Action | Prep tool | Build multisign |
166
166
  |--------|-----------|-----------------|
167
+ | List standard pools | `ctm_uniswap_v4_list_lp_pools` | — |
167
168
  | Mint new position | `ctm_uniswap_v4_lp_create_position` | `ctm_uniswap_v4_build_mint_liquidity_multisign` |
168
169
  | Increase | `ctm_uniswap_v4_lp_increase` | `ctm_uniswap_v4_build_increase_liquidity_multisign` |
169
170
  | Decrease | `ctm_uniswap_v4_lp_decrease` | `ctm_uniswap_v4_build_decrease_liquidity_multisign` |
@@ -172,9 +173,16 @@ MCP uses **classic ERC-20 approve** batches (Permit2 disabled), matching swaps.
172
173
  | Register position NFT | `ctm_uniswap_v4_register_position_nft` | — (management-signed) |
173
174
  | Register from mint tx | `ctm_uniswap_v4_register_position_from_mint_tx` | — (after mint execute) |
174
175
 
176
+ ### Standard pools (no manual pool id hunt)
177
+
178
+ 1. `ctm_uniswap_v4_list_lp_pools` with `chainId` (optional `pair` filter, e.g. `eth-usdc`).
179
+ 2. Pick a row — use `presetId` as `poolPreset` on `ctm_uniswap_v4_lp_create_position`, or copy `existingPool` fields (`token0Address`, `token1Address`, `poolReference`).
180
+ 3. `poolReference` is the V4 **bytes32 pool id**, derived from token addresses + `fee` + `tickSpacing` + `hooks` (no-hook pools use `0x0`).
181
+ 4. If LP create fails, the pool may not be initialized on-chain — try another preset, pass a custom `poolReference`, or use `newPool`.
182
+
175
183
  ### Mint workflow
176
184
 
177
- 1. Resolve pool (`existingPool` with `poolReference` = V4 pool id, or `newPool` to initialize).
185
+ 1. Resolve pool: `poolPreset` from list tool, `existingPool` (`poolReference` or `fee`+`tickSpacing` to derive id), or `newPool` to initialize.
178
186
  2. Set price range via `priceBounds` (human prices) or `tickBounds`.
179
187
  3. `independentToken`: one token + amount in base units; API computes the other.
180
188
  4. `ctm_uniswap_v4_lp_create_position` → full JSON with `create` tx + `token0`/`token1` amounts.
package/dist/index.cjs CHANGED
@@ -1336,6 +1336,7 @@ async function buildEvmMultisignBodyUniswapV4SkipPermit2Batch(args) {
1336
1336
  }
1337
1337
  });
1338
1338
  }
1339
+ var UNISWAP_V4_LP_POOL_LOOKUP_HINT = "Pool may not be initialized on this chain. Call ctm_uniswap_v4_list_lp_pools for other presets, pass a custom existingPool.poolReference, or use newPool to initialize a pool.";
1339
1340
 
1340
1341
  // src/protocols/evm/uniswap-v4/liquidityApi.ts
1341
1342
  var LP_HEADERS_BASE = {
@@ -1400,9 +1401,9 @@ async function postUniswapLpApi(args) {
1400
1401
  });
1401
1402
  const text = await res.text();
1402
1403
  if (!res.ok) {
1403
- throw new Error(
1404
- `Uniswap LP POST /${args.path} failed: ${messageFromUniswapHttpResponseBody(text, res.status, res.statusText)}`
1405
- );
1404
+ const base2 = messageFromUniswapHttpResponseBody(text, res.status, res.statusText);
1405
+ const hint = args.path === "create" && args.body.existingPool ? ` ${UNISWAP_V4_LP_POOL_LOOKUP_HINT}` : "";
1406
+ throw new Error(`Uniswap LP POST /${args.path} failed: ${base2}${hint}`);
1406
1407
  }
1407
1408
  return JSON.parse(text);
1408
1409
  }