@anywalletkit/protocol-swap2-curve 0.1.3 → 0.1.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.
- package/dist/{chunk-JCWXGKPJ.js → chunk-7AXQMAHJ.js} +2 -2
- package/dist/{chunk-IFREGXMV.js → chunk-NW2OLRIK.js} +127 -105
- package/dist/chunk-NW2OLRIK.js.map +1 -0
- package/dist/index.cjs +126 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/protocol.cjs +119 -99
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.js +2 -2
- package/dist/provider.cjs +119 -99
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-IFREGXMV.js.map +0 -1
- /package/dist/{chunk-JCWXGKPJ.js.map → chunk-7AXQMAHJ.js.map} +0 -0
package/dist/provider.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/provider.ts","../src/abi.ts","../src/deployments.ts","../src/activity.ts","../src/pools/1.ts","../src/pools/10.ts","../src/pools/100.ts","../src/pools/143.ts","../src/pools/196.ts","../src/pools/8453.ts","../src/pools/9745.ts","../src/pools/42161.ts","../src/pools/index.ts","../src/routes.ts","../src/rpc.ts","../src/slippage.ts","../src/intent.ts","../src/verify.ts"],"sourcesContent":["import {getAddress} from \"viem\";\nimport {evmRef, isEvm, sourceAssetOf} from \"@anywalletkit/protocol-swap2-core/util\";\nimport type {Asset, CrossChainProvider, IntentRef, IntentStatus, Quote, QuoteParams, UnsignedTx} from \"@anywalletkit/protocol-swap2-core/types\";\nimport {encodeExchange, encodeGetDy} from \"./abi.js\";\nimport {describeCurveActivity} from \"./activity.js\";\nimport {CURVE_DEPLOYMENTS, deploymentOf, type CurveDeployment} from \"./deployments.js\";\nimport {CURVE_POOLS} from \"./pools/index.js\";\nimport type {CurveChainPools} from \"./pools/types.js\";\nimport {findRoutes, routeArgs, routePools, type CurveRoute} from \"./routes.js\";\nimport {ethCall, wordUint} from \"./rpc.js\";\nimport {curveAutoSlippageBps, curveImpactBps} from \"./slippage.js\";\nimport {curveIntentChain, mintCurveIntentId} from \"./intent.js\";\nimport {curveOnChain, curveQuoteCheck} from \"./verify.js\";\n\n/**\n * Curve, straight from the contracts — Router NG on every chain in `CURVE_DEPLOYMENTS`.\n *\n * Quote: candidate routes of one or two pools from the curated allowlist the package pins (plus the router's\n * wrap hop through the pinned wrapped native, and on Ethereum's v1.2 router the crvUSD ↔ scrvUSD ERC-4626 hop),\n * each priced with the router's own `get_dy` in JSON-RPC batches; the best output wins. Execution: the\n * explicit-receiver `exchange(route, params, amount, min_dy, [pools,] receiver)` — the router pays only the\n * recipient and reverts under `min_dy`, which is never 0. No API, no key, no fee.\n *\n * Router NG has no deadline: the quote's lifetime (`quoteTtlMs`) is enforced by the engine, and right before\n * broadcast `preflightDeposit` re-checks the sealed call byte for byte, each hop pool's code and coins and a fresh\n * `get_dy` of the exact route against the minimum (the router's code hash and version are checked once per chain per\n * process: the router is immutable). ERC-20 sources approve exactly the input to the\n * pinned router (`approvalAddress`); the engine handles that leg (and a USDT-style reset to 0 first).\n */\n\n/** Long enough for an approval to be mined on Ethereum; the router has no deadline of its own. */\nconst DEFAULT_TTL_MS = 180_000;\n\nexport interface CurveProviderConfig {\n enabled?: boolean;\n /** JSON-RPC endpoints per EVM chain id, tried in order. A chain without one is not offered. */\n rpcUrls: Readonly<Record<number, readonly string[]>>;\n /**\n * Slippage when the caller names none (bps). Default: `suggestSlippage` from swap2-core for the pair and the\n * route's price impact (stable ↔ stable 10 bps, majors 50, others 100, plus half the impact).\n */\n defaultSlippageBps?: number;\n /** Local quote lifetime. Router NG has no deadline, so this is the only expiry. Default 3 min. */\n quoteTtlMs?: number;\n /** Override the deployments (tests, new chains). Still verified on-chain before use. */\n deployments?: Readonly<Record<number, CurveDeployment>>;\n /** Override the pool allowlist (tests). */\n pools?: Readonly<Record<number, CurveChainPools>>;\n /** Told when a chain's AddressProvider lists another router than the pinned one (never acted on). Default console.warn. */\n onWarning?: (message: string) => void;\n}\n\nexport function curveProvider(config: CurveProviderConfig): CrossChainProvider {\n const deployments = config.deployments ?? CURVE_DEPLOYMENTS;\n const pools = config.pools ?? CURVE_POOLS;\n const ttl = config.quoteTtlMs ?? DEFAULT_TTL_MS;\n const fixedSlippage = config.defaultSlippageBps;\n if (fixedSlippage !== undefined && (!Number.isInteger(fixedSlippage) || fixedSlippage <= 0 || fixedSlippage >= 5_000)) throw new Error(\"curve: defaultSlippageBps must be 1..4999\");\n const chain = curveOnChain({rpcUrls: config.rpcUrls, deployments, pools, ...(config.onWarning ? {onWarning: config.onWarning} : {})});\n const rpc = chain.rpc;\n const selfCheck = curveQuoteCheck({deployments, pools});\n const tableOf = (chainId: number) => (Object.prototype.hasOwnProperty.call(pools, chainId) ? pools[chainId] : undefined);\n\n const chainIdOf = (caip2: string): number | null => {\n if (!isEvm(caip2)) return null;\n const id = evmRef(caip2);\n return deploymentOf(deployments, id) && config.rpcUrls[id]?.length && tableOf(id)?.pools.length ? id : null;\n };\n\n /** get_dy of each route at `amount` (null where the router reverts). */\n async function price(chainId: number, d: CurveDeployment, routes: readonly CurveRoute[], amount: bigint, signal?: AbortSignal): Promise<(bigint | null)[]> {\n const raw = await rpc(chainId, routes.map((r) => ethCall(d.router, encodeGetDy(d.family, routeArgs(d.family, r), amount))), signal);\n return raw.map(wordUint);\n }\n\n return {\n name: \"curve\",\n describeActivity: (tx, ctx) => describeCurveActivity(tx, ctx, deployments),\n supportsSameChain: true,\n enabled: () => config.enabled ?? true,\n supportsChain: (caip2: string) => chainIdOf(caip2) !== null,\n supportsChainPair: (from: string, to: string) => from === to && chainIdOf(from) !== null,\n supportsRoute(from: Asset, to: Asset): boolean {\n return from.chain === to.chain && chainIdOf(from.chain) !== null;\n },\n\n async getQuote(params: QuoteParams, signal?: AbortSignal): Promise<Quote | null> {\n const refuse = (why: string): null => {\n params.onRefusal?.(`curve: ${why}`);\n return null;\n };\n if (params.flex) return refuse(\"amount-flexible deposits are not supported\");\n if (params.sourceChain !== params.destChain) return refuse(\"same-chain swaps only\");\n const chainId = chainIdOf(params.sourceChain);\n if (chainId === null) return refuse(`no Curve router, pool allowlist or RPC for ${params.sourceChain}`);\n const d = deploymentOf(deployments, chainId)!;\n const src = sourceAssetOf(params);\n if (!src) return refuse(`unknown source token ${params.sourceToken}`);\n const nativeIn = !src.contract;\n const nativeOut = /^0x0+$/.test(params.destToken);\n if (!nativeOut && !/^0x[0-9a-fA-F]{40}$/.test(params.destToken)) return refuse(\"destination token must be an EVM address\");\n if (!/^0x[0-9a-fA-F]{40}$/.test(params.destAddress)) return refuse(\"recipient must be an EVM address\");\n let amountIn: bigint;\n try {\n amountIn = BigInt(params.amountIn);\n } catch {\n return refuse(\"amount is not an integer\");\n }\n if (amountIn <= 0n) return refuse(\"amount must be positive\");\n if (params.slippageBps !== undefined && (!Number.isInteger(params.slippageBps) || params.slippageBps < 0 || params.slippageBps >= 10_000)) return refuse(\"slippage must be 0..9999 bps\");\n if (!nativeIn && src.contract!.toLowerCase() === d.eth.toLowerCase()) return refuse(\"the native coin is named by the catalog, not by the router's 0xEeee sentinel\");\n if (!nativeOut && params.destToken.toLowerCase() === d.eth.toLowerCase()) return refuse(\"name a native output with the zero address, not the router's 0xEeee sentinel\");\n const tokenIn = getAddress(nativeIn ? d.eth : src.contract!);\n const tokenOut = getAddress(nativeOut ? d.eth : params.destToken);\n if (tokenIn === tokenOut) return refuse(\"same token in and out\");\n const wrapPair = [getAddress(d.eth), getAddress(d.weth)];\n if (wrapPair.includes(tokenIn) && wrapPair.includes(tokenOut)) return refuse(\"that is a wrap/unwrap, not a swap\");\n\n try {\n await chain.verifyDeployment(chainId);\n const {routes, truncated} = findRoutes(chainId, d, tableOf(chainId), tokenIn, tokenOut);\n if (!routes.length) return refuse(\"no allowlisted Curve pool route for this pair\");\n const outs = await price(chainId, d, routes, amountIn, signal);\n let best: {route: CurveRoute; out: bigint} | null = null;\n outs.forEach((out, i) => {\n if (out !== null && out > 0n && (!best || out > best.out)) best = {route: routes[i]!, out};\n });\n if (!best) return refuse(\"no allowlisted Curve pool quotes this pair and amount\");\n const {route, out} = best as {route: CurveRoute; out: bigint};\n\n // Price impact: a probe 1/1000 the size on the same route gives the marginal rate; the full-size rate's\n // shortfall against it is the impact (pool fees are paid on both sides and cancel). Informational.\n let priceImpactBps: number | undefined;\n const probeIn = amountIn / 1000n;\n if (probeIn > 0n) {\n try {\n const [probeOut] = await price(chainId, d, [route], probeIn, signal);\n priceImpactBps = curveImpactBps(amountIn, out, probeOut);\n } catch {\n /* the quote stands; impact is information, not a gate */\n }\n }\n\n const bps = params.slippageBps ?? fixedSlippage ?? curveAutoSlippageBps(params, priceImpactBps);\n const minOut = (out * BigInt(10_000 - bps)) / 10_000n;\n if (minOut <= 0n) return refuse(\"the minimum rounds to zero for this amount\");\n if (params.minAmountOut !== undefined && minOut < BigInt(params.minAmountOut)) {\n return refuse(`floor breach (min=${minOut} < floor=${params.minAmountOut})`);\n }\n const args = routeArgs(d.family, route);\n const recipient = getAddress(params.destAddress);\n const data = encodeExchange(d.family, args, amountIn, minOut, recipient);\n // No gas limit: get_dy measures no gas, and a per-step formula was wrong both ways. Run at its limit\n // (eth_call, 2026-11-05) the swap ran out of gas — crvUSD → scrvUSD on Ethereum needs 180 778 (formula\n // 180 000: the vault's deposit), every Monad route 345–352k for one stable-ng pool (formula 300 000) — while a\n // limit with room for the dearest pool overcharges where the limit is what is paid (Monad). The wallet\n // estimates the exact call with headroom right before broadcast, after any approval (as for Uniswap without\n // a quoter figure, THORChain and Chainflip).\n const quote: Quote = {\n provider: \"curve\",\n // One id per quote: a remote stub keys the request a build is checked against by it.\n intentId: mintCurveIntentId(chainId),\n depositAddress: \"\",\n depositMemo: null,\n txRequest: {\n to: d.router,\n data,\n value: nativeIn ? amountIn.toString() : \"0\",\n chainId,\n ...(nativeIn ? {} : {approvalAddress: d.router}),\n },\n sourceAmount: amountIn.toString(),\n destAmount: out.toString(),\n minDestAmount: minOut.toString(),\n feeUsd: 0,\n etaSeconds: 15,\n reliability: 0.97,\n validUntilMs: Date.now() + ttl,\n // Pool fees are inside the router-priced output; nothing is added on top.\n providerData: {\n route: route.label,\n poolFee: \"pools\",\n router: d.router,\n family: d.family,\n tokenIn,\n tokenOut,\n amountIn: amountIn.toString(),\n minOut: minOut.toString(),\n slippageBps: String(bps),\n pools: routePools(args).join(\",\"),\n candidates: `${routes.length}${truncated ? \"+\" : \"\"}`,\n ...(priceImpactBps !== undefined ? {priceImpactBps: String(priceImpactBps)} : {}),\n },\n };\n // The same check a client runs on a remote quote, on what this provider just built.\n const why = selfCheck(params, quote);\n if (why) return refuse(`built a call its own check refuses (${why})`);\n return quote;\n } catch (e) {\n return refuse(e instanceof Error ? e.message.replace(/^curve: /, \"\") : String(e));\n }\n },\n\n /**\n * Right before broadcast (after any approval): the transaction is byte for byte the sealed quote, each hop pool is\n * still the pinned code with the pinned coins (the immutable router's code and version were checked once for the\n * chain), and the exact route still pays at least the signed minimum. Refuse with the reason instead of sending a swap that would revert or was altered.\n */\n async preflightDeposit(quote: Quote, tx: UnsignedTx): Promise<void> {\n const reason = await chain.checkSealed(quote, tx);\n if (reason) throw new Error(`curve: ${reason}. Nothing was sent; refresh the quote.`);\n },\n\n async buildDeposit(quote: Quote): Promise<UnsignedTx> {\n const tx = quote.txRequest;\n if (!tx?.to || !tx.data) throw new Error(\"swap2: Curve quote has no transaction request\");\n return {\n chain: \"\",\n to: tx.to,\n value: tx.value ?? \"0\",\n data: tx.data,\n ...(tx.chainId !== undefined ? {chainId: tx.chainId} : {}),\n ...(tx.gasLimit ? {gasLimit: tx.gasLimit} : {}),\n ...(tx.approvalAddress ? {approvalAddress: tx.approvalAddress} : {}),\n };\n },\n\n /** Same-chain: the swap is done when its transaction is mined successfully. */\n async trackIntent(ref: IntentRef): Promise<IntentStatus> {\n if (!ref.sourceTxHash) return {state: \"pending\"};\n const chainId = curveIntentChain(ref.intentId);\n if (chainId === null || !deploymentOf(deployments, chainId) || !config.rpcUrls[chainId]?.length) return {state: \"pending\"};\n try {\n const [receipt] = (await rpc(chainId, [{method: \"eth_getTransactionReceipt\", params: [ref.sourceTxHash]}])) as [{status?: string} | null];\n if (!receipt) return {state: \"pending\"};\n return receipt.status === \"0x1\" ? {state: \"completed\", destTxHash: ref.sourceTxHash} : {state: \"failed\"};\n } catch {\n return {state: \"pending\"};\n }\n },\n };\n}\n","import {decodeFunctionData, encodeFunctionData, parseAbi} from \"viem\";\nimport type {CurveRouterFamily} from \"./deployments.js\";\nimport {ZERO_ADDRESS} from \"./deployments.js\";\nimport type {Hex} from \"./pools/types.js\";\n\n/**\n * Router NG entry points, both ABI families (selectors with `viem toFunctionSelector`, checked against every pinned\n * router's code 2026-11-05). This module writes only the explicit-receiver `exchange` of each family and reads\n * `get_dy`; the other forms are listed for history recognition.\n */\nexport const ROUTER_NG5_ABI = parseAbi([\n \"function exchange(address[11] _route, uint256[5][5] _swap_params, uint256 _amount, uint256 _min_dy) payable returns (uint256)\",\n \"function exchange(address[11] _route, uint256[5][5] _swap_params, uint256 _amount, uint256 _min_dy, address[5] _pools) payable returns (uint256)\",\n \"function exchange(address[11] _route, uint256[5][5] _swap_params, uint256 _amount, uint256 _min_dy, address[5] _pools, address _receiver) payable returns (uint256)\",\n \"function get_dy(address[11] _route, uint256[5][5] _swap_params, uint256 _amount) view returns (uint256)\",\n \"function version() view returns (string)\",\n]);\nexport const ROUTER_LITE4_ABI = parseAbi([\n \"function exchange(address[11] _route, uint256[4][5] _swap_params, uint256 _amount, uint256 _min_dy) payable returns (uint256)\",\n \"function exchange(address[11] _route, uint256[4][5] _swap_params, uint256 _amount, uint256 _min_dy, address _receiver) payable returns (uint256)\",\n \"function get_dy(address[11] _route, uint256[4][5] _swap_params, uint256 _amount) view returns (uint256)\",\n \"function version() view returns (string)\",\n]);\nexport const VERSION_ABI = parseAbi([\"function version() view returns (string)\"]);\n/** `coins(uint256)` (every NG pool and most plain ones) and `coins(int128)` (the oldest stable pools). */\nexport const COINS_UINT: Hex = \"0xc6610657\";\nexport const COINS_INT: Hex = \"0x23746eb8\";\nexport const ADDRESS_PROVIDER_ABI = parseAbi([\"function get_address(uint256 _id) view returns (address)\"]);\n\n/** The `exchange` this module builds: with an explicit receiver. */\nexport const EXCHANGE_SELECTOR: Readonly<Record<CurveRouterFamily, Hex>> = Object.freeze({ng5: \"0xc872a3c5\", lite4: \"0xfd44959c\"});\nexport const GET_DY_SELECTOR: Readonly<Record<CurveRouterFamily, Hex>> = Object.freeze({ng5: \"0x81889a2c\", lite4: \"0x11e21386\"});\n/** Every swap entry point per family, for history: `[5][5]` 4-, 5- and 6-argument forms; `[4][5]` 4- and 5-argument. */\nexport const ROUTER_SELECTORS: Readonly<Record<CurveRouterFamily, ReadonlySet<string>>> = Object.freeze({\n ng5: new Set([\"0x371dc447\", \"0x5c9c18e2\", \"0xc872a3c5\"]),\n lite4: new Set([\"0xaad348a2\", \"0xfd44959c\"]),\n});\n/** topic0 of the router's `Exchange` event per family (`[5][5]` logs `pools` too). */\nexport const EXCHANGE_TOPIC: Readonly<Record<CurveRouterFamily, Hex>> = Object.freeze({\n ng5: \"0x56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee83\",\n lite4: \"0x6324485a21bc5138ec352d4949d0adc75d8e1382a687e1aa1ce6863f40c9e463\",\n});\n\n/** A route as the router takes it: 11 addresses and one swap-params row per step (5 rows; 5 or 4 columns). */\nexport interface RouterArgs {\n route: readonly Hex[];\n params: readonly (readonly bigint[])[];\n}\n\n/** One router call, decoded. `receiver` is null when the call names none (the router then pays `msg.sender`). */\nexport interface DecodedExchange extends RouterArgs {\n amount: bigint;\n minDy: bigint;\n pools: readonly Hex[] | null;\n receiver: Hex | null;\n selector: Hex;\n}\n\nconst ZERO_POOLS: readonly Hex[] = Object.freeze([ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS]);\ntype Row5 = readonly [bigint, bigint, bigint, bigint, bigint];\ntype Row4 = readonly [bigint, bigint, bigint, bigint];\nconst tuple11 = (a: readonly Hex[]) => a as unknown as readonly [Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex];\nconst rows5 = (p: readonly (readonly bigint[])[]) => p as unknown as readonly [Row5, Row5, Row5, Row5, Row5];\nconst rows4 = (p: readonly (readonly bigint[])[]) => p as unknown as readonly [Row4, Row4, Row4, Row4, Row4];\nconst pools5 = (a: readonly Hex[]) => a as unknown as readonly [Hex, Hex, Hex, Hex, Hex];\n\nfunction checkShape(family: CurveRouterFamily, args: RouterArgs): void {\n const cols = family === \"ng5\" ? 5 : 4;\n if (args.route.length !== 11 || args.params.length !== 5 || args.params.some((r) => r.length !== cols)) {\n throw new Error(`curve: a ${family} route is address[11] and uint256[${cols}][5]`);\n }\n}\n\n/** `exchange(route, params, amount, minDy, [zero pools,] receiver)` for the router family. */\nexport function encodeExchange(family: CurveRouterFamily, args: RouterArgs, amount: bigint, minDy: bigint, receiver: Hex): Hex {\n checkShape(family, args);\n return family === \"ng5\"\n ? encodeFunctionData({abi: ROUTER_NG5_ABI, functionName: \"exchange\", args: [tuple11(args.route), rows5(args.params), amount, minDy, pools5(ZERO_POOLS), receiver]})\n : encodeFunctionData({abi: ROUTER_LITE4_ABI, functionName: \"exchange\", args: [tuple11(args.route), rows4(args.params), amount, minDy, receiver]});\n}\n\n/** `get_dy(route, params, amount)` for the router family. */\nexport function encodeGetDy(family: CurveRouterFamily, args: RouterArgs, amount: bigint): Hex {\n checkShape(family, args);\n return family === \"ng5\"\n ? encodeFunctionData({abi: ROUTER_NG5_ABI, functionName: \"get_dy\", args: [tuple11(args.route), rows5(args.params), amount]})\n : encodeFunctionData({abi: ROUTER_LITE4_ABI, functionName: \"get_dy\", args: [tuple11(args.route), rows4(args.params), amount]});\n}\n\n/** Any of the family's `exchange` forms, decoded; null for anything else (another selector, malformed data). */\nexport function decodeExchange(family: CurveRouterFamily, data: string): DecodedExchange | null {\n if (!/^0x[0-9a-fA-F]*$/.test(data) || data.length < 10) return null;\n const selector = data.slice(0, 10).toLowerCase() as Hex;\n if (!ROUTER_SELECTORS[family].has(selector)) return null;\n try {\n if (family === \"ng5\") {\n const c = decodeFunctionData({abi: ROUTER_NG5_ABI, data: data as Hex});\n if (c.functionName !== \"exchange\") return null;\n const a = c.args as readonly unknown[];\n return {\n selector,\n route: a[0] as readonly Hex[],\n params: a[1] as readonly (readonly bigint[])[],\n amount: a[2] as bigint,\n minDy: a[3] as bigint,\n pools: a.length >= 5 ? (a[4] as readonly Hex[]) : null,\n receiver: a.length >= 6 ? (a[5] as Hex) : null,\n };\n }\n const c = decodeFunctionData({abi: ROUTER_LITE4_ABI, data: data as Hex});\n if (c.functionName !== \"exchange\") return null;\n const a = c.args as readonly unknown[];\n return {\n selector,\n route: a[0] as readonly Hex[],\n params: a[1] as readonly (readonly bigint[])[],\n amount: a[2] as bigint,\n minDy: a[3] as bigint,\n pools: null,\n receiver: a.length >= 5 ? (a[4] as Hex) : null,\n };\n } catch {\n return null;\n }\n}\n","import type {Hex} from \"./pools/types.js\";\n\n/**\n * Curve Router NG deployments this module trusts, one per chain, keyed by chain id (the same address means a different\n * contract on another chain: `0x4f37…fc1F` is a `[5][5]` router on Base and a `[4][5]` one on Mantle). Every entry was\n * read on-chain on 2026-11-05: the runtime code's keccak (the router has no owner and no proxy; its immutables — the\n * wrapped native, and on `[5][5]` routers the two calc zaps — are inside the code, so the hash pins them too),\n * `version()`, the wrapped native read from the code's immutable tail, and what the chain's AddressProvider lists as\n * id 2. The provider re-checks the code hash and the version once per chain before quoting (`verifyDeployment`).\n *\n * The router address is never resolved at runtime: the AddressProvider is an informational registry its admin (an\n * individual, not the DAO) can change at any time, so its id 2 is only compared and a difference only warned about.\n */\n\n/** ABI family of a router: `ng5` = `uint256[5][5]` swap params `[i, j, swap_type, pool_type, n_coins]` plus a\n * `_pools[5]` argument (curve-router-ng `Router.vy`); `lite4` = `uint256[4][5]` `[i, j, swap_type, pool_type]`, no\n * `_pools` (curve-core `router_v_110.vy` / `router_v_111.vy`, NG pools only). */\nexport type CurveRouterFamily = \"ng5\" | \"lite4\";\n\nexport interface CurveDeployment {\n /** Human label for logs and subtitles. */\n label: string;\n family: CurveRouterFamily;\n router: Hex;\n /** `version()` as the router reports it. */\n version: \"1.2.0\" | \"1.1.0\" | \"1.1.1\";\n /** keccak256 of the router's runtime code. */\n codeHash: Hex;\n /** The wrapped native the router's swap_type 8 hop wraps / unwraps (its `WETH_ADDRESS` immutable). */\n weth: Hex;\n /** The router's native sentinel (`ETH_ADDRESS`; a constructor immutable on v1.1.1). */\n eth: Hex;\n /** The chain's Curve AddressProvider (watch signal only) and the address its id 2 listed when pinned. */\n addressProvider: Hex;\n addressProviderRouter: Hex;\n /** ERC-4626 pseudo-hop (swap_type 9) the router may use — only on router v1.2 (Ethereum: crvUSD ↔ scrvUSD). */\n erc4626?: {vault: Hex; asset: Hex};\n}\n\n/** The native sentinel every pinned router uses (checked against the v1.1.1 routers' immutable). */\nexport const CURVE_ETH: Hex = \"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\";\nexport const ZERO_ADDRESS: Hex = \"0x0000000000000000000000000000000000000000\";\n/** Most pool hops one route crosses (pseudo-hops — wrap, ERC-4626 — come on top). */\nexport const MAX_ROUTE_POOLS = 2;\n/** Most router steps one route may have: two pools, a wrap in front and an unwrap or an ERC-4626 hop behind. */\nexport const MAX_ROUTE_STEPS = 4;\n\n/** Savings crvUSD (Yearn V3 vault, ERC-4626 over crvUSD) on Ethereum, and crvUSD itself. */\nexport const SCRVUSD: Hex = \"0x0655977FEb2f289A4aB78af67BAB0d17aAb84367\";\nexport const CRVUSD_ETHEREUM: Hex = \"0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E\";\n\nconst AP: Hex = \"0x5ffe7FB82894076ECB99A30D6A32e969e6e35E98\";\nconst R_OP_POLY_GNO_AVAX: Hex = \"0x0DCDED3545D565bA3B19E683431381007245d983\";\nconst R_UNI_HYPER: Hex = \"0xd2002373543Ce3527023C75e7518C274A51ce712\";\nconst R_MONAD_PLASMA_RH: Hex = \"0xFF5Cb29241F002fFeD2eAa224e3e996D24A6E8d1\";\nconst R_BASE_MANTLE: Hex = \"0x4f37A9d177470499A2dD084621020b023fcffc1F\";\nconst AP_UNI_HYPER: Hex = \"0x1764ee18e8B3ccA4787249Ceb249356192594585\";\nconst AP_MONAD_PLASMA_RH: Hex = \"0x4574921eb950d3Fd5B01562162EC566Cb8bc3648\";\nconst OP_WETH: Hex = \"0x4200000000000000000000000000000000000006\";\n\nconst d = (o: Omit<CurveDeployment, \"eth\"> & {eth?: Hex}): CurveDeployment => Object.freeze({eth: CURVE_ETH, ...o});\n\nexport const CURVE_DEPLOYMENTS: Readonly<Record<number, CurveDeployment>> = Object.freeze({\n // [5][5] routers. Ethereum runs v1.2 (the router Curve's UI, curve-js and the curve-router-ng README use; the only one\n // with the ERC-4626 hop) — the AddressProvider still lists v1.1 there.\n 1: d({label: \"Ethereum\", family: \"ng5\", router: \"0x45312ea0eFf7E09C83CBE249fa1d7598c4C8cd4e\", version: \"1.2.0\", codeHash: \"0xbe5f7301254e95d27c6aa1be0fedc0aa04d6c36097e089bc9d2cccaa9d26b164\", weth: \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\", addressProvider: AP, addressProviderRouter: \"0x16C6521Dff6baB339122a0FE25a9116693265353\", erc4626: {vault: SCRVUSD, asset: CRVUSD_ETHEREUM}}),\n 42161: d({label: \"Arbitrum\", family: \"ng5\", router: \"0x2191718CD32d02B8E60BAdFFeA33E4B5DD9A0A0D\", version: \"1.1.0\", codeHash: \"0x9b387b5dc8fe161c7af8e850a67662e93d7116b0e66ab6bc7761d5910093bcef\", weth: \"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1\", addressProvider: AP, addressProviderRouter: \"0x2191718CD32d02B8E60BAdFFeA33E4B5DD9A0A0D\"}),\n 8453: d({label: \"Base\", family: \"ng5\", router: R_BASE_MANTLE, version: \"1.1.0\", codeHash: \"0x3abb7fe467b6c925ab1b25771cf1c75cc507aec2f873a8d03ee95160c5a83579\", weth: OP_WETH, addressProvider: AP, addressProviderRouter: R_BASE_MANTLE}),\n 10: d({label: \"OP Mainnet\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0x12ae037c1e9a21aeb6ba1b08863217de2babebbee58dbe8860a01ded6a974825\", weth: OP_WETH, addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 137: d({label: \"Polygon\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0x340f3ba3f30181c50e694f1a4da2f6ec670fc7eb0adce50d66a733f17ab150f4\", weth: \"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270\", addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 100: d({label: \"Gnosis\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0x38dc1cc456be010539e596d2ee0aa82c271316bdc6daaaffea7990a0c47176ee\", weth: \"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d\", addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 43114: d({label: \"Avalanche\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0xf1f679ec6382cd9c0138870e320e6128193f75144501691e67dcd5831edaed2b\", weth: \"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7\", addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 56: d({label: \"BNB Chain\", family: \"ng5\", router: \"0xA72C85C258A81761433B4e8da60505Fe3Dd551CC\", version: \"1.1.0\", codeHash: \"0x19db989a1cca08711ff68049326a5a7a8d1f64d87f356d35243150215c722120\", weth: \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\", addressProvider: AP, addressProviderRouter: \"0xA72C85C258A81761433B4e8da60505Fe3Dd551CC\"}),\n // [4][5] routers (curve-core, NG pools only, no swap_type 9).\n 146: d({label: \"Sonic\", family: \"lite4\", router: \"0x5eeE3091f747E60a045a2E715a4c71e600e31F6E\", version: \"1.1.0\", codeHash: \"0xc5f238aee45c18efc927708fe57821cca4a84ec1bff4f22e778dfcd108411b99\", weth: \"0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38\", addressProvider: \"0x87FE17697D0f14A222e8bEf386a0860eCffDD617\", addressProviderRouter: \"0x5eeE3091f747E60a045a2E715a4c71e600e31F6E\"}),\n 130: d({label: \"Unichain\", family: \"lite4\", router: R_UNI_HYPER, version: \"1.1.0\", codeHash: \"0xe911928fab7efb72e10ee3a918dcdfb44ac5bae1c4d46eb5534bea0259d2594c\", weth: OP_WETH, addressProvider: AP_UNI_HYPER, addressProviderRouter: R_UNI_HYPER}),\n 999: d({label: \"HyperEVM\", family: \"lite4\", router: R_UNI_HYPER, version: \"1.1.0\", codeHash: \"0x1040124f623348643d919029ed513670cdb825bd0135f846ce9028329d8eb77d\", weth: \"0x5555555555555555555555555555555555555555\", addressProvider: AP_UNI_HYPER, addressProviderRouter: R_UNI_HYPER}),\n 5000: d({label: \"Mantle\", family: \"lite4\", router: R_BASE_MANTLE, version: \"1.1.0\", codeHash: \"0xe76d585fb4163cd886c99f1c12361c5644e18b8dab2d86e3fe223307e7a16f29\", weth: \"0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8\", addressProvider: AP, addressProviderRouter: R_BASE_MANTLE}),\n 143: d({label: \"Monad\", family: \"lite4\", router: R_MONAD_PLASMA_RH, version: \"1.1.0\", codeHash: \"0x7668fc406894fb811ab7f9a1099f2e33ef8d80f58327e623bbe4c4d51e406f58\", weth: \"0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A\", addressProvider: AP_MONAD_PLASMA_RH, addressProviderRouter: R_MONAD_PLASMA_RH}),\n 9745: d({label: \"Plasma\", family: \"lite4\", router: R_MONAD_PLASMA_RH, version: \"1.1.0\", codeHash: \"0xeede894a379cb95c73ece834e836ff9bbaa1ff613fb7913d0cbc3a48b2897120\", weth: \"0x6100E367285b01F48D07953803A2d8dCA5D19873\", addressProvider: AP_MONAD_PLASMA_RH, addressProviderRouter: R_MONAD_PLASMA_RH}),\n // v1.1.1: ETH_ADDRESS is a constructor immutable — 0xEeee… here, read from the code tail with WETH_ADDRESS.\n 4663: d({label: \"Robinhood Chain\", family: \"lite4\", router: R_MONAD_PLASMA_RH, version: \"1.1.1\", codeHash: \"0x716ad3720f54c96effe415598d3a62b9907e53c58c7e3d3004cba6cdb5c297a6\", weth: \"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73\", eth: CURVE_ETH, addressProvider: AP_MONAD_PLASMA_RH, addressProviderRouter: R_MONAD_PLASMA_RH}),\n 57073: d({label: \"Ink\", family: \"lite4\", router: \"0xd7E72f3615aa65b92A4DBdC211E296a35512988B\", version: \"1.1.0\", codeHash: \"0x511c1733063263ba386b0e6b01b51d777deb02ea1b6e75fcde1e572e47f22436\", weth: OP_WETH, addressProvider: \"0x604388Bb1159AFd21eB5191cE22b4DeCdEE2Ae22\", addressProviderRouter: \"0xd7E72f3615aa65b92A4DBdC211E296a35512988B\"}),\n 196: d({label: \"X Layer\", family: \"lite4\", router: \"0xBFab8ebc836E1c4D81837798FC076D219C9a1855\", version: \"1.1.0\", codeHash: \"0xfc0a3b12868c10a8a46e33f17504f8751c83d3842f715c665c3d827bfc4ed625\", weth: \"0xe538905cf8410324e03A5A23C1c177a474D59b2b\", addressProvider: AP, addressProviderRouter: \"0xBFab8ebc836E1c4D81837798FC076D219C9a1855\"}),\n 98866: d({label: \"Plume\", family: \"lite4\", router: \"0x3F5A41B922a76759b9C77D36b3d337E88cD1dc5e\", version: \"1.1.0\", codeHash: \"0x0819b95039f1e0ac56aefffc8a727e996b3afa831fd3bb2047a3737bf23ab5e4\", weth: \"0xEa237441c92CAe6FC17Caaf9a7acB3f953be4bd1\", addressProvider: \"0x907CE289E9Ee0BBcb0F69132B1C28A9Affc29FCA\", addressProviderRouter: \"0x3F5A41B922a76759b9C77D36b3d337E88cD1dc5e\"}),\n});\n\n/**\n * Older Ethereum routers recognized in history only (never quoted or approved): Router NG v1.1 (what the\n * AddressProvider lists as id 2) and v1.0. Both `[5][5]`, both immutable (checked 2026-11-05).\n */\nexport const CURVE_LEGACY_ROUTERS: Readonly<Record<number, readonly {router: Hex; version: string; codeHash: Hex}[]>> = Object.freeze({\n 1: Object.freeze([\n {router: \"0x16C6521Dff6baB339122a0FE25a9116693265353\" as Hex, version: \"1.1.0\", codeHash: \"0xf041e5b17dc8b2c417a9561eb265145e442ab25b789d9bd3527c6b68a840577b\" as Hex},\n {router: \"0xF0d4c12A5768D806021F80a262B4d39d26C58b8D\" as Hex, version: \"1.0.0\", codeHash: \"0xdfc206a29f04b4cee5b7b8d5b60ffcd2574fc9ff17cc5ec00c58b17013ea3f3b\" as Hex},\n ]),\n});\n\n/**\n * Pools a route never crosses, whatever an allowlist says (defense in depth; the allowlist generator excludes the same\n * addresses). Ethereum: a registered stable-ng pool pairing real USDT with a token that calls itself \"USDT\"\n * (`0x810e…ae9`); the four pools drained by the 2023 Vyper reentrancy-lock bug (alETH, pETH, msETH, CRV/ETH — still\n * registered on-chain); the Iron Bank lending pool cyDAI/cyUSDC/cyUSDT, whose underlying route redeems Iron Bank\n * cTokens. Polygon: amWBTC/renBTC (renBTC is dead).\n */\nexport const CURVE_DENIED_POOLS: Readonly<Record<number, ReadonlySet<string>>> = Object.freeze({\n 1: new Set([\n \"0xa6d9f4f3a67b35e81dfa560b0fcde9b0751f1f53\",\n \"0xc4c319e2d4d66cca4464c0c2b32c9bd23ebe784e\",\n \"0x9848482da3ee3076165ce6497eda906e66bb85c5\",\n \"0xc897b98272aa23714464ea2a0bd5180f1b8c0025\",\n \"0x8301ae4fc9c624d1d396cbdaa1ed877821d7c511\",\n \"0x2dded6da1bf5dbdf597c45fcfaa3194e53ecfeaf\",\n ]),\n 137: new Set([\n \"0xc2d95eef97ec6c17551d45e77b590dc1f9117c67\",\n ]),\n});\n\n/** The chain id of an `eip155:<id>` CAIP-2 string, or NaN. */\nexport function chainIdOf(caip2: string): number {\n return /^eip155:[0-9]+$/.test(caip2) ? Number(caip2.slice(7)) : NaN;\n}\n\n/** The deployment pinned for `chainId` in `table` (own keys only), or undefined. */\nexport function deploymentOf(table: Readonly<Record<number, CurveDeployment>>, chainId: number): CurveDeployment | undefined {\n return Object.prototype.hasOwnProperty.call(table, chainId) ? table[chainId] : undefined;\n}\n","/**\n * Activity recognition for Curve: a call into the chain's pinned Router NG — or, on Ethereum, the older v1.1 / v1.0\n * routers (history only) — with one of the family's `exchange` entry points → `swap`, \"Swapped A → B\" from the owner's\n * net transfers. A swap whose receiver is not one of the owner's addresses (an explicit `_receiver`, read from the\n * calldata or the router's `Exchange` log) says so in the subtitle and names that receiver as the counterparty.\n */\nimport type {ActivityItem, ChainTx, DescribeActivityContext} from \"@anywalletkit/core\";\nimport {calledContract, chainLabel, describeSwapLike, shortAddress} from \"@anywalletkit/protocol-swap2-core/activity\";\nimport {evmRef, isEvm} from \"@anywalletkit/protocol-swap2-core/util\";\nimport {EXCHANGE_TOPIC, ROUTER_SELECTORS, decodeExchange} from \"./abi.js\";\nimport {CURVE_DEPLOYMENTS, CURVE_LEGACY_ROUTERS, deploymentOf, type CurveDeployment, type CurveRouterFamily} from \"./deployments.js\";\n\nexport const CURVE_MODULE = \"@anywalletkit/protocol-swap2-curve\";\n\n/** The router family `to` speaks on `chainId`, when it is a router this module knows there. */\nfunction familyOf(deployments: Readonly<Record<number, CurveDeployment>>, chainId: number, to: string): CurveRouterFamily | null {\n const d = deploymentOf(deployments, chainId);\n if (d && d.router.toLowerCase() === to) return d.family;\n const legacy = Object.prototype.hasOwnProperty.call(CURVE_LEGACY_ROUTERS, chainId) ? CURVE_LEGACY_ROUTERS[chainId]! : [];\n return legacy.some((r) => r.router.toLowerCase() === to) ? \"ng5\" : null;\n}\n\n/** Who the swap paid: the calldata's `_receiver`, else the router's `Exchange` log (topic 2), else the sender. */\nfunction receiverOf(tx: ChainTx, family: CurveRouterFamily): string {\n const data = tx.call?.data;\n if (data) {\n const call = decodeExchange(family, data);\n if (call?.receiver) return call.receiver.toLowerCase();\n if (call) return tx.from.toLowerCase();\n }\n const logs = (tx.raw as {logs?: unknown} | undefined)?.logs ?? (tx.raw as {receipt?: {logs?: unknown}} | undefined)?.receipt?.logs;\n if (Array.isArray(logs)) {\n const to = calledContract(tx);\n for (const l of logs as {address?: string; topics?: string[]}[]) {\n if (l?.address?.toLowerCase() !== to || l.topics?.[0]?.toLowerCase() !== EXCHANGE_TOPIC[family]) continue;\n const t = l.topics[2];\n if (typeof t === \"string\" && /^0x[0-9a-fA-F]{64}$/.test(t)) return `0x${t.slice(-40)}`.toLowerCase();\n }\n }\n return tx.from.toLowerCase();\n}\n\nexport function describeCurveActivity(\n tx: ChainTx,\n ctx: DescribeActivityContext,\n deployments: Readonly<Record<number, CurveDeployment>> = CURVE_DEPLOYMENTS,\n): ActivityItem | null {\n if (!isEvm(tx.chain)) return null;\n const to = calledContract(tx);\n if (!to) return null;\n const family = familyOf(deployments, evmRef(tx.chain), to);\n if (!family) return null;\n const sel = tx.call?.selector?.toLowerCase() ?? tx.call?.data?.slice(0, 10).toLowerCase();\n if (!sel || !ROUTER_SELECTORS[family].has(sel)) return null;\n const receiver = receiverOf(tx, family);\n const ownReceiver = ctx.own.has(receiver) || [...ctx.own].some((a) => a.toLowerCase() === receiver);\n const subtitle = `Curve · ${chainLabel(tx.chain)}${ownReceiver ? \"\" : ` · paid to ${shortAddress(receiver)}`}`;\n return describeSwapLike(tx, ctx, {protocol: CURVE_MODULE, subtitle, kind: \"swap\", ...(ownReceiver ? {} : {counterparty: receiver})});\n}\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Ethereum (1), router ABI ng5. On-chain checks at block 26350656: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $1,000,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 80 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/ethereum.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_1: CurveChainPools = {\n chainId: 1,\n builtAt: '2026-11-05',\n block: 26350656,\n pools: [\n { address: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', name: 'Curve.fi DAI/USDC/USDT', coins: ['0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6, 6], poolType: 1, swapTypes: [1], codeHash: '0x954a1e212c557c85043985931498ffa3e2fcbe7dfe9cd61513f36eb47d6f4dfc', tvlUsd: 161890942, createdAt: 1599422178 },\n { address: '0xDC24316b9AE028F1497c275EB9192a3Ea0f67022', name: 'Curve.fi ETH/stETH', coins: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0xe2c45ce8268580c40b4c12c574f8a210375ab92998c1555451fef63630e96b35', tvlUsd: 85454194, createdAt: 1609827515 },\n { address: '0x862CB4E988FB66E72f128d1183829f8c05B6c6A0', name: 'Yield Basis cbBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0xd19e3a232367411c825df98165c95898c08e181fe2e0f9211445f48eb4c0dc62', tvlUsd: 54490963, createdAt: 1779393887 },\n { address: '0x313698667d7FDD6789a9BC70821309ff891E729A', name: 'Yield Basis WBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0xe4ac67017f888827e6efe22cd8edc37bf562166368f6eb62837bff2e4a4a23e8', tvlUsd: 48858088, createdAt: 1779393875 },\n { address: '0xD001aE433f254283FeCE51d4ACcE8c53263aa186', name: 'RLUSD/USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x8292Bb45bf1Ee4d140127049757C2E0fF06317eD'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x0e07a882cbde1fe43a2023b573596d0688cd4511bb04cbff49f1d9cceab84888', tvlUsd: 39310146, createdAt: 1734614699 },\n { address: '0xcc7d5785AD5755B6164e21495E07aDb0Ff11C2A8', name: 'OETH/WETH', coins: ['0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x8b33e4c54cca2b340c5ac61ac287ecd06cfab84979e63c1260683abcc06f8138', tvlUsd: 38072502, createdAt: 1742850227 },\n { address: '0x4F52C3a81E33521e5a9A47FD9D3BE475D2279c2e', name: 'Yield Basis tBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x18084fbA666a33d37592fA2633fD49a74DD93a88'], decimals: [18, 18], poolType: 20, swapTypes: [1], codeHash: '0xaefafc4c0157bc496db238fc46d730a140174f3fb542527bb86443974ed4f7a6', tvlUsd: 35972318, createdAt: 1779393911 },\n { address: '0x656341Ef90b622c6634e0573772FfB7f3669b9f3', name: 'Yield Basis WETH', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [18, 18], poolType: 20, swapTypes: [1], codeHash: '0x116eeee684882885cda3ddf0287d0979f71d64030fbec90f1f52924cf0e7643a', tvlUsd: 29312833, createdAt: 1779393923 },\n { address: '0x21E27a5E5513D6e65C4f830167390997aA84843a', name: 'Curve.fi Factory Pool: stETH-ng', coins: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x9e28a09452d2354fc4e15e3244dde27cbc4d52f12a10b91f2ca755b672bfa9be', tvlUsd: 21919007, createdAt: 1684243259 },\n { address: '0xc061caa073f3d95F80f8e5428d32D2d76F5e1622', name: 'USDG/USDC', coins: ['0xe343167631d89B6Ffc58B88d6b7fB0228795491D', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x1c7b77a94bb42408ab6d5cfd76223f0c794db9b119bb6035db91d8b09da65512', tvlUsd: 20042556, createdAt: 1757337995 },\n { address: '0xC2921134073151490193AC7369313c8e0b08e1E7', name: 'USDtb-USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xC139190F447e929f090Edeb554D95AbB8b18aC1C'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x003569f063c00de15be2ce5934449342555e009ef7ba9894ef84d302602b186f', tvlUsd: 19974424, createdAt: 1733348927 },\n { address: '0x83f24023d15d835a213df24fd309c47dAb5BEb32', name: 'YB cbBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0xb00ba7467a75fffe15d018cc822a09b282a285f4012f857b19966046b3191b3a', tvlUsd: 17762242, createdAt: 1758723599 },\n { address: '0x5dc1BF6f1e983C0b21EfB003c105133736fA0743', name: 'FRAXUSDe', coins: ['0x853d955aCEf822Db058eb8505911ED77F175b99e', '0x4c9EDD5852cd905f086C759E8383e09bff1E68B3'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x6aa12bb9b18854a3f453e240d7e960190a32f1c16a8e268a90a66c8a95fe3a86', tvlUsd: 16042488, createdAt: 1702770299 },\n { address: '0x13e12BB0E6A2f1A3d6901a59a9d585e89A6243e1', name: 'crvUSD/frxUSD', coins: ['0xCAcd6fd266aF91b8AeD52aCCc382b4e165586E29', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x6de2b24d7a8852d96955f6873f16402e61b5d9f3aff037f62a2004fecf31ce83', tvlUsd: 13934470, createdAt: 1752006431 },\n { address: '0x4DEcE678ceceb27446b35C672dC7d61F30bAD69E', name: 'Curve.fi Factory Plain Pool: crvUSD/USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [6, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 13078629, createdAt: 1684066067 },\n { address: '0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA', name: 'Curve.fi Factory USD Metapool: Liquity', coins: ['0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'], decimals: [18, 18], underlying: ['0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [18, 18, 6, 6], basePool: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', poolType: 1, swapTypes: [1, 2], codeHash: '0x156700a4060f3d62786914b50cc60b2b840e6440401bea9a99c0acce0b58beda', tvlUsd: 12967284, createdAt: 1617702355 },\n { address: '0xf5f5B97624542D72A9E06f04804Bf81baA15e2B4', name: 'TricryptoUSDT', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [6, 8, 18], poolType: 30, swapTypes: [1], codeHash: '0xe5a06bd0c8f12bc66b551b99a34cdd7d2a286a53b778244c930a8f6db01fef40', tvlUsd: 12898000, createdAt: 1685482703 },\n { address: '0x4d9f9D15101EEC665F77210cB999639f760F831E', name: 'Curve.fi Factory Plain Pool: stETH/frxETH', coins: ['0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', '0x5E8422345238F34275888049021821E8E08CAa1f'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x8d287c58712fcd24b18f60f4a77a4a4d1a7a8bd10e3cb4c9d4752296b307aa51', tvlUsd: 12880550, createdAt: 1677059567 },\n { address: '0x383E6b4437b59fff47B619CBA855CA29342A8559', name: 'PayPool', coins: ['0x6c3ea9036406852006290770BEdFcAbA0e23A0e8', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x36356aefa486ac281df5aa3efb601b135b95da2c266bc4bf627aa6f4b4b22703', tvlUsd: 12266641, createdAt: 1703113055 },\n { address: '0xD51a44d3FaE010294C616388b506AcdA1bfAAE46', name: 'Curve.fi USD-BTC-ETH', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [6, 8, 18], poolType: 3, swapTypes: [1], codeHash: '0x9cb858c1d8e8ab8ba7dc273f146d428965b0ca686d05fb02cb4ffc62149ec928', tvlUsd: 10625171, createdAt: 1626218283 },\n { address: '0x390f3595bCa2Df7d23783dFd126427CCeb997BF4', name: 'Curve.fi Factory Plain Pool: crvUSD/USDT', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [6, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 9808682, createdAt: 1684066103 },\n { address: '0xDB74dfDD3BB46bE8Ce6C33dC9D82777BCFc3dEd5', name: 'weETH/WETH-ng', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0xf9b0b2342e2132b069f65bb801081a730df7cf80b2ef5a8b9a3fc7a6324724f3', tvlUsd: 9757307, createdAt: 1713832907 },\n { address: '0xB7ECB2AA52AA64a717180E030241bC75Cd946726', name: 'Curve.fi Factory Plain Pool: tBTC/WBTC', coins: ['0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0x18084fbA666a33d37592fA2633fD49a74DD93a88'], decimals: [8, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 8360462, createdAt: 1692136331 },\n { address: '0x5018BE882DccE5E3F2f3B0913AE2096B9b3fB61f', name: 'USDC/fxUSD', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x085780639CC2cACd35E474e71f4d000e2405d8f6'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x4a0e13c96d5dddf3d9a22d3ad7b65e6735199e857996056cbc4718ef4869bb48', tvlUsd: 7959448, createdAt: 1719632039 },\n { address: '0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4', name: 'Curve CVX-ETH', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B'], decimals: [18, 18], poolType: 2, swapTypes: [1], codeHash: '0x56ba0e921b89ed274e747d68fb8e49ba91fcc6fc4f7c1aaa5294c74b6a4b4d72', tvlUsd: 5926700, createdAt: 1639223635 },\n { address: '0xEFc6516323FbD28e80B85A497B65A86243a54B3E', name: 'BOLD/USDC Pool', coins: ['0x6440f144b7e50D6a8439336510312d2F54beB01D', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xd2c72b78d7d96bb962fa6429c4bb2e5dce6d92a5bc6712541ab76fe8e4570f07', tvlUsd: 5611794, createdAt: 1747597079 },\n { address: '0x7F86Bf177Dd4F3494b841a37e810A34dD56c829B', name: 'TricryptoUSDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [6, 8, 18], poolType: 30, swapTypes: [1], codeHash: '0xffceb70c60b48d7d02df8305161e44ec2454c1bc23fabc528e9a9ec71e4e7806', tvlUsd: 4972786, createdAt: 1685446211 },\n { address: '0x0Bdb2c3AF83EE1d3196FA64d3162e54624B5f6b0', name: 'USAT/USDT', coins: ['0x07041776f5007ACa2A54844F50503a18A72A8b68', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x9d0252403d580a95341bbddbecea09bbe280bd4d87f28ee8531a01d33119ba01', tvlUsd: 4647056, createdAt: 1772798639 },\n { address: '0xC09e82f81Cb811DB0922dD48206fc2e212322caf', name: 'World Liberty USD1 Pool', coins: ['0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d', '0x4f493B7dE8aAC7d55F71853688b1F7C8F0243C85'], decimals: [18, 18], underlying: ['0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [18, 6, 6], basePool: '0x4f493B7dE8aAC7d55F71853688b1F7C8F0243C85', poolType: 10, swapTypes: [1, 2], codeHash: '0x25478b25c12a81937ddb75e0c5ed8ca8ab248a102316873d092f49ca870b8cca', tvlUsd: 4343338, createdAt: 1756668467 },\n { address: '0x9c3B46C0Ceb5B9e304FCd6D88Fc50f7DD24B31Bc', name: 'Curve.fi Factory Plain Pool: frxETH/WETH', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0x5E8422345238F34275888049021821E8E08CAa1f'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 4279560, createdAt: 1692135095 },\n { address: '0x4f493B7dE8aAC7d55F71853688b1F7C8F0243C85', name: 'Curve.fi Strategic USD Reserves', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x5f0f1709fa823592ad75b27e32af00a8715d620dcb269be7c26fd5c873c1ce0e', tvlUsd: 4252884, createdAt: 1737825647 },\n { address: '0x2889302a794dA87fBF1D6Db415C1492194663D13', name: 'TricryptoLLAMA', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x18084fbA666a33d37592fA2633fD49a74DD93a88', '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'], decimals: [18, 18, 18], poolType: 30, swapTypes: [1], codeHash: '0x0c6780573f9c77a247365e2cbeae61fe0af7ea94ded696b5ee5e6462ce51b02e', tvlUsd: 4217439, createdAt: 1686845315 },\n { address: '0x98a7F18d4E56Cfe84E3D081B40001B3d5bD3eB8B', name: 'Curve EURS-USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdB25f211AB05b1c97D595516F45794528a807ad8'], decimals: [6, 2], poolType: 2, swapTypes: [1], codeHash: '0x6c0b789b9f2ee0cbb53935cbe4f88e7d66401e1b4508514c097e7bd81e8ea931', tvlUsd: 3939896, createdAt: 1635766643 },\n { address: '0x66039342C66760874047c36943B1e2d8300363BB', name: 'HemiBTC/cbBTC/WBTC', coins: ['0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf', '0x06ea695B91700071B161A434fED42D1DcbAD9f00'], decimals: [8, 8, 8], poolType: 10, swapTypes: [1], codeHash: '0x54a9f7fe4f6e0880c3e7f886d1a0500619b0539dd9d9067221a526ece460e6f7', tvlUsd: 3547580, createdAt: 1764180299 },\n { address: '0xE521BA88837B2726E5343ccA91adA6f19F356C45', name: 'USDx/USDT', coins: ['0xa1fA7777974312f7d801A8880714a218F76233f8', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0x74bb764c9dffe15ac160f6d01f6bdc1e4b03d39722083e674476ed6843c11d33', tvlUsd: 3020901, createdAt: 1788328955 },\n { address: '0x6F63deEDc9870D6c16FC644C6654748352cdc87c', name: 'apxUSD-USDC v3', coins: ['0x98A878b1Cd98131B271883B390f68D2c90674665', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xe511d7fa636d58614f82e35f2f333d1ed931f75baed8b7b89d2b1ef09825ef26', tvlUsd: 2796538, createdAt: 1785427007 },\n { address: '0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14', name: 'TriCRV', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0xD533a949740bb3306d119CC777fa900bA034cd52'], decimals: [18, 18, 18], poolType: 30, swapTypes: [1], codeHash: '0xf29fb95ca44fe2f979303e309cbaba61d44dd503fddeb111caae94e1b0857154', tvlUsd: 2439038, createdAt: 1690291775 },\n { address: '0x04710a7B238386Da58EfAd8b65E150e5E17AA522', name: 'USDC/sUSDat', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xD166337499E176bbC38a1FBd113Ab144e5bd2Df7'], decimals: [6, 18], poolType: 20, swapTypes: [1], codeHash: '0x11ecb979f7468e539cb2ee92b8cf7c59d56b1c97b9fdce333fe1d35ac5c8e110', tvlUsd: 2187783, createdAt: 1785550511 },\n { address: '0xE47E8Ced9D94AA43C922627782E29b41a93202AF', name: 'FIDD/USDC', coins: ['0x7C135549504245B5eAe64fc0E99Fa5ebabb8e35D', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0x11743a6ed542b23b65182e0c5a7b7d90b668a189f287b7c0c367b2f910d46c10', tvlUsd: 2074444, createdAt: 1770210611 },\n { address: '0x8273Cb2cF9AF3228fD14AF25B5B1De2A9676C372', name: 'FIDD/USDT', coins: ['0x7C135549504245B5eAe64fc0E99Fa5ebabb8e35D', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xb1b0592d31b5fc1b46f56ffaecca522725e94a0e56facab038cb92d8b5e0f2e5', tvlUsd: 1750912, createdAt: 1770210935 },\n { address: '0x839d6bDeDFF886404A6d7a788ef241e4e28F4802', name: 'cbBTC/wBTC', coins: ['0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'], decimals: [8, 8], poolType: 10, swapTypes: [1], codeHash: '0x5270c4f3873d43de1babb9754a903f0de33054dfb7d562c3a3fcadbb8fd3fbca', tvlUsd: 1688187, createdAt: 1725600707 },\n { address: '0xa4c567c662349BeC3D0fB94C4e7f85bA95E208e4', name: 'Curve.fi Factory Plain Pool: msETH/WETH', coins: ['0x64351fC9810aDAd17A690E4e1717Df5e7e085160', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x148d1345059482faa8834aff0630c9a4b47393df8edf9d99605b8f2f04752f62', tvlUsd: 1672158, createdAt: 1690864487 },\n { address: '0xbcb91E689114B9Cc865AD7871845C95241Df4105', name: 'Curve.fi Factory USD Metapool: PWRD Metapool', coins: ['0xF0a93d4994B3d98Fb5e3A2F90dBc2d69073Cb86b', '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'], decimals: [18, 18], underlying: ['0xF0a93d4994B3d98Fb5e3A2F90dBc2d69073Cb86b', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [18, 18, 6, 6], basePool: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', poolType: 1, swapTypes: [1, 2], codeHash: '0xf6083ac638c10e3ca56ad0183f22c4bb24fda0f4c180165327954b3dfae28541', tvlUsd: 1438819, createdAt: 1632839676 },\n { address: '0x635EF0056A597D13863B73825CcA297236578595', name: 'GHO/crvUSD', coins: ['0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x1517d1f4caa802ab0ddf9032274a7ff3781a1453ef7b278fc63245b492154ce2', tvlUsd: 1377020, createdAt: 1709732591 },\n { address: '0xC15F285679a1Ef2d25F53D4CbD0265E1D02F2A92', name: 'Curve.fi Factory Crypto Pool: FXN/ETH', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0x365AccFCa291e7D3914637ABf1F7635dB165Bb09'], decimals: [18, 18], poolType: 2, swapTypes: [1], codeHash: '0x6dfb9f924888fe0d10b50c35ced3f2cf372073a7e524450f1ebe491415db66e0', tvlUsd: 1244529, createdAt: 1695111311 },\n { address: '0x625E92624Bc2D88619ACCc1788365A69767f6200', name: 'pyUSD/crvUSD', coins: ['0x6c3ea9036406852006290770BEdFcAbA0e23A0e8', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x9c3b1c5ac877c1719736bb325d05eb2806f292776a2121a6f1e8a54d31960dbe', tvlUsd: 1175516, createdAt: 1703109587 },\n { address: '0xD9FF8396554A0d18B2CFbeC53e1979b7ecCe8373', name: 'YB WBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0x1578c5a836891e466a1fa5879bc7f0e36bfd9fc625586765541191d8cd3880ae', tvlUsd: 1167762, createdAt: 1758723347 },\n { address: '0x971add32Ea87f10bD192671630be3BE8A11b8623', name: 'Curve.fi Factory Plain Pool: cvxCrv/Crv', coins: ['0xD533a949740bb3306d119CC777fa900bA034cd52', '0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x148d1345059482faa8834aff0630c9a4b47393df8edf9d99605b8f2f04752f62', tvlUsd: 1151010, createdAt: 1678280183 },\n { address: '0xF4d0CF32908b2C7f1021339c43Df0F77f06896d7', name: 'USDC/USDat', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x23238f20b894f29041f48D88eE91131C395Aaa71'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x3c0abdd2996e01d3bff6d4430c231f8dd9f539985066729c28fbb2596ecd6e99', tvlUsd: 1107886, createdAt: 1775403179 },\n { address: '0x5B03CcCAb7BA3010fA5CAd23746cbf0794938e96', name: 'Curve Strategic Ethena Reserves', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x4c9EDD5852cd905f086C759E8383e09bff1E68B3'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0xbe6391aadd1d4d306c76728d664997ab7a1ef56c16565ca0d1526050b9c93890', tvlUsd: 1084518, createdAt: 1739457767 },\n { address: '0x4f062658EaAF2C1ccf8C8e36D6824CDf41167956', name: 'Curve.fi GUSD/3Crv', coins: ['0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd', '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'], decimals: [2, 18], underlying: ['0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [2, 18, 6, 6], basePool: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', poolType: 1, swapTypes: [1, 2], codeHash: '0xce79330162abf07fc163331f9d9d1553b93dbf509eeafa1215fafa6113c5088e', tvlUsd: 1068354, createdAt: 1602040124 },\n { address: '0xD6937eA8D33B0C21348F36F7895FdE3054bA4927', name: 'frxUSD/USDT', coins: ['0xCAcd6fd266aF91b8AeD52aCCc382b4e165586E29', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xadf65a4e5ed895c5c85762d0b52d482664f1e26976e8401b39e95cd838e25998', tvlUsd: 1005528, createdAt: 1789499843 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Optimism (10), router ABI ng5. On-chain checks at block 159152475: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/optimism.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_10: CurveChainPools = {\n chainId: 10,\n builtAt: '2026-11-05',\n block: 159152475,\n pools: [\n { address: '0xD1b30BA128573fcd7D141C8A987961b40e047BB6', name: 'crvUSD/USDT', coins: ['0xC52D7F23a2e460248Db6eE192Cb23dD12bDDCbf6', '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xde251e17bf12e902d51f15ea5c2658888801dbb5f6c5095e226bdb808084bd98', tvlUsd: 250955, createdAt: 1703088383 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Gnosis (100), router ABI ng5. On-chain checks at block 49126652: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/xdai.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_100: CurveChainPools = {\n chainId: 100,\n builtAt: '2026-11-05',\n block: 49126652,\n pools: [\n { address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353', name: 'Curve.fi wxDAI/USDC/USDT', coins: ['0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', '0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83', '0x4ECaBa5870353805a9F068101A40E0f32ed605C6'], decimals: [18, 6, 6], poolType: 1, swapTypes: [1], codeHash: '0x855fc847a134dc1d35593a59c460e334938f53cb115b2befa8174138a1bb3df6', tvlUsd: 447779, createdAt: 1625016390 },\n { address: '0x0eCEC6F5276d2Ec6bB864F063D2b76393d6A1A74', name: 'USDCe/EURe', coins: ['0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0', '0x420CA0f9B9b604cE0fd9C18EF134C705e5Fa3430'], decimals: [6, 18], poolType: 20, swapTypes: [1], codeHash: '0x0287322b54143499eae6ce611f7895d7f37426f60565a7d1e228dac396ad1a89', tvlUsd: 360118, createdAt: 1786365280 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Monad (143), router ABI lite4. On-chain checks at block 119683641: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api2.curve.finance/get_pools/143.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_143: CurveChainPools = {\n chainId: 143,\n builtAt: '2026-11-05',\n block: 119683641,\n pools: [\n { address: '0xFd945d71D4E9609a1FAb0aE9c30dA8088E7AEE1E', name: 'USDat/USDC', coins: ['0x0Bb150DFa86EA5d7742F07FEfCD8E8edA81D64eF', '0x754704Bc059F8C67012fEd69BC8A327a5aafb603'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0xd5d05317249e8e17bd8c67a05048a7115ec719e3f4198ddfa560b7c0b3b620f6', tvlUsd: 2005448, createdAt: 1784210436 },\n { address: '0x942644106B073E30D72c2C5D7529D5C296ea91ab', name: '3pool', coins: ['0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a', '0x754704Bc059F8C67012fEd69BC8A327a5aafb603', '0xe7cd86e13AC4309349F30B3435a9d337750fC82D'], decimals: [6, 6, 6], poolType: 10, swapTypes: [1], codeHash: '0x93a67dae1693a9327ff151167502f6785ac856025182eebd61150f4e0ea92ffa', tvlUsd: 1442204, createdAt: 1763939652 },\n { address: '0xD665CaAD68ACb093AFF27eC6c71Ccc4F29c28147', name: 'AUSD/trUSD', coins: ['0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a', '0x770a579Ea200784723B31b8668b0773ba80393c9'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0xb7af5a0364e252d950458f28c2d14434dd2961cef09ca1e2f90d7b1a96403a00', tvlUsd: 683014, createdAt: 1790778034 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// X Layer (196), router ABI lite4. On-chain checks at block 75134757: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/x-layer.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_196: CurveChainPools = {\n chainId: 196,\n builtAt: '2026-11-05',\n block: 75134757,\n pools: [\n { address: '0x5B3f7F05b79f3cCBe8F33374A578e14dBBb28478', name: 'USDC/USDT0', coins: ['0xB6CEceAB302E2E4948951eE7843FC24E92933061', '0x779Ded0c9e1022225f8E0630b35a9b54bE713736'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x78281e9e5a691fe225a5c246be69cc35d48e81f4e1c0bcca178121fa41612961', tvlUsd: 300301, createdAt: 1786522937 },\n { address: '0x31F066aA0A687d4F383F96a514984AF727Eb8e38', name: 'USDG/USD0', coins: ['0x4ae46a509F6b1D9056937BA4500cb143933D2dc8', '0x779Ded0c9e1022225f8E0630b35a9b54bE713736'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x855800c63268949eadd5206e5729c69e768f017722f275e90c4185b1fb0733bc', tvlUsd: 300095, createdAt: 1758717026 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Base (8453), router ABI ng5. On-chain checks at block 53566756: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/base.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_8453: CurveChainPools = {\n chainId: 8453,\n builtAt: '2026-11-05',\n block: 53566756,\n pools: [\n { address: '0x302A94E3C28c290EAF2a4605FC52e11Eb915f378', name: 'superOETHb/WETH', coins: ['0x4200000000000000000000000000000000000006', '0xDBFeFD2e8460a6Ee4955A68582F85708BAEA60A3'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0xd77abce9f34194324a3f8633aa5132f90aaa293ce9b1d7cfe9616bfaff0b9794', tvlUsd: 5842454, createdAt: 1737744997 },\n { address: '0x11C1fBd4b3De66bC0565779b35171a6CF3E71f59', name: 'Curve.fi Factory Crypto Pool: cbETH/WETH', coins: ['0x4200000000000000000000000000000000000006', '0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22'], decimals: [18, 18], poolType: 2, swapTypes: [1], codeHash: '0xbba8650811de0f6d2cc92316e9826589443d72feebb6805b2655e81073abe834', tvlUsd: 1016724, createdAt: 1693260297 },\n { address: '0xfac15A759d0F887Bc7F5ab874491258CF6EC8acE', name: 'TriBitcoin', coins: ['0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf', '0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b', '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c'], decimals: [8, 18, 8], poolType: 10, swapTypes: [1], codeHash: '0x51b2520df586800fd89a56f3a098e1a50e175f72b28088201682deb31bec0022', tvlUsd: 563901, createdAt: 1760081729 },\n { address: '0x6e53131F68a034873b6bFA15502aF094Ef0c5854', name: 'tricrypto', coins: ['0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', '0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b', '0x4200000000000000000000000000000000000006'], decimals: [18, 18, 18], poolType: 30, swapTypes: [1], codeHash: '0x437ca50fd4d25807efaa7d45077d247057a5e16b90609fcfde0b51f3673426d3', tvlUsd: 270418, createdAt: 1693263329 },\n { address: '0xf6C5F01C7F3148891ad0e19DF78743D31E390D1f', name: 'Curve.fi Factory Plain Pool: 4pool', coins: ['0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', '0xEB466342C4d449BC9f53A865D5Cb90586f405215', '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93'], decimals: [6, 6, 6, 18], poolType: 1, swapTypes: [1], codeHash: '0xca87b5689cf421c7b6a160ea2b22bd23ef9267477918f39a2bbdf3cb838a987d', tvlUsd: 254106, createdAt: 1693751021 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Plasma (9745), router ABI lite4. On-chain checks at block 36960466: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api2.curve.finance/get_pools/9745.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_9745: CurveChainPools = {\n chainId: 9745,\n builtAt: '2026-11-05',\n block: 36960466,\n pools: [\n { address: '0x2D84D79C852f6842AbE0304b70bBaA1506AdD457', name: 'USDT0/USDe', coins: ['0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb', '0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0xc001cdbdd189f52d922cba4eec3137b5698c715d2370d67a41b937e7793b8bd2', tvlUsd: 719322, createdAt: 1758191172 },\n { address: '0x085BaD2C28Bdd4A40396072D3eb2636BF7Afa39c', name: 'yzUSD/USDT0', coins: ['0x6695c0f8706C5ACe3Bdf8995073179cCA47926dc', '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0x8714b6160e5494b54383f64ebd4c8607093175dd697e48655cfd21df80b81804', tvlUsd: 596466, createdAt: 1762342995 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Arbitrum (42161), router ABI ng5. On-chain checks at block 521558965: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/arbitrum.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_42161: CurveChainPools = {\n chainId: 42161,\n builtAt: '2026-11-05',\n block: 521558965,\n pools: [\n { address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353', name: 'Curve.fi USDC/USDT', coins: ['0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'], decimals: [6, 6], poolType: 1, swapTypes: [1], codeHash: '0xc9c2956ac40175996b15ae3a750b84226736322c5c1aef3e6815b77aab3cb27e', tvlUsd: 630740, createdAt: 1631439440 },\n { address: '0x186cF879186986A20aADFb7eAD50e3C20cb26CeC', name: '2BTC-ng', coins: ['0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', '0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40'], decimals: [8, 18], poolType: 10, swapTypes: [1], codeHash: '0xaeb505d765c57572cafa881bfcae2cba4e39f933fa7eea85e952ca3b5e1e6a7d', tvlUsd: 509842, createdAt: 1718829260 },\n { address: '0x82670f35306253222F8a165869B28c64739ac62e', name: 'Tricrypto-crvUSD', coins: ['0x498Bf2B1e120FeD3ad3D42EA2165E9b73f99C1e5', '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1'], decimals: [18, 8, 18], poolType: 30, swapTypes: [1], codeHash: '0x35da327ca48b6e428478467c3996176d71855383e82d30664f95886822fd507d', tvlUsd: 328993, createdAt: 1704150579 },\n { address: '0x49b720F1Aab26260BEAec93A7BeB5BF2925b2A8F', name: 'Strategic USD Reserves', coins: ['0xaf88d065e77c8cC2239327C5EDb3A432268e5831', '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x27724587b6447859a96567a97e5bf015b8e5ae3d90ffdbe97a098c30b268703c', tvlUsd: 257764, createdAt: 1739092049 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs. Do not edit by hand: rerun the script.\nimport type { CurveChainPools } from './types.js'\nimport { POOLS_1 } from './1.js'\nimport { POOLS_10 } from './10.js'\nimport { POOLS_100 } from './100.js'\nimport { POOLS_143 } from './143.js'\nimport { POOLS_196 } from './196.js'\nimport { POOLS_8453 } from './8453.js'\nimport { POOLS_9745 } from './9745.js'\nimport { POOLS_42161 } from './42161.js'\n\nexport type { CurveChainPools, CurvePool, Hex } from './types.js'\n\n/** Curated Curve pools per chain id. A chain missing here has no pool that passed the rules. */\nexport const CURVE_POOLS: Readonly<Record<number, CurveChainPools>> = Object.freeze({\n 1: POOLS_1,\n 10: POOLS_10,\n 100: POOLS_100,\n 143: POOLS_143,\n 196: POOLS_196,\n 8453: POOLS_8453,\n 9745: POOLS_9745,\n 42161: POOLS_42161,\n})\n","/**\n * Routes over the curated pool allowlist: a token graph built from the pools the package pins (coins, and the\n * underlying coins of metapools that allow `exchange_underlying`), plus the router's own pseudo-hops — swap_type 8\n * between the native coin and the pinned wrapped native, and on router v1.2 swap_type 9 between crvUSD and scrvUSD.\n * Routes cross at most {@link MAX_ROUTE_POOLS} pools. A token a route hands its funds through between two hops must be\n * one the swap2-assets catalog lists on the chain by address, or the native coin / the pinned wrapped native\n * ({@link intermediateAllowed}); a pool's other coins, which the route does not touch, may be anything the allowlist\n * admitted. `exchange_underlying` (swap_type 2) runs on a metapool only while its base pool is allowlisted too.\n *\n * `checkRoute` is the same rule set read back from router arguments: what the provider builds, `curveVerifyQuote`\n * (on the client, for a remote quote) and `preflightDeposit` all pass through it.\n */\nimport {getAddress} from \"viem\";\nimport {ccAssetByToken} from \"@anywalletkit/swap2-assets\";\nimport type {RouterArgs} from \"./abi.js\";\nimport {CURVE_DENIED_POOLS, MAX_ROUTE_POOLS, MAX_ROUTE_STEPS, ZERO_ADDRESS, type CurveDeployment} from \"./deployments.js\";\nimport type {CurveChainPools, CurvePool, Hex} from \"./pools/types.js\";\n\n/** One router step: a pool swap, the native ↔ wrapped-native hop (8) or the ERC-4626 hop (9). */\nexport type CurveStep =\n | {kind: \"pool\"; pool: CurvePool; swapType: 1 | 2; i: number; j: number; tokenIn: Hex; tokenOut: Hex}\n | {kind: \"wrap\"; weth: Hex; tokenIn: Hex; tokenOut: Hex}\n | {kind: \"erc4626\"; vault: Hex; deposit: boolean; tokenIn: Hex; tokenOut: Hex};\n\nexport interface CurveRoute {\n steps: readonly CurveStep[];\n /** Human description for the review / logs, e.g. \"3pool\", \"wrap → TricryptoUSDT\". */\n label: string;\n}\n\n/** Most candidate routes priced for one quote (three JSON-RPC batches of ten). */\nexport const MAX_QUOTE_CANDIDATES = 30;\n/** Partial paths explored before the search gives up (an allowlist far larger than any curated one). */\nconst MAX_EXPLORED = 20_000;\n\nconst lc = (a: string) => a.toLowerCase();\nconst STABLE_POOL_TYPES = new Set([1, 10]);\n\n/**\n * Whether a route may hand the swap through `token` between two hops on `chainId`: the router's native sentinel, the\n * pinned wrapped native, or a token the swap2-assets catalog lists on that chain, matched by address. The source and\n * the destination follow the engine's listed / unlisted token policy instead (as for every provider).\n */\nexport function intermediateAllowed(chainId: number, deployment: CurveDeployment, token: string): boolean {\n const t = lc(token);\n if (t === lc(deployment.eth)) return true;\n if (t === lc(deployment.weth)) return t !== lc(ZERO_ADDRESS);\n if (!/^0x[0-9a-f]{40}$/.test(t) || t === lc(ZERO_ADDRESS)) return false;\n const listed = ccAssetByToken(`eip155:${chainId}`, t);\n return !!listed?.contract && lc(listed.contract) === t;\n}\n\n/**\n * Whether `exchange_underlying` (swap_type 2) may run on `pool`, given the chain's allowlisted pools `index`: only on a\n * metapool that names its base pool, with that base pool itself allowlisted (and not denied), and `underlying` the\n * meta coins followed by the base pool's coins. Never on a lending pool (no base pool): its underlying route deposits\n * into the lending venue, which a `get_dy` view never touches (Aave v2 on Polygon has every reserve frozen).\n */\nexport function underlyingAllowed(pool: CurvePool, index: ReadonlyMap<string, CurvePool>): boolean {\n const under = pool.underlying;\n if (!under || under.length < 2 || !pool.swapTypes.includes(2)) return false;\n if (!pool.basePool) return false;\n const base = index.get(lc(pool.basePool));\n if (!base || base === pool) return false;\n const meta = pool.coins.length - 1;\n if (under.length !== meta + base.coins.length) return false;\n return under.every((c, k) => lc(c) === lc(k < meta ? pool.coins[k]! : base.coins[k - meta]!));\n}\n\n/** Pool types the router family can execute: `[4][5]` routers speak only to NG pools (stable-ng, twocrypto-ng, tricrypto-ng). */\nexport function poolTypeAllowed(family: CurveDeployment[\"family\"], poolType: number): boolean {\n return family === \"ng5\" ? [1, 2, 3, 10, 20, 30].includes(poolType) : [10, 20, 30].includes(poolType);\n}\n\ninterface Graph {\n edges: Map<string, CurveStep[]>;\n byAddress: Map<string, CurvePool>;\n}\n\nconst graphs = new WeakMap<CurveChainPools, WeakMap<CurveDeployment, Graph>>();\n\n/** Allowlisted pools by address (lowercase), denied pools left out. */\nexport function poolIndex(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined): Map<string, CurvePool> {\n return graphFor(chainId, deployment, table).byAddress;\n}\n\nfunction graphFor(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined): Graph {\n if (!table) return {edges: new Map(), byAddress: new Map()};\n let perDeployment = graphs.get(table);\n if (!perDeployment) graphs.set(table, (perDeployment = new WeakMap()));\n let g = perDeployment.get(deployment);\n if (g) return g;\n g = {edges: new Map(), byAddress: new Map()};\n const denied = CURVE_DENIED_POOLS[chainId];\n const eth = lc(deployment.eth);\n const add = (s: CurveStep) => {\n const k = lc(s.tokenIn);\n const list = g!.edges.get(k);\n if (list) list.push(s);\n else g!.edges.set(k, [s]);\n };\n for (const pool of table.chainId === chainId ? table.pools : []) {\n const key = lc(pool.address);\n if (denied?.has(key) || g.byAddress.has(key) || !poolTypeAllowed(deployment.family, pool.poolType)) continue;\n if (!/^0x[0-9a-fA-F]{40}$/.test(pool.address) || pool.coins.length < 2 || pool.coins.length > 8) continue;\n // A `[4][5]` router never forwards the native coin to a pool: a pool listing it would take nothing.\n if (deployment.family === \"lite4\" && [...pool.coins, ...(pool.underlying ?? [])].some((c) => lc(c) === eth)) continue;\n g.byAddress.set(key, pool);\n }\n // Edges once every pool is indexed: a metapool's underlying edges need its base pool's entry.\n for (const pool of g.byAddress.values()) {\n const pairs = new Set<string>();\n if (pool.swapTypes.includes(1)) {\n pool.coins.forEach((a, i) => pool.coins.forEach((b, j) => {\n if (i === j || lc(a) === lc(b)) return;\n pairs.add(`${lc(a)}>${lc(b)}`);\n add({kind: \"pool\", pool, swapType: 1, i, j, tokenIn: getAddress(a), tokenOut: getAddress(b)});\n }));\n }\n const under = pool.underlying;\n if (under && underlyingAllowed(pool, g.byAddress) && (deployment.family === \"ng5\" || pool.poolType === 10)) {\n under.forEach((a, i) => under.forEach((b, j) => {\n if (i === j || lc(a) === lc(b) || pairs.has(`${lc(a)}>${lc(b)}`)) return;\n add({kind: \"pool\", pool, swapType: 2, i, j, tokenIn: getAddress(a), tokenOut: getAddress(b)});\n }));\n }\n }\n if (lc(deployment.weth) !== lc(ZERO_ADDRESS)) {\n add({kind: \"wrap\", weth: getAddress(deployment.weth), tokenIn: getAddress(deployment.eth), tokenOut: getAddress(deployment.weth)});\n add({kind: \"wrap\", weth: getAddress(deployment.weth), tokenIn: getAddress(deployment.weth), tokenOut: getAddress(deployment.eth)});\n }\n const v = erc4626Of(deployment);\n if (v) {\n add({kind: \"erc4626\", vault: getAddress(v.vault), deposit: true, tokenIn: getAddress(v.asset), tokenOut: getAddress(v.vault)});\n add({kind: \"erc4626\", vault: getAddress(v.vault), deposit: false, tokenIn: getAddress(v.vault), tokenOut: getAddress(v.asset)});\n }\n perDeployment.set(deployment, g);\n return g;\n}\n\n/** The ERC-4626 hop a deployment may use: only a `[5][5]` router at v1.2 (v1.1 reverts \"Bad swap type\"). */\nfunction erc4626Of(d: CurveDeployment): {vault: Hex; asset: Hex} | undefined {\n return d.erc4626 && d.family === \"ng5\" && d.version === \"1.2.0\" ? d.erc4626 : undefined;\n}\n\nconst minTvl = (r: readonly CurveStep[]) => r.reduce((m, s) => (s.kind === \"pool\" ? Math.min(m, s.pool.tvlUsd) : m), Number.POSITIVE_INFINITY);\nconst poolCount = (r: readonly CurveStep[]) => r.filter((s) => s.kind === \"pool\").length;\n\n/**\n * Candidate routes tokenIn → tokenOut: at most {@link MAX_ROUTE_POOLS} pools and {@link MAX_ROUTE_STEPS} steps, no\n * token or pool twice, at most one wrap and one ERC-4626 hop. Ranked fewest pools first, then by the thinnest pool's\n * TVL, and cut to `limit`. `truncated` says the cut (or the search budget) dropped some.\n */\nexport function findRoutes(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined, tokenIn: Hex, tokenOut: Hex, limit = MAX_QUOTE_CANDIDATES): {routes: CurveRoute[]; truncated: boolean} {\n const g = graphFor(chainId, deployment, table);\n const want = lc(tokenOut);\n const found: CurveStep[][] = [];\n let explored = 0;\n let exhausted = false;\n const walk = (at: string, path: CurveStep[], seenTokens: Set<string>, seenPools: Set<string>) => {\n if (exhausted) return;\n for (const s of g.edges.get(at) ?? []) {\n if (++explored > MAX_EXPLORED) { exhausted = true; return; }\n const next = lc(s.tokenOut);\n if (seenTokens.has(next)) continue;\n if (next !== want && !intermediateAllowed(chainId, deployment, next)) continue;\n if (s.kind === \"pool\" && (seenPools.has(lc(s.pool.address)) || poolCount(path) >= MAX_ROUTE_POOLS)) continue;\n if (s.kind !== \"pool\" && path.some((p) => p.kind === s.kind)) continue;\n const steps = [...path, s];\n if (next === want) {\n if (poolCount(steps) > 0 || steps.some((x) => x.kind === \"erc4626\")) found.push(steps);\n continue;\n }\n if (steps.length >= MAX_ROUTE_STEPS) continue;\n seenTokens.add(next);\n if (s.kind === \"pool\") seenPools.add(lc(s.pool.address));\n walk(next, steps, seenTokens, seenPools);\n seenTokens.delete(next);\n if (s.kind === \"pool\") seenPools.delete(lc(s.pool.address));\n }\n };\n walk(lc(tokenIn), [], new Set([lc(tokenIn)]), new Set());\n found.sort((a, b) => poolCount(a) - poolCount(b) || minTvl(b) - minTvl(a) || a.length - b.length);\n return {routes: found.slice(0, limit).map((steps) => ({steps, label: labelOf(steps)})), truncated: exhausted || found.length > limit};\n}\n\nfunction labelOf(steps: readonly CurveStep[]): string {\n return steps.map((s) => (s.kind === \"pool\" ? `${s.pool.name}${s.swapType === 2 ? \" (underlying)\" : \"\"}` : s.kind === \"wrap\" ? (s.tokenOut === s.weth ? \"wrap\" : \"unwrap\") : s.deposit ? \"scrvUSD deposit\" : \"scrvUSD redeem\")).join(\" → \");\n}\n\n/** The router's `_route` / `_swap_params` for a route, in the deployment's ABI family. */\nexport function routeArgs(family: CurveDeployment[\"family\"], route: CurveRoute): RouterArgs {\n if (route.steps.length < 1 || route.steps.length > MAX_ROUTE_STEPS) throw new Error(`curve: a route has 1–${MAX_ROUTE_STEPS} steps`);\n const path: Hex[] = [route.steps[0]!.tokenIn];\n const params: bigint[][] = [];\n for (const s of route.steps) {\n const swap = s.kind === \"pool\" ? s.pool.address : s.kind === \"wrap\" ? s.weth : s.vault;\n path.push(getAddress(swap), s.tokenOut);\n const row = s.kind === \"pool\"\n ? [BigInt(s.i), BigInt(s.j), BigInt(s.swapType), BigInt(s.pool.poolType), BigInt((s.swapType === 2 ? s.pool.underlying! : s.pool.coins).length)]\n : s.kind === \"wrap\" ? [0n, 0n, 8n, 0n, 0n] : [s.deposit ? 0n : 1n, 0n, 9n, 0n, 0n];\n params.push(family === \"ng5\" ? row : row.slice(0, 4));\n }\n while (path.length < 11) path.push(ZERO_ADDRESS);\n const cols = family === \"ng5\" ? 5 : 4;\n while (params.length < 5) params.push(new Array<bigint>(cols).fill(0n));\n return {route: path, params};\n}\n\n/** Pool addresses a route's router arguments cross, in order. */\nexport function routePools(args: RouterArgs): Hex[] {\n const out: Hex[] = [];\n for (let k = 0; k < 5; k++) {\n const swap = args.route[2 * k + 1];\n const t = args.params[k]?.[2];\n if (!swap || lc(swap) === lc(ZERO_ADDRESS)) break;\n if (t === 1n || t === 2n) out.push(swap);\n }\n return out;\n}\n\n/**\n * Whether router arguments are a route this module would build on `chainId`: from `tokenIn` to `tokenOut`, every pool\n * hop through an allowlisted (and not denied) pool whose pinned coins at `i`/`j` are the hop's tokens, with the pool's\n * own pool type, an allowed swap type (1, or 2 for a metapool listing it whose base pool is allowlisted too) and its\n * coin count; every token between two hops a catalog token, the native coin or the pinned wrapped native; swap_type 8 only through\n * the pinned wrapped native between it and the native sentinel; swap_type 9 only on a v1.2 router through its pinned\n * ERC-4626 vault; no other swap type; at most {@link MAX_ROUTE_POOLS} pools, {@link MAX_ROUTE_STEPS} steps, no pool\n * twice, and nothing after the route's end. The reason it is not, or null.\n */\nexport function checkRoute(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined, args: RouterArgs, tokenIn: string, tokenOut: string): string | null {\n const cols = deployment.family === \"ng5\" ? 5 : 4;\n if (args.route.length !== 11 || args.params.length !== 5 || args.params.some((r) => r.length !== cols)) return `the route is not address[11] with uint256[${cols}][5]`;\n const index = poolIndex(chainId, deployment, table);\n const zero = lc(ZERO_ADDRESS);\n const eth = lc(deployment.eth);\n const weth = lc(deployment.weth);\n const v = erc4626Of(deployment);\n let steps = 0;\n while (steps < 5 && lc(args.route[2 * steps + 1]!) !== zero) steps++;\n if (steps === 0) return \"the route has no step\";\n if (steps > MAX_ROUTE_STEPS) return `the route has ${steps} steps, more than ${MAX_ROUTE_STEPS}`;\n for (let k = 2 * steps + 1; k < 11; k++) if (lc(args.route[k]!) !== zero) return \"the route names addresses after its end\";\n for (let k = steps; k < 5; k++) if (args.params[k]!.some((x) => x !== 0n)) return \"the swap params carry rows after the route's end\";\n if (lc(args.route[0]!) !== lc(tokenIn)) return `the route starts at ${args.route[0]}, not the source token`;\n if (lc(args.route[2 * steps]!) !== lc(tokenOut)) return `the route ends at ${args.route[2 * steps]}, not the destination token`;\n for (let k = 1; k < steps; k++) {\n if (!intermediateAllowed(chainId, deployment, args.route[2 * k]!)) return `step ${k} hands the swap through ${args.route[2 * k]}, a token the catalog does not list on this chain`;\n }\n const pools = new Set<string>();\n let wraps = 0;\n let vaults = 0;\n for (let k = 0; k < steps; k++) {\n const a = lc(args.route[2 * k]!);\n const swap = lc(args.route[2 * k + 1]!);\n const b = lc(args.route[2 * k + 2]!);\n const row = args.params[k]!;\n const type = row[2]!;\n if (a === b) return `step ${k + 1} trades a token for itself`;\n if (type === 1n || type === 2n) {\n if (CURVE_DENIED_POOLS[chainId]?.has(swap)) return `step ${k + 1} crosses ${args.route[2 * k + 1]}, a pool this module refuses (fake coin, drained in 2023, or over a dead venue)`;\n const pool = index.get(swap);\n if (!pool) return `step ${k + 1} crosses ${args.route[2 * k + 1]}, which is not in the pool allowlist`;\n if (pools.has(swap)) return `the route crosses ${args.route[2 * k + 1]} twice`;\n pools.add(swap);\n if (!pool.swapTypes.includes(type === 1n ? 1 : 2)) return `step ${k + 1} uses swap_type ${type}, which pool ${pool.name} does not allow`;\n if (row[3] !== BigInt(pool.poolType)) return `step ${k + 1} names pool_type ${row[3]}, not pool ${pool.name}'s ${pool.poolType}`;\n if (type === 2n && deployment.family === \"lite4\" && pool.poolType !== 10) return `step ${k + 1}: exchange_underlying is for stable-ng metapools on this router`;\n if (type === 2n && !underlyingAllowed(pool, index)) return `step ${k + 1}: exchange_underlying on pool ${pool.name} needs its base pool in the allowlist`;\n const list = type === 1n ? pool.coins : pool.underlying;\n if (!list) return `step ${k + 1}: pool ${pool.name} lists no underlying coins`;\n const i = row[0]!, j = row[1]!;\n if (i >= BigInt(list.length) || j >= BigInt(list.length) || i === j) return `step ${k + 1}: coin indexes ${i}/${j} are not two coins of pool ${pool.name}`;\n // i, j < list.length (≤ 8) here: Number() of the decimal string is exact.\n if (lc(list[Number(i.toString())]!) !== a || lc(list[Number(j.toString())]!) !== b) return `step ${k + 1}: pool ${pool.name}'s coins ${i}/${j} are not the hop's tokens`;\n if (deployment.family === \"ng5\" && row[4] !== BigInt(list.length)) return `step ${k + 1} names ${row[4]} coins, not pool ${pool.name}'s ${list.length}`;\n if (deployment.family === \"lite4\" && (a === eth || b === eth)) return `step ${k + 1}: this router does not pass the native coin to pools`;\n if (STABLE_POOL_TYPES.has(pool.poolType) && (i > 127n || j > 127n)) return `step ${k + 1}: coin index out of range`;\n } else if (type === 8n) {\n if (weth === zero) return \"this chain's router has no wrapped native\";\n if (swap !== weth) return `step ${k + 1} wraps through ${args.route[2 * k + 1]}, not the pinned wrapped native`;\n if (!((a === eth && b === weth) || (a === weth && b === eth))) return `step ${k + 1}: swap_type 8 is only native ↔ the pinned wrapped native here`;\n if (row.some((x, c) => c !== 2 && x !== 0n)) return `step ${k + 1}: a wrap carries no other swap params`;\n if (++wraps > 1) return \"the route wraps more than once\";\n } else if (type === 9n) {\n if (!v) return `swap_type 9 (ERC-4626) is not available on ${deployment.label}'s router ${deployment.version}`;\n if (swap !== lc(v.vault)) return `step ${k + 1}: ERC-4626 hop through ${args.route[2 * k + 1]}, not the pinned vault`;\n const deposit = row[0] === 0n && a === lc(v.asset) && b === lc(v.vault);\n const redeem = row[0] === 1n && a === lc(v.vault) && b === lc(v.asset);\n if (!deposit && !redeem) return `step ${k + 1}: the ERC-4626 hop is not a deposit of the vault's asset or a redeem of its shares`;\n if (row.some((x, c) => c > 0 && c !== 2 && x !== 0n)) return `step ${k + 1}: an ERC-4626 hop carries no other swap params`;\n if (++vaults > 1) return \"the route crosses the vault more than once\";\n } else {\n return `step ${k + 1} uses swap_type ${type}, which this module never builds`;\n }\n }\n if (pools.size > MAX_ROUTE_POOLS) return `the route crosses ${pools.size} pools, more than ${MAX_ROUTE_POOLS}`;\n if (pools.size === 0 && vaults === 0) return \"the route crosses no pool\";\n return null;\n}\n","import {redactUrls, timeoutSignal} from \"@anywalletkit/protocol-swap2-core/util\";\n\nexport type RpcCall = {method: string; params: unknown[]};\n\n/** Largest JSON-RPC batch sent to one node (X Layer's public RPCs refuse more than 10). */\nexport const RPC_BATCH_MAX = 10;\n\n/** Pause before the endpoints are tried once more when the last one refused for its request rate. */\nexport const RPC_RATE_LIMIT_PAUSE_MS = 1_000;\n\n/**\n * A batch element's error that is still an answer about the call: the EVM ran it and stopped (a revert — geth's code 3 —\n * an invalid opcode, out of gas). Anything else says nothing about the call — a rate limit inside an HTTP-200 batch\n * (QuickNode's -32007 \"50/second request limit reached\"), a node fault — and the batch goes to the next endpoint.\n */\nexport function isExecutionError(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n const {code, message} = error as {code?: unknown; message?: unknown};\n return code === 3 || (typeof message === \"string\" && /revert|invalid opcode|out of gas/i.test(message));\n}\n\n/** A refusal for the request rate: HTTP 429, or JSON-RPC -32005 / -32007 / 429, or a message naming a limit. */\nfunction isRateLimit(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n const {code, message} = error as {code?: unknown; message?: unknown};\n return code === -32005 || code === -32007 || code === 429 || (typeof message === \"string\" && /rate|limit|too many/i.test(message));\n}\n\nconst errorText = (error: unknown): string => {\n const m = error && typeof error === \"object\" ? (error as {message?: unknown}).message : undefined;\n return redactUrls(typeof m === \"string\" ? m : JSON.stringify(error) ?? String(error)).slice(0, 160);\n};\n\n/**\n * JSON-RPC over the caller's endpoints for one chain: batches of at most {@link RPC_BATCH_MAX} calls, each batch tried\n * on the endpoints in order until one answers every call (once more after {@link RPC_RATE_LIMIT_PAUSE_MS} when the last\n * refusal was for the request rate). Each slot is the result, or null when that call reverted — a revert is an answer,\n * not a dead endpoint. An element error that is not an execution error, or a call left unanswered, fails the endpoint:\n * a rate-limited read is never returned as a missing code or coin.\n */\nexport function rpcClient(rpcUrls: Readonly<Record<number, readonly string[]>>) {\n async function once(url: string, calls: RpcCall[], signal?: AbortSignal): Promise<(unknown | null)[]> {\n const res = await fetch(url, {\n method: \"POST\",\n headers: {\"content-type\": \"application/json\"},\n body: JSON.stringify(calls.map((c, id) => ({jsonrpc: \"2.0\", id, ...c}))),\n signal: signal ?? timeoutSignal(12_000),\n });\n if (!res.ok) throw Object.assign(new Error(`HTTP ${res.status}`), {limited: res.status === 429});\n const body = (await res.json()) as {id: number; result?: unknown; error?: unknown}[] | {error?: {message?: string}};\n if (!Array.isArray(body)) throw Object.assign(new Error(body.error?.message ?? \"batch refused\"), {limited: isRateLimit(body.error)});\n const out: (unknown | null)[] = calls.map(() => null);\n const answered = new Set<number>();\n for (const r of body) {\n if (typeof r.id !== \"number\" || r.id < 0 || r.id >= out.length) continue;\n if (r.error !== undefined && r.error !== null && !isExecutionError(r.error)) throw Object.assign(new Error(errorText(r.error)), {limited: isRateLimit(r.error)});\n answered.add(r.id);\n if (r.error === undefined || r.error === null) out[r.id] = r.result ?? null;\n }\n if (answered.size !== calls.length) throw new Error(`answered ${answered.size} of ${calls.length} calls`);\n return out;\n }\n\n async function batch(chainId: number, calls: RpcCall[], signal?: AbortSignal): Promise<(unknown | null)[]> {\n let lastErr: unknown;\n for (let pass = 0; pass < 2; pass++) {\n if (pass > 0) {\n if (!(lastErr as {limited?: boolean} | undefined)?.limited || signal?.aborted) break;\n await new Promise((r) => setTimeout(r, RPC_RATE_LIMIT_PAUSE_MS));\n }\n for (const url of rpcUrls[chainId] ?? []) {\n try {\n return await once(url, calls, signal);\n } catch (e) {\n lastErr = e;\n }\n }\n }\n throw new Error(`curve: no RPC answered on chain ${chainId} (${lastErr instanceof Error ? lastErr.message : String(lastErr)})`);\n }\n return async function rpc(chainId: number, calls: RpcCall[], signal?: AbortSignal): Promise<(unknown | null)[]> {\n if (calls.length <= RPC_BATCH_MAX) return batch(chainId, calls, signal);\n const chunks: RpcCall[][] = [];\n for (let i = 0; i < calls.length; i += RPC_BATCH_MAX) chunks.push(calls.slice(i, i + RPC_BATCH_MAX));\n return (await Promise.all(chunks.map((c) => batch(chainId, c, signal)))).flat();\n };\n}\n\nexport const ethCall = (to: string, data: string): RpcCall => ({method: \"eth_call\", params: [{to, data}, \"latest\"]});\n\n/** The first 32-byte ABI word of a return (whole words, at least one) as 64 lowercase hex, or null. */\nfunction firstWord(raw: unknown): string | null {\n return typeof raw === \"string\" && raw.length >= 66 && /^0x(?:[0-9a-fA-F]{64})+$/.test(raw) ? raw.slice(2, 66).toLowerCase() : null;\n}\n\n/**\n * A return whose first ABI word holds an address → the address (lowercase), or null when the word's upper 12 bytes are\n * not zero. Only the first word is read: the Liquity factory metapool answers `coins(i)` with 4096 bytes.\n */\nexport function wordAddress(raw: unknown): string | null {\n const w = firstWord(raw);\n return w !== null && /^0{24}/.test(w) ? `0x${w.slice(24)}` : null;\n}\n\n/** A return's first ABI word → uint256, or null. */\nexport function wordUint(raw: unknown): bigint | null {\n const w = firstWord(raw);\n return w === null ? null : BigInt(`0x${w}`);\n}\n","import {bigintToNumber} from \"@anywalletkit/core\";\nimport {ccAssetByToken} from \"@anywalletkit/swap2-assets\";\nimport {suggestSlippage} from \"@anywalletkit/protocol-swap2-core/slippage\";\nimport {sourceAssetOf} from \"@anywalletkit/protocol-swap2-core/util\";\nimport type {QuoteParams} from \"@anywalletkit/protocol-swap2-core/types\";\n\n/**\n * The route's price impact in bps: a probe 1/1000 the size on the same route gives the marginal rate; the full-size\n * rate's shortfall against it is the impact (pool fees are paid on both sides and cancel). Undefined without a probe.\n */\nexport function curveImpactBps(amountIn: bigint, out: bigint, probeOut: bigint | null | undefined): number | undefined {\n const probeIn = amountIn / 1000n;\n if (probeIn <= 0n || probeOut === null || probeOut === undefined || probeOut <= 0n) return undefined;\n const ratioBps = (out * probeIn * 10_000n) / (probeOut * amountIn);\n return Math.max(0, bigintToNumber(10_000n - ratioBps));\n}\n\n/**\n * Slippage when the caller names none: `suggestSlippage` from swap2-core for the pair (catalog symbols) and the route's\n * price impact — stable ↔ stable 10 bps, majors 50, others 100, plus half the impact. The provider sizes its minimum\n * with it, and `curveRemotePins` re-derives it on the device to bound a remote build's minimum.\n */\nexport function curveAutoSlippageBps(params: QuoteParams, priceImpactBps: number | undefined): number {\n const nativeOut = /^0x0+$/.test(params.destToken);\n return suggestSlippage({\n fromChain: params.sourceChain,\n toChain: params.destChain,\n fromSymbol: sourceAssetOf(params)?.symbol ?? \"\",\n toSymbol: ccAssetByToken(params.destChain, nativeOut ? \"\" : params.destToken)?.symbol ?? \"\",\n ...(priceImpactBps !== undefined ? {priceImpactBps} : {}),\n }).bps;\n}\n","/** `curve:<chainId>:<16 hex>`, and on the wire of a swap2 server `~<32 hex>` (its intent token) after it. */\nconst INTENT_ID = /^curve:([1-9][0-9]{0,15}):[0-9a-f]{16}(?:~[0-9a-f]{32})?$/;\n\n/** A fresh Curve intent id for a quote on `chainId`: one per quote, so a remote stub never checks a build against another request. */\nexport function mintCurveIntentId(chainId: number): string {\n const nonce = globalThis.crypto.getRandomValues(new Uint8Array(8));\n return `curve:${chainId}:${Array.from(nonce, (b) => b.toString(16).padStart(2, \"0\")).join(\"\")}`;\n}\n\n/** The chain a Curve intent id names (its on-chain checks and receipt tracking run there), or null. */\nexport function curveIntentChain(intentId: unknown): number | null {\n const m = typeof intentId === \"string\" ? INTENT_ID.exec(intentId) : null;\n const id = m ? Number(m[1]) : NaN;\n return Number.isSafeInteger(id) ? id : null;\n}\n","import {decodeFunctionResult, encodeFunctionData, keccak256, type Hex as ViemHex} from \"viem\";\nimport {sourceAssetOf} from \"@anywalletkit/protocol-swap2-core/util\";\nimport {slippageFloor} from \"@anywalletkit/protocol-swap2-core/validate\";\nimport type {Quote, QuoteParams, RemotePins, UnsignedTx} from \"@anywalletkit/protocol-swap2-core/types\";\nimport {ADDRESS_PROVIDER_ABI, COINS_INT, COINS_UINT, EXCHANGE_SELECTOR, VERSION_ABI, decodeExchange, encodeGetDy, type DecodedExchange} from \"./abi.js\";\nimport {CURVE_DEPLOYMENTS, ZERO_ADDRESS, chainIdOf, deploymentOf, type CurveDeployment} from \"./deployments.js\";\nimport {CURVE_POOLS} from \"./pools/index.js\";\nimport type {CurveChainPools, CurvePool, Hex} from \"./pools/types.js\";\nimport {checkRoute, poolIndex, routePools} from \"./routes.js\";\nimport {ethCall, rpcClient, wordAddress, wordUint, type RpcCall} from \"./rpc.js\";\nimport {curveIntentChain} from \"./intent.js\";\nimport {curveAutoSlippageBps, curveImpactBps} from \"./slippage.js\";\n\nexport interface CurveTables {\n /** Override the deployments (tests). */\n deployments?: Readonly<Record<number, CurveDeployment>>;\n /** Override the pool allowlist (tests). */\n pools?: Readonly<Record<number, CurveChainPools>>;\n}\n\nconst lc = (a: string) => a.toLowerCase();\nconst isAddress = (a: string) => /^0x[0-9a-fA-F]{40}$/.test(a);\nconst own = <T>(o: Readonly<Record<number, T>>, k: number): T | undefined => (Object.prototype.hasOwnProperty.call(o, k) ? o[k] : undefined);\n\n/**\n * The check of a Curve quote's router call against the app's own request, with the tables it uses. The returned\n * function is {@link curveVerifyQuote} for the shipped tables: synchronous, no I/O — the allowlist is static.\n */\nexport function curveQuoteCheck(tables: CurveTables = {}): (params: QuoteParams, quote: Quote) => string | null {\n const deployments = tables.deployments ?? CURVE_DEPLOYMENTS;\n const pools = tables.pools ?? CURVE_POOLS;\n return function verify(params: QuoteParams, quote: Quote): string | null {\n const chainId = chainIdOf(params.sourceChain);\n const d = deploymentOf(deployments, chainId);\n if (!d || params.destChain !== params.sourceChain) return \"not a same-chain swap on a pinned Curve router\";\n const tx = quote.txRequest;\n if (!tx?.data || !tx.to || tx.serializedTx !== undefined) return \"the quote carries no router call\";\n if (!isAddress(tx.to) || lc(tx.to) !== lc(d.router)) return `the call targets ${tx.to}, not the Curve router`;\n if (tx.chainId !== undefined && tx.chainId !== chainId) return `the call is for chain ${tx.chainId}`;\n // The chain the build's on-chain checks and the receipt tracking run on (`curve:<chainId>:…`): this request's.\n if (curveIntentChain(quote.intentId) !== chainId) return `the quote names ${String(quote.intentId).slice(0, 40)}, not a curve:${chainId} swap`;\n const src = sourceAssetOf(params);\n if (!src) return `unknown source token ${params.sourceToken}`;\n const nativeIn = !src.contract;\n const nativeOut = /^0x0+$/.test(params.destToken);\n if (!nativeOut && !isAddress(params.destToken)) return \"destination token must be an EVM address\";\n if (!isAddress(params.destAddress)) return \"recipient must be an EVM address\";\n if ((!nativeIn && lc(src.contract!) === lc(d.eth)) || (!nativeOut && lc(params.destToken) === lc(d.eth))) return \"the router's native sentinel is not a token\";\n const tokenIn = nativeIn ? d.eth : src.contract!;\n const tokenOut = nativeOut ? d.eth : params.destToken;\n let amountIn: bigint, minOut: bigint, value: bigint;\n try {\n amountIn = BigInt(params.amountIn);\n minOut = BigInt(quote.minDestAmount);\n value = BigInt(tx.value ?? \"0\");\n } catch {\n return \"the request does not name amounts\";\n }\n if (nativeIn ? value !== amountIn || tx.approvalAddress !== undefined\n : value !== 0n || !tx.approvalAddress || !isAddress(tx.approvalAddress) || lc(tx.approvalAddress) !== lc(d.router)) {\n return nativeIn ? \"a native input is paid as exactly the input in value, with no approval\" : \"a token input attaches no value and approves exactly the Curve router\";\n }\n const call = decodeExchange(d.family, tx.data);\n if (!call) return \"the router call is not exchange(route, params, amount, min, receiver)\";\n if (call.selector !== EXCHANGE_SELECTOR[d.family]) return `selector ${call.selector} is not the explicit-receiver exchange ${EXCHANGE_SELECTOR[d.family]}`;\n if (!call.receiver || lc(call.receiver) !== lc(params.destAddress)) return `the swap pays ${call.receiver ?? \"the sender\"}, not the recipient`;\n if (call.pools && call.pools.some((p) => lc(p) !== lc(ZERO_ADDRESS))) return \"the call names zap pools this module never uses\";\n if (call.amount !== amountIn) return `the swap sells ${call.amount}, not the ${amountIn} input`;\n if (call.minDy <= 0n) return \"the swap has no minimum (min_dy 0)\";\n if (call.minDy !== minOut) return `the swap's minimum ${call.minDy} is not the quote's ${minOut}`;\n if (quote.providerData?.minOut !== undefined && quote.providerData.minOut !== minOut.toString()) return \"the quote's facts disagree on the minimum\";\n return checkRoute(chainId, d, own(pools, chainId), call, tokenIn, tokenOut);\n };\n}\n\n/**\n * The swap a Curve quote's router call makes, opened on the client against the app's own request: the explicit-receiver\n * `exchange` on the chain's pinned Router NG (`0xc872a3c5` on `[5][5]` routers, `0xfd44959c` on `[4][5]`), selling\n * exactly the input of the source token (the router's native sentinel for a native input, paid as exactly that\n * `value`; a token input attaches no value and approves exactly the router), for the destination token, with\n * `min_dy` the quote's minimum (never 0), paid to the recipient, no zap pools, and a route that `checkRoute` accepts:\n * allowlisted pools only, their pinned coins, swap types 1/2 (8 through the pinned wrapped native, 9 only on router\n * v1.2 through scrvUSD). The reason it fails, or null.\n */\nexport const curveVerifyQuote: (params: QuoteParams, quote: Quote) => string | null = curveQuoteCheck();\n\n/**\n * The Router NG a Curve swap calls and approves on a chain (the shipped {@link CURVE_DEPLOYMENTS} table), and\n * {@link curveVerifyQuote} — the app's pins for `remoteProvider({name: \"curve\", baseUrl, ...curvePins})`. For the build\n * checked on chain as well (router code hash, fresh `get_dy`, pool coins), use {@link curveRemotePins}.\n */\nexport const curvePins: RemotePins = Object.freeze({\n callTargets: (chain: string): readonly string[] => routerFor(CURVE_DEPLOYMENTS, chain),\n spenders: (chain: string): readonly string[] => routerFor(CURVE_DEPLOYMENTS, chain),\n verifyQuote: curveVerifyQuote,\n});\n\nfunction routerFor(deployments: Readonly<Record<number, CurveDeployment>>, chain: string): readonly string[] {\n const d = deploymentOf(deployments, chainIdOf(chain));\n return d ? [d.router] : [];\n}\n\nexport interface CurveOnChainOptions extends CurveTables {\n rpcUrls: Readonly<Record<number, readonly string[]>>;\n /** Told when the chain's AddressProvider lists another router than the pinned one (never acted on). Default console.warn. */\n onWarning?: (message: string) => void;\n}\n\n/**\n * On-chain checks shared by the provider and {@link curveRemotePins}: the pinned router's code hash and version (once\n * per chain; the AddressProvider's id 2 only compared), and a sealed quote re-checked right before broadcast.\n */\nexport function curveOnChain(opts: CurveOnChainOptions) {\n const deployments = opts.deployments ?? CURVE_DEPLOYMENTS;\n const pools = opts.pools ?? CURVE_POOLS;\n const rpc = rpcClient(opts.rpcUrls);\n const warn = opts.onWarning ?? ((m: string) => console.warn(m));\n const verified = new Map<number, Promise<void>>();\n\n /** The pinned router is still the code we pinned, at the version we pinned. */\n function verifyDeployment(chainId: number): Promise<void> {\n let p = verified.get(chainId);\n if (!p) {\n const d = deploymentOf(deployments, chainId);\n p = (async () => {\n if (!d) throw new Error(`curve: no pinned router on chain ${chainId}`);\n const [code, version, listed] = await rpc(chainId, [\n {method: \"eth_getCode\", params: [d.router, \"latest\"]},\n ethCall(d.router, encodeFunctionData({abi: VERSION_ABI, functionName: \"version\"})),\n ethCall(d.addressProvider, encodeFunctionData({abi: ADDRESS_PROVIDER_ABI, functionName: \"get_address\", args: [2n]})),\n ]);\n if (typeof code !== \"string\" || code.length <= 2 || lc(keccak256(code as ViemHex)) !== lc(d.codeHash)) {\n throw new Error(`curve: the router on chain ${chainId} is not the pinned code (code hash mismatch) — refusing`);\n }\n let v = \"\";\n try { v = typeof version === \"string\" ? decodeFunctionResult({abi: VERSION_ABI, functionName: \"version\", data: version as ViemHex}) : \"\"; } catch { /* below */ }\n if (v !== d.version) throw new Error(`curve: the router on chain ${chainId} reports version ${v || \"none\"}, not ${d.version} — refusing`);\n // The AddressProvider is informational (its admin may change any id): a different id 2 is a signal for the\n // module watch, never a router to use.\n const ap = wordAddress(listed);\n if (ap && ap !== lc(d.addressProviderRouter) && ap !== lc(d.router)) {\n warn(`curve: the AddressProvider on ${d.label} lists router ${ap} (id 2); this module keeps the pinned ${d.router}`);\n }\n })();\n p.catch(() => verified.delete(chainId));\n verified.set(chainId, p);\n }\n return p;\n }\n\n /**\n * A sealed quote right before broadcast (or a remote build on the client): the transaction is byte for byte the\n * quote's router call, the route passes `checkRoute`, the router was verified as the pinned code and version (once\n * per chain per process — it is immutable), every hop pool still has its pinned code and coins (re-read each time),\n * and a fresh `get_dy` of that exact route still pays at least the minimum. The reason it fails, or null.\n */\n async function checkSealed(quote: Quote, tx: UnsignedTx): Promise<string | null> {\n const r = await inspectSealed(quote, tx, false);\n return typeof r === \"string\" ? r : null;\n }\n\n /**\n * {@link checkSealed}, and what it read when it passes: the fresh `get_dy` of the exact route at the sealed amount,\n * the call's minimum and, with `probe`, the same route at 1/1000 of the amount (null when it reverts).\n */\n async function inspectSealed(quote: Quote, tx: UnsignedTx, probe: boolean): Promise<string | {out: bigint; probeOut: bigint | null; amount: bigint; minDy: bigint}> {\n const chainId = curveIntentChain(quote.intentId);\n const d = chainId === null ? undefined : deploymentOf(deployments, chainId);\n if (chainId === null || !d) return \"the quote is not a Curve swap on a pinned chain\";\n const quoted = quote.txRequest;\n if (!quoted?.data || !quoted.to || !tx.data) return \"the quote or the transaction carries no router call\";\n if (tx.data.length !== quoted.data.length || lc(tx.data) !== lc(quoted.data)) return \"the transaction is not the quoted router call\";\n if (!isAddress(tx.to) || lc(tx.to) !== lc(d.router) || lc(quoted.to) !== lc(d.router)) return `the transaction calls ${tx.to}, not the Curve router`;\n if ((tx.value ?? \"0\") !== (quoted.value ?? \"0\")) return \"the transaction's value is not the quote's\";\n if ((tx.chainId !== undefined && tx.chainId !== chainId) || (quoted.chainId !== undefined && quoted.chainId !== chainId)) return `the transaction is not for chain ${chainId}`;\n if ((tx.approvalAddress ?? \"\").toLowerCase() !== (quoted.approvalAddress ?? \"\").toLowerCase()) return \"the transaction's approval is not the quote's\";\n const call = decodeExchange(d.family, quoted.data);\n if (!call || call.selector !== EXCHANGE_SELECTOR[d.family]) return \"the quoted call is not the explicit-receiver exchange\";\n if (call.minDy <= 0n) return \"the swap has no minimum (min_dy 0)\";\n const last = lastToken(call);\n const reason = checkRoute(chainId, d, own(pools, chainId), call, call.route[0]!, last);\n if (reason) return reason;\n await verifyDeployment(chainId);\n const index = poolIndex(chainId, d, own(pools, chainId));\n const hops = routePools(call).map((a) => index.get(lc(a))!);\n const reads = poolCalls(hops);\n const calls: RpcCall[] = [ethCall(d.router, encodeGetDy(d.family, call, call.amount)), ...reads];\n const probeIn = call.amount / 1000n;\n const probeAt = calls.length;\n if (probe && probeIn > 0n) calls.push(ethCall(d.router, encodeGetDy(d.family, call, probeIn)));\n const res = await rpc(chainId, calls);\n const poolReason = await poolsReason(chainId, hops, res.slice(1, 1 + reads.length));\n if (poolReason) return poolReason;\n const out = wordUint(res[0]);\n if (out === null) return \"the router no longer quotes this route\";\n if (out < call.minDy) return `price moved — the pools now pay ${out}, under your minimum ${call.minDy}`;\n return {out, probeOut: probe && probeIn > 0n ? wordUint(res[probeAt]) : null, amount: call.amount, minDy: call.minDy};\n }\n\n /** Per pool: its code, then `coins(uint256)` for each pinned coin. */\n function poolCalls(list: readonly CurvePool[]): RpcCall[] {\n return list.flatMap((pool) => [\n {method: \"eth_getCode\", params: [pool.address, \"latest\"]},\n ...pool.coins.map((_, k) => ethCall(pool.address, `${COINS_UINT}${k.toString(16).padStart(64, \"0\")}`)),\n ]);\n }\n\n /** The answers to {@link poolCalls} held to the pins (`coins(int128)` asked where `coins(uint256)` reverts). */\n async function poolsReason(chainId: number, list: readonly CurvePool[], res: readonly unknown[]): Promise<string | null> {\n let at = 0;\n const retry: {pool: CurvePool; k: number}[] = [];\n for (const pool of list) {\n const code = res[at++];\n // eth_getCode does not revert: no string means the read itself failed, which says nothing about the pool.\n if (typeof code !== \"string\") return `could not read pool ${pool.name} (${pool.address}) over RPC`;\n if (code.length <= 2 || lc(keccak256(code as ViemHex)) !== lc(pool.codeHash)) return `pool ${pool.name} (${pool.address}) is not the pinned code`;\n for (let k = 0; k < pool.coins.length; k++) {\n const coin = wordAddress(res[at++]);\n if (coin === null) retry.push({pool, k});\n else if (coin !== lc(pool.coins[k]!)) return `pool ${pool.name} now reports coin ${k} = ${coin}, not the pinned ${pool.coins[k]}`;\n }\n }\n if (retry.length) {\n // The oldest stable pools take coins(int128).\n const again = await rpc(chainId, retry.map(({pool, k}) => ethCall(pool.address, `${COINS_INT}${k.toString(16).padStart(64, \"0\")}`)));\n for (const [n, {pool, k}] of retry.entries()) {\n const coin = wordAddress(again[n]);\n if (coin !== lc(pool.coins[k]!)) return `pool ${pool.name} does not report its pinned coin ${k}`;\n }\n }\n return null;\n }\n\n /**\n * Allowlisted pools as a sealed quote's preflight reads them, without a route: each still has its pinned code and\n * coins. The reason the first one fails, or null (a failed read throws). For live checks over a whole allowlist.\n */\n async function checkPools(chainId: number, list: readonly CurvePool[]): Promise<string | null> {\n return list.length ? poolsReason(chainId, list, await rpc(chainId, poolCalls(list))) : null;\n }\n\n return {rpc, verifyDeployment, checkSealed, inspectSealed, checkPools};\n}\n\nfunction lastToken(call: DecodedExchange): Hex {\n let k = 0;\n while (k < 5 && lc(call.route[2 * k + 1]!) !== lc(ZERO_ADDRESS)) k++;\n return call.route[2 * k]!;\n}\n\n/**\n * How far the device's own auto slippage may sit under the backend's before a remote build's minimum counts as too low:\n * the backend sized it from its probe at quote time, the device from a fresh one, and half the impact moves it.\n */\nexport const CURVE_AUTO_SLIPPAGE_DRIFT_BPS = 5;\n\nexport interface CurveRemotePinsOptions extends CurveOnChainOptions {\n /** The backend provider's `defaultSlippageBps`, when it sets one (a build's minimum is bounded by it). Default: auto slippage. */\n defaultSlippageBps?: number;\n}\n\n/**\n * {@link curvePins} plus `verifyBuild`: a remote Curve build checked on the client — {@link curveVerifyQuote} on the\n * request it answered, then on chain (over the app's own RPCs) the pinned router (code and version, once per chain),\n * each hop pool's pinned code and coins, and a fresh `get_dy` of the exact route at or above the minimum. The quote's\n * figures are then held to that fresh `get_dy` (§5.3 C9: the minimum is the device's own): `destAmount` no more than the\n * slippage above it, and `min_dy` no more than the slippage below it (or below `destAmount`, if lower) — the request's\n * `slippageBps`, else `defaultSlippageBps`, else the provider's auto slippage re-derived here from a fresh 1/1000 probe\n * (plus {@link CURVE_AUTO_SLIPPAGE_DRIFT_BPS}). A backend naming `min_dy = 1` or an inflated output is refused.\n * `remoteProvider({name: \"curve\", baseUrl, ...curveRemotePins({rpcUrls})})`.\n */\nexport function curveRemotePins(opts: CurveRemotePinsOptions): RemotePins & {verifyBuild(quote: Quote, tx: UnsignedTx, params?: QuoteParams): Promise<string | null>} {\n const deployments = opts.deployments ?? CURVE_DEPLOYMENTS;\n const fixedSlippage = opts.defaultSlippageBps;\n if (fixedSlippage !== undefined && (!Number.isInteger(fixedSlippage) || fixedSlippage <= 0 || fixedSlippage >= 5_000)) throw new Error(\"curve: defaultSlippageBps must be 1..4999\");\n const verifyQuote = curveQuoteCheck(opts);\n const chain = curveOnChain(opts);\n return Object.freeze({\n callTargets: (c: string): readonly string[] => routerFor(deployments, c),\n spenders: (c: string): readonly string[] => routerFor(deployments, c),\n verifyQuote,\n async verifyBuild(quote: Quote, tx: UnsignedTx, params?: QuoteParams): Promise<string | null> {\n if (!params) return \"the request this quote answered is unknown\";\n const reason = verifyQuote(params, quote);\n if (reason) return reason;\n try {\n const auto = params.slippageBps === undefined && fixedSlippage === undefined;\n const seen = await chain.inspectSealed(quote, tx, auto);\n if (typeof seen === \"string\") return seen;\n const {out, probeOut, amount, minDy} = seen;\n let dest: bigint;\n try { dest = BigInt(quote.destAmount); } catch { return \"the quote names no output\"; }\n const bps = params.slippageBps ?? fixedSlippage ?? Math.min(9_999, curveAutoSlippageBps(params, curveImpactBps(amount, out, probeOut)) + CURVE_AUTO_SLIPPAGE_DRIFT_BPS);\n if (slippageFloor(dest, bps) > out) return `the quote promises ${dest}, more than ${bps} bps above the ${out} the pools pay now`;\n const fresh = dest < out ? dest : out;\n if (minDy < slippageFloor(fresh, bps)) return `the swap's minimum ${minDy} is more than ${bps} bps under the ${fresh} the pools pay now`;\n return null;\n } catch (e) {\n return e instanceof Error ? e.message.replace(/^curve: /, \"\") : String(e);\n }\n },\n });\n}\n\n"],"mappings":";;;;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MACzG,QAAQ;AACN,eAAO,EAAC,OAAO,UAAS;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AACF;","names":["import_viem","import_util","c","a","d","import_viem","d","import_util","import_swap2_assets","import_util","import_viem","import_util","lc","d","chainIdOf","d","out"]}
|
|
1
|
+
{"version":3,"sources":["../src/provider.ts","../src/abi.ts","../src/deployments.ts","../src/activity.ts","../src/pools/1.ts","../src/pools/10.ts","../src/pools/100.ts","../src/pools/143.ts","../src/pools/196.ts","../src/pools/8453.ts","../src/pools/9745.ts","../src/pools/42161.ts","../src/pools/index.ts","../src/routes.ts","../src/reasons.ts","../src/rpc.ts","../src/slippage.ts","../src/intent.ts","../src/verify.ts"],"sourcesContent":["import {getAddress} from \"viem\";\nimport {evmRef, isEvm, sourceAssetOf} from \"@anywalletkit/protocol-swap2-core/util\";\nimport type {Asset, CrossChainProvider, IntentRef, IntentStatus, Quote, QuoteParams, UnsignedTx} from \"@anywalletkit/protocol-swap2-core/types\";\nimport {refusal, refusalOf, type Swap2RefusalInfo, type Swap2RefusalReason} from \"@anywalletkit/protocol-swap2-core/errors\";\nimport {encodeExchange, encodeGetDy} from \"./abi.js\";\nimport {describeCurveActivity} from \"./activity.js\";\nimport {CURVE_DEPLOYMENTS, deploymentOf, type CurveDeployment} from \"./deployments.js\";\nimport {CURVE_POOLS} from \"./pools/index.js\";\nimport type {CurveChainPools} from \"./pools/types.js\";\nimport {findRoutes, routeArgs, routePools, type CurveRoute} from \"./routes.js\";\nimport {ethCall, wordUint} from \"./rpc.js\";\nimport {curveAutoSlippageBps, curveImpactBps} from \"./slippage.js\";\nimport {curveIntentChain, mintCurveIntentId} from \"./intent.js\";\nimport {curveOnChain, curveQuoteCheck} from \"./verify.js\";\nimport {notes, tagged} from \"./reasons.js\";\n\n/**\n * Curve, straight from the contracts — Router NG on every chain in `CURVE_DEPLOYMENTS`.\n *\n * Quote: candidate routes of one or two pools from the curated allowlist the package pins (plus the router's\n * wrap hop through the pinned wrapped native, and on Ethereum's v1.2 router the crvUSD ↔ scrvUSD ERC-4626 hop),\n * each priced with the router's own `get_dy` in JSON-RPC batches; the best output wins. Execution: the\n * explicit-receiver `exchange(route, params, amount, min_dy, [pools,] receiver)` — the router pays only the\n * recipient and reverts under `min_dy`, which is never 0. No API, no key, no fee.\n *\n * Router NG has no deadline: the quote's lifetime (`quoteTtlMs`) is enforced by the engine, and right before\n * broadcast `preflightDeposit` re-checks the sealed call byte for byte, each hop pool's code and coins and a fresh\n * `get_dy` of the exact route against the minimum (the router's code hash and version are checked once per chain per\n * process: the router is immutable). ERC-20 sources approve exactly the input to the\n * pinned router (`approvalAddress`); the engine handles that leg (and a USDT-style reset to 0 first).\n */\n\n/** Long enough for an approval to be mined on Ethereum; the router has no deadline of its own. */\nconst DEFAULT_TTL_MS = 180_000;\n\nexport interface CurveProviderConfig {\n enabled?: boolean;\n /** JSON-RPC endpoints per EVM chain id, tried in order. A chain without one is not offered. */\n rpcUrls: Readonly<Record<number, readonly string[]>>;\n /**\n * Slippage when the caller names none (bps). Default: `suggestSlippage` from swap2-core for the pair and the\n * route's price impact (stable ↔ stable 10 bps, majors 50, others 100, plus half the impact).\n */\n defaultSlippageBps?: number;\n /** Local quote lifetime. Router NG has no deadline, so this is the only expiry. Default 3 min. */\n quoteTtlMs?: number;\n /** Override the deployments (tests, new chains). Still verified on-chain before use. */\n deployments?: Readonly<Record<number, CurveDeployment>>;\n /** Override the pool allowlist (tests). */\n pools?: Readonly<Record<number, CurveChainPools>>;\n /** Told when a chain's AddressProvider lists another router than the pinned one (never acted on). Default console.warn. */\n onWarning?: (message: string) => void;\n}\n\nexport function curveProvider(config: CurveProviderConfig): CrossChainProvider {\n const deployments = config.deployments ?? CURVE_DEPLOYMENTS;\n const pools = config.pools ?? CURVE_POOLS;\n const ttl = config.quoteTtlMs ?? DEFAULT_TTL_MS;\n const fixedSlippage = config.defaultSlippageBps;\n if (fixedSlippage !== undefined && (!Number.isInteger(fixedSlippage) || fixedSlippage <= 0 || fixedSlippage >= 5_000)) throw new Error(\"curve: defaultSlippageBps must be 1..4999\");\n const chain = curveOnChain({rpcUrls: config.rpcUrls, deployments, pools, ...(config.onWarning ? {onWarning: config.onWarning} : {})});\n const rpc = chain.rpc;\n const selfCheck = curveQuoteCheck({deployments, pools});\n const tableOf = (chainId: number) => (Object.prototype.hasOwnProperty.call(pools, chainId) ? pools[chainId] : undefined);\n\n const chainIdOf = (caip2: string): number | null => {\n if (!isEvm(caip2)) return null;\n const id = evmRef(caip2);\n return deploymentOf(deployments, id) && config.rpcUrls[id]?.length && tableOf(id)?.pools.length ? id : null;\n };\n\n /** get_dy of each route at `amount` (null where the router reverts). */\n async function price(chainId: number, d: CurveDeployment, routes: readonly CurveRoute[], amount: bigint, signal?: AbortSignal): Promise<(bigint | null)[]> {\n const raw = await rpc(chainId, routes.map((r) => ethCall(d.router, encodeGetDy(d.family, routeArgs(d.family, r), amount))), signal);\n return raw.map(wordUint);\n }\n\n return {\n name: \"curve\",\n describeActivity: (tx, ctx) => describeCurveActivity(tx, ctx, deployments),\n supportsSameChain: true,\n enabled: () => config.enabled ?? true,\n supportsChain: (caip2: string) => chainIdOf(caip2) !== null,\n supportsChainPair: (from: string, to: string) => from === to && chainIdOf(from) !== null,\n supportsRoute(from: Asset, to: Asset): boolean {\n return from.chain === to.chain && chainIdOf(from.chain) !== null;\n },\n\n async getQuote(params: QuoteParams, signal?: AbortSignal): Promise<Quote | null> {\n const refuse = (why: string, info?: Swap2RefusalReason | Swap2RefusalInfo): null => {\n if (info === undefined) params.onRefusal?.(`curve: ${why}`);\n else params.onRefusal?.(`curve: ${why}`, typeof info === \"string\" ? {reason: info} : info);\n return null;\n };\n if (params.flex) return refuse(\"amount-flexible deposits are not supported\", \"unsupported_pair\");\n if (params.sourceChain !== params.destChain) return refuse(\"same-chain swaps only\", \"unsupported_pair\");\n const chainId = chainIdOf(params.sourceChain);\n if (chainId === null) return refuse(`no Curve router, pool allowlist or RPC for ${params.sourceChain}`, \"unsupported_pair\");\n const d = deploymentOf(deployments, chainId)!;\n const src = sourceAssetOf(params);\n if (!src) return refuse(`unknown source token ${params.sourceToken}`, \"unsupported_pair\");\n const nativeIn = !src.contract;\n const nativeOut = /^0x0+$/.test(params.destToken);\n if (!nativeOut && !/^0x[0-9a-fA-F]{40}$/.test(params.destToken)) return refuse(\"destination token must be an EVM address\", \"unsupported_pair\");\n if (!/^0x[0-9a-fA-F]{40}$/.test(params.destAddress)) return refuse(\"recipient must be an EVM address\", \"recipient_mismatch\");\n let amountIn: bigint;\n try {\n amountIn = BigInt(params.amountIn);\n } catch {\n return refuse(\"amount is not an integer\");\n }\n if (amountIn <= 0n) return refuse(\"amount must be positive\", \"amount_too_small\");\n if (params.slippageBps !== undefined && (!Number.isInteger(params.slippageBps) || params.slippageBps < 0 || params.slippageBps >= 10_000)) return refuse(\"slippage must be 0..9999 bps\");\n if (!nativeIn && src.contract!.toLowerCase() === d.eth.toLowerCase()) return refuse(\"the native coin is named by the catalog, not by the router's 0xEeee sentinel\", \"unsupported_pair\");\n if (!nativeOut && params.destToken.toLowerCase() === d.eth.toLowerCase()) return refuse(\"name a native output with the zero address, not the router's 0xEeee sentinel\", \"unsupported_pair\");\n const tokenIn = getAddress(nativeIn ? d.eth : src.contract!);\n const tokenOut = getAddress(nativeOut ? d.eth : params.destToken);\n if (tokenIn === tokenOut) return refuse(\"same token in and out\", \"unsupported_pair\");\n const wrapPair = [getAddress(d.eth), getAddress(d.weth)];\n if (wrapPair.includes(tokenIn) && wrapPair.includes(tokenOut)) return refuse(\"that is a wrap/unwrap, not a swap\", \"unsupported_pair\");\n\n try {\n await chain.verifyDeployment(chainId);\n const {routes, truncated} = findRoutes(chainId, d, tableOf(chainId), tokenIn, tokenOut);\n if (!routes.length) return refuse(\"no allowlisted Curve pool route for this pair\", \"no_route\");\n const outs = await price(chainId, d, routes, amountIn, signal);\n let best: {route: CurveRoute; out: bigint} | null = null;\n outs.forEach((out, i) => {\n if (out !== null && out > 0n && (!best || out > best.out)) best = {route: routes[i]!, out};\n });\n if (!best) return refuse(\"no allowlisted Curve pool quotes this pair and amount\", \"no_route\");\n const {route, out} = best as {route: CurveRoute; out: bigint};\n\n // Price impact: a probe 1/1000 the size on the same route gives the marginal rate; the full-size rate's\n // shortfall against it is the impact (pool fees are paid on both sides and cancel). Informational.\n let priceImpactBps: number | undefined;\n const probeIn = amountIn / 1000n;\n if (probeIn > 0n) {\n try {\n const [probeOut] = await price(chainId, d, [route], probeIn, signal);\n priceImpactBps = curveImpactBps(amountIn, out, probeOut);\n } catch {\n /* the quote stands; impact is information, not a gate */\n }\n }\n\n const bps = params.slippageBps ?? fixedSlippage ?? curveAutoSlippageBps(params, priceImpactBps);\n const minOut = (out * BigInt(10_000 - bps)) / 10_000n;\n if (minOut <= 0n) return refuse(\"the minimum rounds to zero for this amount\", \"amount_too_small\");\n if (params.minAmountOut !== undefined && minOut < BigInt(params.minAmountOut)) {\n return refuse(`floor breach (min=${minOut} < floor=${params.minAmountOut})`, \"price_check_failed\");\n }\n const args = routeArgs(d.family, route);\n const recipient = getAddress(params.destAddress);\n const data = encodeExchange(d.family, args, amountIn, minOut, recipient);\n // No gas limit: get_dy measures no gas, and a per-step formula was wrong both ways. Run at its limit\n // (eth_call, 2026-11-05) the swap ran out of gas — crvUSD → scrvUSD on Ethereum needs 180 778 (formula\n // 180 000: the vault's deposit), every Monad route 345–352k for one stable-ng pool (formula 300 000) — while a\n // limit with room for the dearest pool overcharges where the limit is what is paid (Monad). The wallet\n // estimates the exact call with headroom right before broadcast, after any approval (as for Uniswap without\n // a quoter figure, THORChain and Chainflip).\n const quote: Quote = {\n provider: \"curve\",\n // One id per quote: a remote stub keys the request a build is checked against by it.\n intentId: mintCurveIntentId(chainId),\n depositAddress: \"\",\n depositMemo: null,\n txRequest: {\n to: d.router,\n data,\n value: nativeIn ? amountIn.toString() : \"0\",\n chainId,\n ...(nativeIn ? {} : {approvalAddress: d.router}),\n },\n sourceAmount: amountIn.toString(),\n destAmount: out.toString(),\n minDestAmount: minOut.toString(),\n feeUsd: 0,\n etaSeconds: 15,\n reliability: 0.97,\n validUntilMs: Date.now() + ttl,\n // Pool fees are inside the router-priced output; nothing is added on top.\n providerData: {\n route: route.label,\n poolFee: \"pools\",\n router: d.router,\n family: d.family,\n tokenIn,\n tokenOut,\n amountIn: amountIn.toString(),\n minOut: minOut.toString(),\n slippageBps: String(bps),\n pools: routePools(args).join(\",\"),\n candidates: `${routes.length}${truncated ? \"+\" : \"\"}`,\n ...(priceImpactBps !== undefined ? {priceImpactBps: String(priceImpactBps)} : {}),\n },\n };\n // The same check a client runs on a remote quote, on what this provider just built.\n const why = selfCheck(params, quote);\n if (why) return refuse(`built a call its own check refuses (${why})`, notes.reasonOf(why) ?? \"policy_refused\");\n return quote;\n } catch (e) {\n return refuse(e instanceof Error ? e.message.replace(/^curve: /, \"\") : String(e), refusalOf(e));\n }\n },\n\n /**\n * Right before broadcast (after any approval): the transaction is byte for byte the sealed quote, each hop pool is\n * still the pinned code with the pinned coins (the immutable router's code and version were checked once for the\n * chain), and the exact route still pays at least the signed minimum. Refuse with the reason instead of sending a swap that would revert or was altered.\n */\n async preflightDeposit(quote: Quote, tx: UnsignedTx): Promise<void> {\n const reason = await chain.checkSealed(quote, tx);\n if (reason) throw tagged(new Error(`curve: ${reason}. Nothing was sent; refresh the quote.`), notes.reasonOf(reason));\n },\n\n async buildDeposit(quote: Quote): Promise<UnsignedTx> {\n const tx = quote.txRequest;\n if (!tx?.to || !tx.data) throw refusal(\"policy_refused\", \"swap2: Curve quote has no transaction request\");\n return {\n chain: \"\",\n to: tx.to,\n value: tx.value ?? \"0\",\n data: tx.data,\n ...(tx.chainId !== undefined ? {chainId: tx.chainId} : {}),\n ...(tx.gasLimit ? {gasLimit: tx.gasLimit} : {}),\n ...(tx.approvalAddress ? {approvalAddress: tx.approvalAddress} : {}),\n };\n },\n\n /** Same-chain: the swap is done when its transaction is mined successfully. */\n async trackIntent(ref: IntentRef): Promise<IntentStatus> {\n if (!ref.sourceTxHash) return {state: \"pending\"};\n const chainId = curveIntentChain(ref.intentId);\n if (chainId === null || !deploymentOf(deployments, chainId) || !config.rpcUrls[chainId]?.length) return {state: \"pending\"};\n try {\n const [receipt] = (await rpc(chainId, [{method: \"eth_getTransactionReceipt\", params: [ref.sourceTxHash]}])) as [{status?: string} | null];\n if (!receipt) return {state: \"pending\"};\n return receipt.status === \"0x1\" ? {state: \"completed\", destTxHash: ref.sourceTxHash} : {state: \"failed\"};\n } catch {\n return {state: \"pending\"};\n }\n },\n };\n}\n","import {decodeFunctionData, encodeFunctionData, parseAbi} from \"viem\";\nimport type {CurveRouterFamily} from \"./deployments.js\";\nimport {ZERO_ADDRESS} from \"./deployments.js\";\nimport type {Hex} from \"./pools/types.js\";\n\n/**\n * Router NG entry points, both ABI families (selectors with `viem toFunctionSelector`, checked against every pinned\n * router's code 2026-11-05). This module writes only the explicit-receiver `exchange` of each family and reads\n * `get_dy`; the other forms are listed for history recognition.\n */\nexport const ROUTER_NG5_ABI = parseAbi([\n \"function exchange(address[11] _route, uint256[5][5] _swap_params, uint256 _amount, uint256 _min_dy) payable returns (uint256)\",\n \"function exchange(address[11] _route, uint256[5][5] _swap_params, uint256 _amount, uint256 _min_dy, address[5] _pools) payable returns (uint256)\",\n \"function exchange(address[11] _route, uint256[5][5] _swap_params, uint256 _amount, uint256 _min_dy, address[5] _pools, address _receiver) payable returns (uint256)\",\n \"function get_dy(address[11] _route, uint256[5][5] _swap_params, uint256 _amount) view returns (uint256)\",\n \"function version() view returns (string)\",\n]);\nexport const ROUTER_LITE4_ABI = parseAbi([\n \"function exchange(address[11] _route, uint256[4][5] _swap_params, uint256 _amount, uint256 _min_dy) payable returns (uint256)\",\n \"function exchange(address[11] _route, uint256[4][5] _swap_params, uint256 _amount, uint256 _min_dy, address _receiver) payable returns (uint256)\",\n \"function get_dy(address[11] _route, uint256[4][5] _swap_params, uint256 _amount) view returns (uint256)\",\n \"function version() view returns (string)\",\n]);\nexport const VERSION_ABI = parseAbi([\"function version() view returns (string)\"]);\n/** `coins(uint256)` (every NG pool and most plain ones) and `coins(int128)` (the oldest stable pools). */\nexport const COINS_UINT: Hex = \"0xc6610657\";\nexport const COINS_INT: Hex = \"0x23746eb8\";\nexport const ADDRESS_PROVIDER_ABI = parseAbi([\"function get_address(uint256 _id) view returns (address)\"]);\n\n/** The `exchange` this module builds: with an explicit receiver. */\nexport const EXCHANGE_SELECTOR: Readonly<Record<CurveRouterFamily, Hex>> = Object.freeze({ng5: \"0xc872a3c5\", lite4: \"0xfd44959c\"});\nexport const GET_DY_SELECTOR: Readonly<Record<CurveRouterFamily, Hex>> = Object.freeze({ng5: \"0x81889a2c\", lite4: \"0x11e21386\"});\n/** Every swap entry point per family, for history: `[5][5]` 4-, 5- and 6-argument forms; `[4][5]` 4- and 5-argument. */\nexport const ROUTER_SELECTORS: Readonly<Record<CurveRouterFamily, ReadonlySet<string>>> = Object.freeze({\n ng5: new Set([\"0x371dc447\", \"0x5c9c18e2\", \"0xc872a3c5\"]),\n lite4: new Set([\"0xaad348a2\", \"0xfd44959c\"]),\n});\n/** topic0 of the router's `Exchange` event per family (`[5][5]` logs `pools` too). */\nexport const EXCHANGE_TOPIC: Readonly<Record<CurveRouterFamily, Hex>> = Object.freeze({\n ng5: \"0x56d0661e240dfb199ef196e16e6f42473990366314f0226ac978f7be3cd9ee83\",\n lite4: \"0x6324485a21bc5138ec352d4949d0adc75d8e1382a687e1aa1ce6863f40c9e463\",\n});\n\n/** A route as the router takes it: 11 addresses and one swap-params row per step (5 rows; 5 or 4 columns). */\nexport interface RouterArgs {\n route: readonly Hex[];\n params: readonly (readonly bigint[])[];\n}\n\n/** One router call, decoded. `receiver` is null when the call names none (the router then pays `msg.sender`). */\nexport interface DecodedExchange extends RouterArgs {\n amount: bigint;\n minDy: bigint;\n pools: readonly Hex[] | null;\n receiver: Hex | null;\n selector: Hex;\n}\n\nconst ZERO_POOLS: readonly Hex[] = Object.freeze([ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS, ZERO_ADDRESS]);\ntype Row5 = readonly [bigint, bigint, bigint, bigint, bigint];\ntype Row4 = readonly [bigint, bigint, bigint, bigint];\nconst tuple11 = (a: readonly Hex[]) => a as unknown as readonly [Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex, Hex];\nconst rows5 = (p: readonly (readonly bigint[])[]) => p as unknown as readonly [Row5, Row5, Row5, Row5, Row5];\nconst rows4 = (p: readonly (readonly bigint[])[]) => p as unknown as readonly [Row4, Row4, Row4, Row4, Row4];\nconst pools5 = (a: readonly Hex[]) => a as unknown as readonly [Hex, Hex, Hex, Hex, Hex];\n\nfunction checkShape(family: CurveRouterFamily, args: RouterArgs): void {\n const cols = family === \"ng5\" ? 5 : 4;\n if (args.route.length !== 11 || args.params.length !== 5 || args.params.some((r) => r.length !== cols)) {\n throw new Error(`curve: a ${family} route is address[11] and uint256[${cols}][5]`);\n }\n}\n\n/** `exchange(route, params, amount, minDy, [zero pools,] receiver)` for the router family. */\nexport function encodeExchange(family: CurveRouterFamily, args: RouterArgs, amount: bigint, minDy: bigint, receiver: Hex): Hex {\n checkShape(family, args);\n return family === \"ng5\"\n ? encodeFunctionData({abi: ROUTER_NG5_ABI, functionName: \"exchange\", args: [tuple11(args.route), rows5(args.params), amount, minDy, pools5(ZERO_POOLS), receiver]})\n : encodeFunctionData({abi: ROUTER_LITE4_ABI, functionName: \"exchange\", args: [tuple11(args.route), rows4(args.params), amount, minDy, receiver]});\n}\n\n/** `get_dy(route, params, amount)` for the router family. */\nexport function encodeGetDy(family: CurveRouterFamily, args: RouterArgs, amount: bigint): Hex {\n checkShape(family, args);\n return family === \"ng5\"\n ? encodeFunctionData({abi: ROUTER_NG5_ABI, functionName: \"get_dy\", args: [tuple11(args.route), rows5(args.params), amount]})\n : encodeFunctionData({abi: ROUTER_LITE4_ABI, functionName: \"get_dy\", args: [tuple11(args.route), rows4(args.params), amount]});\n}\n\n/** Any of the family's `exchange` forms, decoded; null for anything else (another selector, malformed data). */\nexport function decodeExchange(family: CurveRouterFamily, data: string): DecodedExchange | null {\n if (!/^0x[0-9a-fA-F]*$/.test(data) || data.length < 10) return null;\n const selector = data.slice(0, 10).toLowerCase() as Hex;\n if (!ROUTER_SELECTORS[family].has(selector)) return null;\n try {\n if (family === \"ng5\") {\n const c = decodeFunctionData({abi: ROUTER_NG5_ABI, data: data as Hex});\n if (c.functionName !== \"exchange\") return null;\n const a = c.args as readonly unknown[];\n return {\n selector,\n route: a[0] as readonly Hex[],\n params: a[1] as readonly (readonly bigint[])[],\n amount: a[2] as bigint,\n minDy: a[3] as bigint,\n pools: a.length >= 5 ? (a[4] as readonly Hex[]) : null,\n receiver: a.length >= 6 ? (a[5] as Hex) : null,\n };\n }\n const c = decodeFunctionData({abi: ROUTER_LITE4_ABI, data: data as Hex});\n if (c.functionName !== \"exchange\") return null;\n const a = c.args as readonly unknown[];\n return {\n selector,\n route: a[0] as readonly Hex[],\n params: a[1] as readonly (readonly bigint[])[],\n amount: a[2] as bigint,\n minDy: a[3] as bigint,\n pools: null,\n receiver: a.length >= 5 ? (a[4] as Hex) : null,\n };\n } catch {\n return null;\n }\n}\n","import type {Hex} from \"./pools/types.js\";\n\n/**\n * Curve Router NG deployments this module trusts, one per chain, keyed by chain id (the same address means a different\n * contract on another chain: `0x4f37…fc1F` is a `[5][5]` router on Base and a `[4][5]` one on Mantle). Every entry was\n * read on-chain on 2026-11-05: the runtime code's keccak (the router has no owner and no proxy; its immutables — the\n * wrapped native, and on `[5][5]` routers the two calc zaps — are inside the code, so the hash pins them too),\n * `version()`, the wrapped native read from the code's immutable tail, and what the chain's AddressProvider lists as\n * id 2. The provider re-checks the code hash and the version once per chain before quoting (`verifyDeployment`).\n *\n * The router address is never resolved at runtime: the AddressProvider is an informational registry its admin (an\n * individual, not the DAO) can change at any time, so its id 2 is only compared and a difference only warned about.\n */\n\n/** ABI family of a router: `ng5` = `uint256[5][5]` swap params `[i, j, swap_type, pool_type, n_coins]` plus a\n * `_pools[5]` argument (curve-router-ng `Router.vy`); `lite4` = `uint256[4][5]` `[i, j, swap_type, pool_type]`, no\n * `_pools` (curve-core `router_v_110.vy` / `router_v_111.vy`, NG pools only). */\nexport type CurveRouterFamily = \"ng5\" | \"lite4\";\n\nexport interface CurveDeployment {\n /** Human label for logs and subtitles. */\n label: string;\n family: CurveRouterFamily;\n router: Hex;\n /** `version()` as the router reports it. */\n version: \"1.2.0\" | \"1.1.0\" | \"1.1.1\";\n /** keccak256 of the router's runtime code. */\n codeHash: Hex;\n /** The wrapped native the router's swap_type 8 hop wraps / unwraps (its `WETH_ADDRESS` immutable). */\n weth: Hex;\n /** The router's native sentinel (`ETH_ADDRESS`; a constructor immutable on v1.1.1). */\n eth: Hex;\n /** The chain's Curve AddressProvider (watch signal only) and the address its id 2 listed when pinned. */\n addressProvider: Hex;\n addressProviderRouter: Hex;\n /** ERC-4626 pseudo-hop (swap_type 9) the router may use — only on router v1.2 (Ethereum: crvUSD ↔ scrvUSD). */\n erc4626?: {vault: Hex; asset: Hex};\n}\n\n/** The native sentinel every pinned router uses (checked against the v1.1.1 routers' immutable). */\nexport const CURVE_ETH: Hex = \"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE\";\nexport const ZERO_ADDRESS: Hex = \"0x0000000000000000000000000000000000000000\";\n/** Most pool hops one route crosses (pseudo-hops — wrap, ERC-4626 — come on top). */\nexport const MAX_ROUTE_POOLS = 2;\n/** Most router steps one route may have: two pools, a wrap in front and an unwrap or an ERC-4626 hop behind. */\nexport const MAX_ROUTE_STEPS = 4;\n\n/** Savings crvUSD (Yearn V3 vault, ERC-4626 over crvUSD) on Ethereum, and crvUSD itself. */\nexport const SCRVUSD: Hex = \"0x0655977FEb2f289A4aB78af67BAB0d17aAb84367\";\nexport const CRVUSD_ETHEREUM: Hex = \"0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E\";\n\nconst AP: Hex = \"0x5ffe7FB82894076ECB99A30D6A32e969e6e35E98\";\nconst R_OP_POLY_GNO_AVAX: Hex = \"0x0DCDED3545D565bA3B19E683431381007245d983\";\nconst R_UNI_HYPER: Hex = \"0xd2002373543Ce3527023C75e7518C274A51ce712\";\nconst R_MONAD_PLASMA_RH: Hex = \"0xFF5Cb29241F002fFeD2eAa224e3e996D24A6E8d1\";\nconst R_BASE_MANTLE: Hex = \"0x4f37A9d177470499A2dD084621020b023fcffc1F\";\nconst AP_UNI_HYPER: Hex = \"0x1764ee18e8B3ccA4787249Ceb249356192594585\";\nconst AP_MONAD_PLASMA_RH: Hex = \"0x4574921eb950d3Fd5B01562162EC566Cb8bc3648\";\nconst OP_WETH: Hex = \"0x4200000000000000000000000000000000000006\";\n\nconst d = (o: Omit<CurveDeployment, \"eth\"> & {eth?: Hex}): CurveDeployment => Object.freeze({eth: CURVE_ETH, ...o});\n\nexport const CURVE_DEPLOYMENTS: Readonly<Record<number, CurveDeployment>> = Object.freeze({\n // [5][5] routers. Ethereum runs v1.2 (the router Curve's UI, curve-js and the curve-router-ng README use; the only one\n // with the ERC-4626 hop) — the AddressProvider still lists v1.1 there.\n 1: d({label: \"Ethereum\", family: \"ng5\", router: \"0x45312ea0eFf7E09C83CBE249fa1d7598c4C8cd4e\", version: \"1.2.0\", codeHash: \"0xbe5f7301254e95d27c6aa1be0fedc0aa04d6c36097e089bc9d2cccaa9d26b164\", weth: \"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2\", addressProvider: AP, addressProviderRouter: \"0x16C6521Dff6baB339122a0FE25a9116693265353\", erc4626: {vault: SCRVUSD, asset: CRVUSD_ETHEREUM}}),\n 42161: d({label: \"Arbitrum\", family: \"ng5\", router: \"0x2191718CD32d02B8E60BAdFFeA33E4B5DD9A0A0D\", version: \"1.1.0\", codeHash: \"0x9b387b5dc8fe161c7af8e850a67662e93d7116b0e66ab6bc7761d5910093bcef\", weth: \"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1\", addressProvider: AP, addressProviderRouter: \"0x2191718CD32d02B8E60BAdFFeA33E4B5DD9A0A0D\"}),\n 8453: d({label: \"Base\", family: \"ng5\", router: R_BASE_MANTLE, version: \"1.1.0\", codeHash: \"0x3abb7fe467b6c925ab1b25771cf1c75cc507aec2f873a8d03ee95160c5a83579\", weth: OP_WETH, addressProvider: AP, addressProviderRouter: R_BASE_MANTLE}),\n 10: d({label: \"OP Mainnet\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0x12ae037c1e9a21aeb6ba1b08863217de2babebbee58dbe8860a01ded6a974825\", weth: OP_WETH, addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 137: d({label: \"Polygon\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0x340f3ba3f30181c50e694f1a4da2f6ec670fc7eb0adce50d66a733f17ab150f4\", weth: \"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270\", addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 100: d({label: \"Gnosis\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0x38dc1cc456be010539e596d2ee0aa82c271316bdc6daaaffea7990a0c47176ee\", weth: \"0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d\", addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 43114: d({label: \"Avalanche\", family: \"ng5\", router: R_OP_POLY_GNO_AVAX, version: \"1.1.0\", codeHash: \"0xf1f679ec6382cd9c0138870e320e6128193f75144501691e67dcd5831edaed2b\", weth: \"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7\", addressProvider: AP, addressProviderRouter: R_OP_POLY_GNO_AVAX}),\n 56: d({label: \"BNB Chain\", family: \"ng5\", router: \"0xA72C85C258A81761433B4e8da60505Fe3Dd551CC\", version: \"1.1.0\", codeHash: \"0x19db989a1cca08711ff68049326a5a7a8d1f64d87f356d35243150215c722120\", weth: \"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c\", addressProvider: AP, addressProviderRouter: \"0xA72C85C258A81761433B4e8da60505Fe3Dd551CC\"}),\n // [4][5] routers (curve-core, NG pools only, no swap_type 9).\n 146: d({label: \"Sonic\", family: \"lite4\", router: \"0x5eeE3091f747E60a045a2E715a4c71e600e31F6E\", version: \"1.1.0\", codeHash: \"0xc5f238aee45c18efc927708fe57821cca4a84ec1bff4f22e778dfcd108411b99\", weth: \"0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38\", addressProvider: \"0x87FE17697D0f14A222e8bEf386a0860eCffDD617\", addressProviderRouter: \"0x5eeE3091f747E60a045a2E715a4c71e600e31F6E\"}),\n 130: d({label: \"Unichain\", family: \"lite4\", router: R_UNI_HYPER, version: \"1.1.0\", codeHash: \"0xe911928fab7efb72e10ee3a918dcdfb44ac5bae1c4d46eb5534bea0259d2594c\", weth: OP_WETH, addressProvider: AP_UNI_HYPER, addressProviderRouter: R_UNI_HYPER}),\n 999: d({label: \"HyperEVM\", family: \"lite4\", router: R_UNI_HYPER, version: \"1.1.0\", codeHash: \"0x1040124f623348643d919029ed513670cdb825bd0135f846ce9028329d8eb77d\", weth: \"0x5555555555555555555555555555555555555555\", addressProvider: AP_UNI_HYPER, addressProviderRouter: R_UNI_HYPER}),\n 5000: d({label: \"Mantle\", family: \"lite4\", router: R_BASE_MANTLE, version: \"1.1.0\", codeHash: \"0xe76d585fb4163cd886c99f1c12361c5644e18b8dab2d86e3fe223307e7a16f29\", weth: \"0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8\", addressProvider: AP, addressProviderRouter: R_BASE_MANTLE}),\n 143: d({label: \"Monad\", family: \"lite4\", router: R_MONAD_PLASMA_RH, version: \"1.1.0\", codeHash: \"0x7668fc406894fb811ab7f9a1099f2e33ef8d80f58327e623bbe4c4d51e406f58\", weth: \"0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A\", addressProvider: AP_MONAD_PLASMA_RH, addressProviderRouter: R_MONAD_PLASMA_RH}),\n 9745: d({label: \"Plasma\", family: \"lite4\", router: R_MONAD_PLASMA_RH, version: \"1.1.0\", codeHash: \"0xeede894a379cb95c73ece834e836ff9bbaa1ff613fb7913d0cbc3a48b2897120\", weth: \"0x6100E367285b01F48D07953803A2d8dCA5D19873\", addressProvider: AP_MONAD_PLASMA_RH, addressProviderRouter: R_MONAD_PLASMA_RH}),\n // v1.1.1: ETH_ADDRESS is a constructor immutable — 0xEeee… here, read from the code tail with WETH_ADDRESS.\n 4663: d({label: \"Robinhood Chain\", family: \"lite4\", router: R_MONAD_PLASMA_RH, version: \"1.1.1\", codeHash: \"0x716ad3720f54c96effe415598d3a62b9907e53c58c7e3d3004cba6cdb5c297a6\", weth: \"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73\", eth: CURVE_ETH, addressProvider: AP_MONAD_PLASMA_RH, addressProviderRouter: R_MONAD_PLASMA_RH}),\n 57073: d({label: \"Ink\", family: \"lite4\", router: \"0xd7E72f3615aa65b92A4DBdC211E296a35512988B\", version: \"1.1.0\", codeHash: \"0x511c1733063263ba386b0e6b01b51d777deb02ea1b6e75fcde1e572e47f22436\", weth: OP_WETH, addressProvider: \"0x604388Bb1159AFd21eB5191cE22b4DeCdEE2Ae22\", addressProviderRouter: \"0xd7E72f3615aa65b92A4DBdC211E296a35512988B\"}),\n 196: d({label: \"X Layer\", family: \"lite4\", router: \"0xBFab8ebc836E1c4D81837798FC076D219C9a1855\", version: \"1.1.0\", codeHash: \"0xfc0a3b12868c10a8a46e33f17504f8751c83d3842f715c665c3d827bfc4ed625\", weth: \"0xe538905cf8410324e03A5A23C1c177a474D59b2b\", addressProvider: AP, addressProviderRouter: \"0xBFab8ebc836E1c4D81837798FC076D219C9a1855\"}),\n 98866: d({label: \"Plume\", family: \"lite4\", router: \"0x3F5A41B922a76759b9C77D36b3d337E88cD1dc5e\", version: \"1.1.0\", codeHash: \"0x0819b95039f1e0ac56aefffc8a727e996b3afa831fd3bb2047a3737bf23ab5e4\", weth: \"0xEa237441c92CAe6FC17Caaf9a7acB3f953be4bd1\", addressProvider: \"0x907CE289E9Ee0BBcb0F69132B1C28A9Affc29FCA\", addressProviderRouter: \"0x3F5A41B922a76759b9C77D36b3d337E88cD1dc5e\"}),\n});\n\n/**\n * Older Ethereum routers recognized in history only (never quoted or approved): Router NG v1.1 (what the\n * AddressProvider lists as id 2) and v1.0. Both `[5][5]`, both immutable (checked 2026-11-05).\n */\nexport const CURVE_LEGACY_ROUTERS: Readonly<Record<number, readonly {router: Hex; version: string; codeHash: Hex}[]>> = Object.freeze({\n 1: Object.freeze([\n {router: \"0x16C6521Dff6baB339122a0FE25a9116693265353\" as Hex, version: \"1.1.0\", codeHash: \"0xf041e5b17dc8b2c417a9561eb265145e442ab25b789d9bd3527c6b68a840577b\" as Hex},\n {router: \"0xF0d4c12A5768D806021F80a262B4d39d26C58b8D\" as Hex, version: \"1.0.0\", codeHash: \"0xdfc206a29f04b4cee5b7b8d5b60ffcd2574fc9ff17cc5ec00c58b17013ea3f3b\" as Hex},\n ]),\n});\n\n/**\n * Pools a route never crosses, whatever an allowlist says (defense in depth; the allowlist generator excludes the same\n * addresses). Ethereum: a registered stable-ng pool pairing real USDT with a token that calls itself \"USDT\"\n * (`0x810e…ae9`); the four pools drained by the 2023 Vyper reentrancy-lock bug (alETH, pETH, msETH, CRV/ETH — still\n * registered on-chain); the Iron Bank lending pool cyDAI/cyUSDC/cyUSDT, whose underlying route redeems Iron Bank\n * cTokens. Polygon: amWBTC/renBTC (renBTC is dead).\n */\nexport const CURVE_DENIED_POOLS: Readonly<Record<number, ReadonlySet<string>>> = Object.freeze({\n 1: new Set([\n \"0xa6d9f4f3a67b35e81dfa560b0fcde9b0751f1f53\",\n \"0xc4c319e2d4d66cca4464c0c2b32c9bd23ebe784e\",\n \"0x9848482da3ee3076165ce6497eda906e66bb85c5\",\n \"0xc897b98272aa23714464ea2a0bd5180f1b8c0025\",\n \"0x8301ae4fc9c624d1d396cbdaa1ed877821d7c511\",\n \"0x2dded6da1bf5dbdf597c45fcfaa3194e53ecfeaf\",\n ]),\n 137: new Set([\n \"0xc2d95eef97ec6c17551d45e77b590dc1f9117c67\",\n ]),\n});\n\n/** The chain id of an `eip155:<id>` CAIP-2 string, or NaN. */\nexport function chainIdOf(caip2: string): number {\n return /^eip155:[0-9]+$/.test(caip2) ? Number(caip2.slice(7)) : NaN;\n}\n\n/** The deployment pinned for `chainId` in `table` (own keys only), or undefined. */\nexport function deploymentOf(table: Readonly<Record<number, CurveDeployment>>, chainId: number): CurveDeployment | undefined {\n return Object.prototype.hasOwnProperty.call(table, chainId) ? table[chainId] : undefined;\n}\n","/**\n * Activity recognition for Curve: a call into the chain's pinned Router NG — or, on Ethereum, the older v1.1 / v1.0\n * routers (history only) — with one of the family's `exchange` entry points → `swap`, \"Swapped A → B\" from the owner's\n * net transfers. A swap whose receiver is not one of the owner's addresses (an explicit `_receiver`, read from the\n * calldata or the router's `Exchange` log) says so in the subtitle and names that receiver as the counterparty.\n */\nimport type {ActivityItem, ChainTx, DescribeActivityContext} from \"@anywalletkit/core\";\nimport {calledContract, chainLabel, describeSwapLike, shortAddress} from \"@anywalletkit/protocol-swap2-core/activity\";\nimport {evmRef, isEvm} from \"@anywalletkit/protocol-swap2-core/util\";\nimport {EXCHANGE_TOPIC, ROUTER_SELECTORS, decodeExchange} from \"./abi.js\";\nimport {CURVE_DEPLOYMENTS, CURVE_LEGACY_ROUTERS, deploymentOf, type CurveDeployment, type CurveRouterFamily} from \"./deployments.js\";\n\nexport const CURVE_MODULE = \"@anywalletkit/protocol-swap2-curve\";\n\n/** The router family `to` speaks on `chainId`, when it is a router this module knows there. */\nfunction familyOf(deployments: Readonly<Record<number, CurveDeployment>>, chainId: number, to: string): CurveRouterFamily | null {\n const d = deploymentOf(deployments, chainId);\n if (d && d.router.toLowerCase() === to) return d.family;\n const legacy = Object.prototype.hasOwnProperty.call(CURVE_LEGACY_ROUTERS, chainId) ? CURVE_LEGACY_ROUTERS[chainId]! : [];\n return legacy.some((r) => r.router.toLowerCase() === to) ? \"ng5\" : null;\n}\n\n/** Who the swap paid: the calldata's `_receiver`, else the router's `Exchange` log (topic 2), else the sender. */\nfunction receiverOf(tx: ChainTx, family: CurveRouterFamily): string {\n const data = tx.call?.data;\n if (data) {\n const call = decodeExchange(family, data);\n if (call?.receiver) return call.receiver.toLowerCase();\n if (call) return tx.from.toLowerCase();\n }\n const logs = (tx.raw as {logs?: unknown} | undefined)?.logs ?? (tx.raw as {receipt?: {logs?: unknown}} | undefined)?.receipt?.logs;\n if (Array.isArray(logs)) {\n const to = calledContract(tx);\n for (const l of logs as {address?: string; topics?: string[]}[]) {\n if (l?.address?.toLowerCase() !== to || l.topics?.[0]?.toLowerCase() !== EXCHANGE_TOPIC[family]) continue;\n const t = l.topics[2];\n if (typeof t === \"string\" && /^0x[0-9a-fA-F]{64}$/.test(t)) return `0x${t.slice(-40)}`.toLowerCase();\n }\n }\n return tx.from.toLowerCase();\n}\n\nexport function describeCurveActivity(\n tx: ChainTx,\n ctx: DescribeActivityContext,\n deployments: Readonly<Record<number, CurveDeployment>> = CURVE_DEPLOYMENTS,\n): ActivityItem | null {\n if (!isEvm(tx.chain)) return null;\n const to = calledContract(tx);\n if (!to) return null;\n const family = familyOf(deployments, evmRef(tx.chain), to);\n if (!family) return null;\n const sel = tx.call?.selector?.toLowerCase() ?? tx.call?.data?.slice(0, 10).toLowerCase();\n if (!sel || !ROUTER_SELECTORS[family].has(sel)) return null;\n const receiver = receiverOf(tx, family);\n const ownReceiver = ctx.own.has(receiver) || [...ctx.own].some((a) => a.toLowerCase() === receiver);\n const subtitle = `Curve · ${chainLabel(tx.chain)}${ownReceiver ? \"\" : ` · paid to ${shortAddress(receiver)}`}`;\n return describeSwapLike(tx, ctx, {protocol: CURVE_MODULE, subtitle, kind: \"swap\", ...(ownReceiver ? {} : {counterparty: receiver})});\n}\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Ethereum (1), router ABI ng5. On-chain checks at block 26350656: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $1,000,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 80 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/ethereum.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_1: CurveChainPools = {\n chainId: 1,\n builtAt: '2026-11-05',\n block: 26350656,\n pools: [\n { address: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', name: 'Curve.fi DAI/USDC/USDT', coins: ['0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6, 6], poolType: 1, swapTypes: [1], codeHash: '0x954a1e212c557c85043985931498ffa3e2fcbe7dfe9cd61513f36eb47d6f4dfc', tvlUsd: 161890942, createdAt: 1599422178 },\n { address: '0xDC24316b9AE028F1497c275EB9192a3Ea0f67022', name: 'Curve.fi ETH/stETH', coins: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0xe2c45ce8268580c40b4c12c574f8a210375ab92998c1555451fef63630e96b35', tvlUsd: 85454194, createdAt: 1609827515 },\n { address: '0x862CB4E988FB66E72f128d1183829f8c05B6c6A0', name: 'Yield Basis cbBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0xd19e3a232367411c825df98165c95898c08e181fe2e0f9211445f48eb4c0dc62', tvlUsd: 54490963, createdAt: 1779393887 },\n { address: '0x313698667d7FDD6789a9BC70821309ff891E729A', name: 'Yield Basis WBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0xe4ac67017f888827e6efe22cd8edc37bf562166368f6eb62837bff2e4a4a23e8', tvlUsd: 48858088, createdAt: 1779393875 },\n { address: '0xD001aE433f254283FeCE51d4ACcE8c53263aa186', name: 'RLUSD/USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x8292Bb45bf1Ee4d140127049757C2E0fF06317eD'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x0e07a882cbde1fe43a2023b573596d0688cd4511bb04cbff49f1d9cceab84888', tvlUsd: 39310146, createdAt: 1734614699 },\n { address: '0xcc7d5785AD5755B6164e21495E07aDb0Ff11C2A8', name: 'OETH/WETH', coins: ['0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x8b33e4c54cca2b340c5ac61ac287ecd06cfab84979e63c1260683abcc06f8138', tvlUsd: 38072502, createdAt: 1742850227 },\n { address: '0x4F52C3a81E33521e5a9A47FD9D3BE475D2279c2e', name: 'Yield Basis tBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x18084fbA666a33d37592fA2633fD49a74DD93a88'], decimals: [18, 18], poolType: 20, swapTypes: [1], codeHash: '0xaefafc4c0157bc496db238fc46d730a140174f3fb542527bb86443974ed4f7a6', tvlUsd: 35972318, createdAt: 1779393911 },\n { address: '0x656341Ef90b622c6634e0573772FfB7f3669b9f3', name: 'Yield Basis WETH', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [18, 18], poolType: 20, swapTypes: [1], codeHash: '0x116eeee684882885cda3ddf0287d0979f71d64030fbec90f1f52924cf0e7643a', tvlUsd: 29312833, createdAt: 1779393923 },\n { address: '0x21E27a5E5513D6e65C4f830167390997aA84843a', name: 'Curve.fi Factory Pool: stETH-ng', coins: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x9e28a09452d2354fc4e15e3244dde27cbc4d52f12a10b91f2ca755b672bfa9be', tvlUsd: 21919007, createdAt: 1684243259 },\n { address: '0xc061caa073f3d95F80f8e5428d32D2d76F5e1622', name: 'USDG/USDC', coins: ['0xe343167631d89B6Ffc58B88d6b7fB0228795491D', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x1c7b77a94bb42408ab6d5cfd76223f0c794db9b119bb6035db91d8b09da65512', tvlUsd: 20042556, createdAt: 1757337995 },\n { address: '0xC2921134073151490193AC7369313c8e0b08e1E7', name: 'USDtb-USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xC139190F447e929f090Edeb554D95AbB8b18aC1C'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x003569f063c00de15be2ce5934449342555e009ef7ba9894ef84d302602b186f', tvlUsd: 19974424, createdAt: 1733348927 },\n { address: '0x83f24023d15d835a213df24fd309c47dAb5BEb32', name: 'YB cbBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0xb00ba7467a75fffe15d018cc822a09b282a285f4012f857b19966046b3191b3a', tvlUsd: 17762242, createdAt: 1758723599 },\n { address: '0x5dc1BF6f1e983C0b21EfB003c105133736fA0743', name: 'FRAXUSDe', coins: ['0x853d955aCEf822Db058eb8505911ED77F175b99e', '0x4c9EDD5852cd905f086C759E8383e09bff1E68B3'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x6aa12bb9b18854a3f453e240d7e960190a32f1c16a8e268a90a66c8a95fe3a86', tvlUsd: 16042488, createdAt: 1702770299 },\n { address: '0x13e12BB0E6A2f1A3d6901a59a9d585e89A6243e1', name: 'crvUSD/frxUSD', coins: ['0xCAcd6fd266aF91b8AeD52aCCc382b4e165586E29', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x6de2b24d7a8852d96955f6873f16402e61b5d9f3aff037f62a2004fecf31ce83', tvlUsd: 13934470, createdAt: 1752006431 },\n { address: '0x4DEcE678ceceb27446b35C672dC7d61F30bAD69E', name: 'Curve.fi Factory Plain Pool: crvUSD/USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [6, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 13078629, createdAt: 1684066067 },\n { address: '0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA', name: 'Curve.fi Factory USD Metapool: Liquity', coins: ['0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'], decimals: [18, 18], underlying: ['0x5f98805A4E8be255a32880FDeC7F6728C6568bA0', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [18, 18, 6, 6], basePool: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', poolType: 1, swapTypes: [1, 2], codeHash: '0x156700a4060f3d62786914b50cc60b2b840e6440401bea9a99c0acce0b58beda', tvlUsd: 12967284, createdAt: 1617702355 },\n { address: '0xf5f5B97624542D72A9E06f04804Bf81baA15e2B4', name: 'TricryptoUSDT', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [6, 8, 18], poolType: 30, swapTypes: [1], codeHash: '0xe5a06bd0c8f12bc66b551b99a34cdd7d2a286a53b778244c930a8f6db01fef40', tvlUsd: 12898000, createdAt: 1685482703 },\n { address: '0x4d9f9D15101EEC665F77210cB999639f760F831E', name: 'Curve.fi Factory Plain Pool: stETH/frxETH', coins: ['0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', '0x5E8422345238F34275888049021821E8E08CAa1f'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x8d287c58712fcd24b18f60f4a77a4a4d1a7a8bd10e3cb4c9d4752296b307aa51', tvlUsd: 12880550, createdAt: 1677059567 },\n { address: '0x383E6b4437b59fff47B619CBA855CA29342A8559', name: 'PayPool', coins: ['0x6c3ea9036406852006290770BEdFcAbA0e23A0e8', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x36356aefa486ac281df5aa3efb601b135b95da2c266bc4bf627aa6f4b4b22703', tvlUsd: 12266641, createdAt: 1703113055 },\n { address: '0xD51a44d3FaE010294C616388b506AcdA1bfAAE46', name: 'Curve.fi USD-BTC-ETH', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [6, 8, 18], poolType: 3, swapTypes: [1], codeHash: '0x9cb858c1d8e8ab8ba7dc273f146d428965b0ca686d05fb02cb4ffc62149ec928', tvlUsd: 10625171, createdAt: 1626218283 },\n { address: '0x390f3595bCa2Df7d23783dFd126427CCeb997BF4', name: 'Curve.fi Factory Plain Pool: crvUSD/USDT', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [6, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 9808682, createdAt: 1684066103 },\n { address: '0xDB74dfDD3BB46bE8Ce6C33dC9D82777BCFc3dEd5', name: 'weETH/WETH-ng', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0xf9b0b2342e2132b069f65bb801081a730df7cf80b2ef5a8b9a3fc7a6324724f3', tvlUsd: 9757307, createdAt: 1713832907 },\n { address: '0xB7ECB2AA52AA64a717180E030241bC75Cd946726', name: 'Curve.fi Factory Plain Pool: tBTC/WBTC', coins: ['0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0x18084fbA666a33d37592fA2633fD49a74DD93a88'], decimals: [8, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 8360462, createdAt: 1692136331 },\n { address: '0x5018BE882DccE5E3F2f3B0913AE2096B9b3fB61f', name: 'USDC/fxUSD', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x085780639CC2cACd35E474e71f4d000e2405d8f6'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x4a0e13c96d5dddf3d9a22d3ad7b65e6735199e857996056cbc4718ef4869bb48', tvlUsd: 7959448, createdAt: 1719632039 },\n { address: '0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4', name: 'Curve CVX-ETH', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B'], decimals: [18, 18], poolType: 2, swapTypes: [1], codeHash: '0x56ba0e921b89ed274e747d68fb8e49ba91fcc6fc4f7c1aaa5294c74b6a4b4d72', tvlUsd: 5926700, createdAt: 1639223635 },\n { address: '0xEFc6516323FbD28e80B85A497B65A86243a54B3E', name: 'BOLD/USDC Pool', coins: ['0x6440f144b7e50D6a8439336510312d2F54beB01D', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xd2c72b78d7d96bb962fa6429c4bb2e5dce6d92a5bc6712541ab76fe8e4570f07', tvlUsd: 5611794, createdAt: 1747597079 },\n { address: '0x7F86Bf177Dd4F3494b841a37e810A34dD56c829B', name: 'TricryptoUSDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [6, 8, 18], poolType: 30, swapTypes: [1], codeHash: '0xffceb70c60b48d7d02df8305161e44ec2454c1bc23fabc528e9a9ec71e4e7806', tvlUsd: 4972786, createdAt: 1685446211 },\n { address: '0x0Bdb2c3AF83EE1d3196FA64d3162e54624B5f6b0', name: 'USAT/USDT', coins: ['0x07041776f5007ACa2A54844F50503a18A72A8b68', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x9d0252403d580a95341bbddbecea09bbe280bd4d87f28ee8531a01d33119ba01', tvlUsd: 4647056, createdAt: 1772798639 },\n { address: '0xC09e82f81Cb811DB0922dD48206fc2e212322caf', name: 'World Liberty USD1 Pool', coins: ['0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d', '0x4f493B7dE8aAC7d55F71853688b1F7C8F0243C85'], decimals: [18, 18], underlying: ['0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [18, 6, 6], basePool: '0x4f493B7dE8aAC7d55F71853688b1F7C8F0243C85', poolType: 10, swapTypes: [1, 2], codeHash: '0x25478b25c12a81937ddb75e0c5ed8ca8ab248a102316873d092f49ca870b8cca', tvlUsd: 4343338, createdAt: 1756668467 },\n { address: '0x9c3B46C0Ceb5B9e304FCd6D88Fc50f7DD24B31Bc', name: 'Curve.fi Factory Plain Pool: frxETH/WETH', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0x5E8422345238F34275888049021821E8E08CAa1f'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x06a0d9fefe2940f35a5e0b347ff8e2f8085c76ce487b5b234b2e3c831160e34f', tvlUsd: 4279560, createdAt: 1692135095 },\n { address: '0x4f493B7dE8aAC7d55F71853688b1F7C8F0243C85', name: 'Curve.fi Strategic USD Reserves', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x5f0f1709fa823592ad75b27e32af00a8715d620dcb269be7c26fd5c873c1ce0e', tvlUsd: 4252884, createdAt: 1737825647 },\n { address: '0x2889302a794dA87fBF1D6Db415C1492194663D13', name: 'TricryptoLLAMA', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x18084fbA666a33d37592fA2633fD49a74DD93a88', '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0'], decimals: [18, 18, 18], poolType: 30, swapTypes: [1], codeHash: '0x0c6780573f9c77a247365e2cbeae61fe0af7ea94ded696b5ee5e6462ce51b02e', tvlUsd: 4217439, createdAt: 1686845315 },\n { address: '0x98a7F18d4E56Cfe84E3D081B40001B3d5bD3eB8B', name: 'Curve EURS-USDC', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdB25f211AB05b1c97D595516F45794528a807ad8'], decimals: [6, 2], poolType: 2, swapTypes: [1], codeHash: '0x6c0b789b9f2ee0cbb53935cbe4f88e7d66401e1b4508514c097e7bd81e8ea931', tvlUsd: 3939896, createdAt: 1635766643 },\n { address: '0x66039342C66760874047c36943B1e2d8300363BB', name: 'HemiBTC/cbBTC/WBTC', coins: ['0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf', '0x06ea695B91700071B161A434fED42D1DcbAD9f00'], decimals: [8, 8, 8], poolType: 10, swapTypes: [1], codeHash: '0x54a9f7fe4f6e0880c3e7f886d1a0500619b0539dd9d9067221a526ece460e6f7', tvlUsd: 3547580, createdAt: 1764180299 },\n { address: '0xE521BA88837B2726E5343ccA91adA6f19F356C45', name: 'USDx/USDT', coins: ['0xa1fA7777974312f7d801A8880714a218F76233f8', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0x74bb764c9dffe15ac160f6d01f6bdc1e4b03d39722083e674476ed6843c11d33', tvlUsd: 3020901, createdAt: 1788328955 },\n { address: '0x6F63deEDc9870D6c16FC644C6654748352cdc87c', name: 'apxUSD-USDC v3', coins: ['0x98A878b1Cd98131B271883B390f68D2c90674665', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xe511d7fa636d58614f82e35f2f333d1ed931f75baed8b7b89d2b1ef09825ef26', tvlUsd: 2796538, createdAt: 1785427007 },\n { address: '0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14', name: 'TriCRV', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0xD533a949740bb3306d119CC777fa900bA034cd52'], decimals: [18, 18, 18], poolType: 30, swapTypes: [1], codeHash: '0xf29fb95ca44fe2f979303e309cbaba61d44dd503fddeb111caae94e1b0857154', tvlUsd: 2439038, createdAt: 1690291775 },\n { address: '0x04710a7B238386Da58EfAd8b65E150e5E17AA522', name: 'USDC/sUSDat', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xD166337499E176bbC38a1FBd113Ab144e5bd2Df7'], decimals: [6, 18], poolType: 20, swapTypes: [1], codeHash: '0x11ecb979f7468e539cb2ee92b8cf7c59d56b1c97b9fdce333fe1d35ac5c8e110', tvlUsd: 2187783, createdAt: 1785550511 },\n { address: '0xE47E8Ced9D94AA43C922627782E29b41a93202AF', name: 'FIDD/USDC', coins: ['0x7C135549504245B5eAe64fc0E99Fa5ebabb8e35D', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0x11743a6ed542b23b65182e0c5a7b7d90b668a189f287b7c0c367b2f910d46c10', tvlUsd: 2074444, createdAt: 1770210611 },\n { address: '0x8273Cb2cF9AF3228fD14AF25B5B1De2A9676C372', name: 'FIDD/USDT', coins: ['0x7C135549504245B5eAe64fc0E99Fa5ebabb8e35D', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xb1b0592d31b5fc1b46f56ffaecca522725e94a0e56facab038cb92d8b5e0f2e5', tvlUsd: 1750912, createdAt: 1770210935 },\n { address: '0x839d6bDeDFF886404A6d7a788ef241e4e28F4802', name: 'cbBTC/wBTC', coins: ['0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'], decimals: [8, 8], poolType: 10, swapTypes: [1], codeHash: '0x5270c4f3873d43de1babb9754a903f0de33054dfb7d562c3a3fcadbb8fd3fbca', tvlUsd: 1688187, createdAt: 1725600707 },\n { address: '0xa4c567c662349BeC3D0fB94C4e7f85bA95E208e4', name: 'Curve.fi Factory Plain Pool: msETH/WETH', coins: ['0x64351fC9810aDAd17A690E4e1717Df5e7e085160', '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x148d1345059482faa8834aff0630c9a4b47393df8edf9d99605b8f2f04752f62', tvlUsd: 1672158, createdAt: 1690864487 },\n { address: '0xbcb91E689114B9Cc865AD7871845C95241Df4105', name: 'Curve.fi Factory USD Metapool: PWRD Metapool', coins: ['0xF0a93d4994B3d98Fb5e3A2F90dBc2d69073Cb86b', '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'], decimals: [18, 18], underlying: ['0xF0a93d4994B3d98Fb5e3A2F90dBc2d69073Cb86b', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [18, 18, 6, 6], basePool: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', poolType: 1, swapTypes: [1, 2], codeHash: '0xf6083ac638c10e3ca56ad0183f22c4bb24fda0f4c180165327954b3dfae28541', tvlUsd: 1438819, createdAt: 1632839676 },\n { address: '0x635EF0056A597D13863B73825CcA297236578595', name: 'GHO/crvUSD', coins: ['0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0x1517d1f4caa802ab0ddf9032274a7ff3781a1453ef7b278fc63245b492154ce2', tvlUsd: 1377020, createdAt: 1709732591 },\n { address: '0xC15F285679a1Ef2d25F53D4CbD0265E1D02F2A92', name: 'Curve.fi Factory Crypto Pool: FXN/ETH', coins: ['0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0x365AccFCa291e7D3914637ABf1F7635dB165Bb09'], decimals: [18, 18], poolType: 2, swapTypes: [1], codeHash: '0x6dfb9f924888fe0d10b50c35ced3f2cf372073a7e524450f1ebe491415db66e0', tvlUsd: 1244529, createdAt: 1695111311 },\n { address: '0x625E92624Bc2D88619ACCc1788365A69767f6200', name: 'pyUSD/crvUSD', coins: ['0x6c3ea9036406852006290770BEdFcAbA0e23A0e8', '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0x9c3b1c5ac877c1719736bb325d05eb2806f292776a2121a6f1e8a54d31960dbe', tvlUsd: 1175516, createdAt: 1703109587 },\n { address: '0xD9FF8396554A0d18B2CFbeC53e1979b7ecCe8373', name: 'YB WBTC', coins: ['0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599'], decimals: [18, 8], poolType: 20, swapTypes: [1], codeHash: '0x1578c5a836891e466a1fa5879bc7f0e36bfd9fc625586765541191d8cd3880ae', tvlUsd: 1167762, createdAt: 1758723347 },\n { address: '0x971add32Ea87f10bD192671630be3BE8A11b8623', name: 'Curve.fi Factory Plain Pool: cvxCrv/Crv', coins: ['0xD533a949740bb3306d119CC777fa900bA034cd52', '0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7'], decimals: [18, 18], poolType: 1, swapTypes: [1], codeHash: '0x148d1345059482faa8834aff0630c9a4b47393df8edf9d99605b8f2f04752f62', tvlUsd: 1151010, createdAt: 1678280183 },\n { address: '0xF4d0CF32908b2C7f1021339c43Df0F77f06896d7', name: 'USDC/USDat', coins: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0x23238f20b894f29041f48D88eE91131C395Aaa71'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x3c0abdd2996e01d3bff6d4430c231f8dd9f539985066729c28fbb2596ecd6e99', tvlUsd: 1107886, createdAt: 1775403179 },\n { address: '0x5B03CcCAb7BA3010fA5CAd23746cbf0794938e96', name: 'Curve Strategic Ethena Reserves', coins: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', '0x4c9EDD5852cd905f086C759E8383e09bff1E68B3'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0xbe6391aadd1d4d306c76728d664997ab7a1ef56c16565ca0d1526050b9c93890', tvlUsd: 1084518, createdAt: 1739457767 },\n { address: '0x4f062658EaAF2C1ccf8C8e36D6824CDf41167956', name: 'Curve.fi GUSD/3Crv', coins: ['0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd', '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'], decimals: [2, 18], underlying: ['0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd', '0x6B175474E89094C44Da98b954EedeAC495271d0F', '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], underlyingDecimals: [2, 18, 6, 6], basePool: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', poolType: 1, swapTypes: [1, 2], codeHash: '0xce79330162abf07fc163331f9d9d1553b93dbf509eeafa1215fafa6113c5088e', tvlUsd: 1068354, createdAt: 1602040124 },\n { address: '0xD6937eA8D33B0C21348F36F7895FdE3054bA4927', name: 'frxUSD/USDT', coins: ['0xCAcd6fd266aF91b8AeD52aCCc382b4e165586E29', '0xdAC17F958D2ee523a2206206994597C13D831ec7'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xadf65a4e5ed895c5c85762d0b52d482664f1e26976e8401b39e95cd838e25998', tvlUsd: 1005528, createdAt: 1789499843 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Optimism (10), router ABI ng5. On-chain checks at block 159152475: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/optimism.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_10: CurveChainPools = {\n chainId: 10,\n builtAt: '2026-11-05',\n block: 159152475,\n pools: [\n { address: '0xD1b30BA128573fcd7D141C8A987961b40e047BB6', name: 'crvUSD/USDT', coins: ['0xC52D7F23a2e460248Db6eE192Cb23dD12bDDCbf6', '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0xde251e17bf12e902d51f15ea5c2658888801dbb5f6c5095e226bdb808084bd98', tvlUsd: 250955, createdAt: 1703088383 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Gnosis (100), router ABI ng5. On-chain checks at block 49126652: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/xdai.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_100: CurveChainPools = {\n chainId: 100,\n builtAt: '2026-11-05',\n block: 49126652,\n pools: [\n { address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353', name: 'Curve.fi wxDAI/USDC/USDT', coins: ['0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', '0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83', '0x4ECaBa5870353805a9F068101A40E0f32ed605C6'], decimals: [18, 6, 6], poolType: 1, swapTypes: [1], codeHash: '0x855fc847a134dc1d35593a59c460e334938f53cb115b2befa8174138a1bb3df6', tvlUsd: 447779, createdAt: 1625016390 },\n { address: '0x0eCEC6F5276d2Ec6bB864F063D2b76393d6A1A74', name: 'USDCe/EURe', coins: ['0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0', '0x420CA0f9B9b604cE0fd9C18EF134C705e5Fa3430'], decimals: [6, 18], poolType: 20, swapTypes: [1], codeHash: '0x0287322b54143499eae6ce611f7895d7f37426f60565a7d1e228dac396ad1a89', tvlUsd: 360118, createdAt: 1786365280 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Monad (143), router ABI lite4. On-chain checks at block 119683641: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api2.curve.finance/get_pools/143.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_143: CurveChainPools = {\n chainId: 143,\n builtAt: '2026-11-05',\n block: 119683641,\n pools: [\n { address: '0xFd945d71D4E9609a1FAb0aE9c30dA8088E7AEE1E', name: 'USDat/USDC', coins: ['0x0Bb150DFa86EA5d7742F07FEfCD8E8edA81D64eF', '0x754704Bc059F8C67012fEd69BC8A327a5aafb603'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0xd5d05317249e8e17bd8c67a05048a7115ec719e3f4198ddfa560b7c0b3b620f6', tvlUsd: 2005448, createdAt: 1784210436 },\n { address: '0x942644106B073E30D72c2C5D7529D5C296ea91ab', name: '3pool', coins: ['0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a', '0x754704Bc059F8C67012fEd69BC8A327a5aafb603', '0xe7cd86e13AC4309349F30B3435a9d337750fC82D'], decimals: [6, 6, 6], poolType: 10, swapTypes: [1], codeHash: '0x93a67dae1693a9327ff151167502f6785ac856025182eebd61150f4e0ea92ffa', tvlUsd: 1442204, createdAt: 1763939652 },\n { address: '0xD665CaAD68ACb093AFF27eC6c71Ccc4F29c28147', name: 'AUSD/trUSD', coins: ['0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a', '0x770a579Ea200784723B31b8668b0773ba80393c9'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0xb7af5a0364e252d950458f28c2d14434dd2961cef09ca1e2f90d7b1a96403a00', tvlUsd: 683014, createdAt: 1790778034 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// X Layer (196), router ABI lite4. On-chain checks at block 75134757: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/x-layer.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_196: CurveChainPools = {\n chainId: 196,\n builtAt: '2026-11-05',\n block: 75134757,\n pools: [\n { address: '0x5B3f7F05b79f3cCBe8F33374A578e14dBBb28478', name: 'USDC/USDT0', coins: ['0xB6CEceAB302E2E4948951eE7843FC24E92933061', '0x779Ded0c9e1022225f8E0630b35a9b54bE713736'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x78281e9e5a691fe225a5c246be69cc35d48e81f4e1c0bcca178121fa41612961', tvlUsd: 300301, createdAt: 1786522937 },\n { address: '0x31F066aA0A687d4F383F96a514984AF727Eb8e38', name: 'USDG/USD0', coins: ['0x4ae46a509F6b1D9056937BA4500cb143933D2dc8', '0x779Ded0c9e1022225f8E0630b35a9b54bE713736'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x855800c63268949eadd5206e5729c69e768f017722f275e90c4185b1fb0733bc', tvlUsd: 300095, createdAt: 1758717026 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Base (8453), router ABI ng5. On-chain checks at block 53566756: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/base.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_8453: CurveChainPools = {\n chainId: 8453,\n builtAt: '2026-11-05',\n block: 53566756,\n pools: [\n { address: '0x302A94E3C28c290EAF2a4605FC52e11Eb915f378', name: 'superOETHb/WETH', coins: ['0x4200000000000000000000000000000000000006', '0xDBFeFD2e8460a6Ee4955A68582F85708BAEA60A3'], decimals: [18, 18], poolType: 10, swapTypes: [1], codeHash: '0xd77abce9f34194324a3f8633aa5132f90aaa293ce9b1d7cfe9616bfaff0b9794', tvlUsd: 5842454, createdAt: 1737744997 },\n { address: '0x11C1fBd4b3De66bC0565779b35171a6CF3E71f59', name: 'Curve.fi Factory Crypto Pool: cbETH/WETH', coins: ['0x4200000000000000000000000000000000000006', '0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22'], decimals: [18, 18], poolType: 2, swapTypes: [1], codeHash: '0xbba8650811de0f6d2cc92316e9826589443d72feebb6805b2655e81073abe834', tvlUsd: 1016724, createdAt: 1693260297 },\n { address: '0xfac15A759d0F887Bc7F5ab874491258CF6EC8acE', name: 'TriBitcoin', coins: ['0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf', '0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b', '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c'], decimals: [8, 18, 8], poolType: 10, swapTypes: [1], codeHash: '0x51b2520df586800fd89a56f3a098e1a50e175f72b28088201682deb31bec0022', tvlUsd: 563901, createdAt: 1760081729 },\n { address: '0x6e53131F68a034873b6bFA15502aF094Ef0c5854', name: 'tricrypto', coins: ['0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93', '0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b', '0x4200000000000000000000000000000000000006'], decimals: [18, 18, 18], poolType: 30, swapTypes: [1], codeHash: '0x437ca50fd4d25807efaa7d45077d247057a5e16b90609fcfde0b51f3673426d3', tvlUsd: 270418, createdAt: 1693263329 },\n { address: '0xf6C5F01C7F3148891ad0e19DF78743D31E390D1f', name: 'Curve.fi Factory Plain Pool: 4pool', coins: ['0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', '0xEB466342C4d449BC9f53A865D5Cb90586f405215', '0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93'], decimals: [6, 6, 6, 18], poolType: 1, swapTypes: [1], codeHash: '0xca87b5689cf421c7b6a160ea2b22bd23ef9267477918f39a2bbdf3cb838a987d', tvlUsd: 254106, createdAt: 1693751021 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Plasma (9745), router ABI lite4. On-chain checks at block 36960466: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api2.curve.finance/get_pools/9745.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_9745: CurveChainPools = {\n chainId: 9745,\n builtAt: '2026-11-05',\n block: 36960466,\n pools: [\n { address: '0x2D84D79C852f6842AbE0304b70bBaA1506AdD457', name: 'USDT0/USDe', coins: ['0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb', '0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34'], decimals: [6, 18], poolType: 10, swapTypes: [1], codeHash: '0xc001cdbdd189f52d922cba4eec3137b5698c715d2370d67a41b937e7793b8bd2', tvlUsd: 719322, createdAt: 1758191172 },\n { address: '0x085BaD2C28Bdd4A40396072D3eb2636BF7Afa39c', name: 'yzUSD/USDT0', coins: ['0x6695c0f8706C5ACe3Bdf8995073179cCA47926dc', '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb'], decimals: [18, 6], poolType: 10, swapTypes: [1], codeHash: '0x8714b6160e5494b54383f64ebd4c8607093175dd697e48655cfd21df80b81804', tvlUsd: 596466, createdAt: 1762342995 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs on 2026-11-05. Do not edit by hand: rerun the script.\n// Arbitrum (42161), router ABI ng5. On-chain checks at block 521558965: coins(i), decimals(),\n// balances(i) > 0, code hash, MetaRegistry/factory registration, get_dy(0, 1, ~$100).\n// Rules: TVL >= $250,000 (on-chain balances of catalog/crvUSD coins x API prices), age >= 30 days, top 40 by TVL;\n// no hidden/broken pools, no stable-ng asset type 2/3, no foreign rate oracles. Discovery: api.curve.finance/v1/getPools/all/arbitrum.\nimport type { CurveChainPools } from './types.js'\n\nexport const POOLS_42161: CurveChainPools = {\n chainId: 42161,\n builtAt: '2026-11-05',\n block: 521558965,\n pools: [\n { address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353', name: 'Curve.fi USDC/USDT', coins: ['0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'], decimals: [6, 6], poolType: 1, swapTypes: [1], codeHash: '0xc9c2956ac40175996b15ae3a750b84226736322c5c1aef3e6815b77aab3cb27e', tvlUsd: 630740, createdAt: 1631439440 },\n { address: '0x186cF879186986A20aADFb7eAD50e3C20cb26CeC', name: '2BTC-ng', coins: ['0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', '0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40'], decimals: [8, 18], poolType: 10, swapTypes: [1], codeHash: '0xaeb505d765c57572cafa881bfcae2cba4e39f933fa7eea85e952ca3b5e1e6a7d', tvlUsd: 509842, createdAt: 1718829260 },\n { address: '0x82670f35306253222F8a165869B28c64739ac62e', name: 'Tricrypto-crvUSD', coins: ['0x498Bf2B1e120FeD3ad3D42EA2165E9b73f99C1e5', '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1'], decimals: [18, 8, 18], poolType: 30, swapTypes: [1], codeHash: '0x35da327ca48b6e428478467c3996176d71855383e82d30664f95886822fd507d', tvlUsd: 328993, createdAt: 1704150579 },\n { address: '0x49b720F1Aab26260BEAec93A7BeB5BF2925b2A8F', name: 'Strategic USD Reserves', coins: ['0xaf88d065e77c8cC2239327C5EDb3A432268e5831', '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'], decimals: [6, 6], poolType: 10, swapTypes: [1], codeHash: '0x27724587b6447859a96567a97e5bf015b8e5ae3d90ffdbe97a098c30b268703c', tvlUsd: 257764, createdAt: 1739092049 },\n ],\n} as const\n","// Generated by scripts/build-allowlist.mjs. Do not edit by hand: rerun the script.\nimport type { CurveChainPools } from './types.js'\nimport { POOLS_1 } from './1.js'\nimport { POOLS_10 } from './10.js'\nimport { POOLS_100 } from './100.js'\nimport { POOLS_143 } from './143.js'\nimport { POOLS_196 } from './196.js'\nimport { POOLS_8453 } from './8453.js'\nimport { POOLS_9745 } from './9745.js'\nimport { POOLS_42161 } from './42161.js'\n\nexport type { CurveChainPools, CurvePool, Hex } from './types.js'\n\n/** Curated Curve pools per chain id. A chain missing here has no pool that passed the rules. */\nexport const CURVE_POOLS: Readonly<Record<number, CurveChainPools>> = Object.freeze({\n 1: POOLS_1,\n 10: POOLS_10,\n 100: POOLS_100,\n 143: POOLS_143,\n 196: POOLS_196,\n 8453: POOLS_8453,\n 9745: POOLS_9745,\n 42161: POOLS_42161,\n})\n","/**\n * Routes over the curated pool allowlist: a token graph built from the pools the package pins (coins, and the\n * underlying coins of metapools that allow `exchange_underlying`), plus the router's own pseudo-hops — swap_type 8\n * between the native coin and the pinned wrapped native, and on router v1.2 swap_type 9 between crvUSD and scrvUSD.\n * Routes cross at most {@link MAX_ROUTE_POOLS} pools. A token a route hands its funds through between two hops must be\n * one the swap2-assets catalog lists on the chain by address, or the native coin / the pinned wrapped native\n * ({@link intermediateAllowed}); a pool's other coins, which the route does not touch, may be anything the allowlist\n * admitted. `exchange_underlying` (swap_type 2) runs on a metapool only while its base pool is allowlisted too.\n *\n * `checkRoute` is the same rule set read back from router arguments: what the provider builds, `curveVerifyQuote`\n * (on the client, for a remote quote) and `preflightDeposit` all pass through it.\n */\nimport {getAddress} from \"viem\";\nimport {ccAssetByToken} from \"@anywalletkit/swap2-assets\";\nimport type {RouterArgs} from \"./abi.js\";\nimport {CURVE_DENIED_POOLS, MAX_ROUTE_POOLS, MAX_ROUTE_STEPS, ZERO_ADDRESS, type CurveDeployment} from \"./deployments.js\";\nimport type {CurveChainPools, CurvePool, Hex} from \"./pools/types.js\";\nimport {noted} from \"./reasons.js\";\n\n/** One router step: a pool swap, the native ↔ wrapped-native hop (8) or the ERC-4626 hop (9). */\nexport type CurveStep =\n | {kind: \"pool\"; pool: CurvePool; swapType: 1 | 2; i: number; j: number; tokenIn: Hex; tokenOut: Hex}\n | {kind: \"wrap\"; weth: Hex; tokenIn: Hex; tokenOut: Hex}\n | {kind: \"erc4626\"; vault: Hex; deposit: boolean; tokenIn: Hex; tokenOut: Hex};\n\nexport interface CurveRoute {\n steps: readonly CurveStep[];\n /** Human description for the review / logs, e.g. \"3pool\", \"wrap → TricryptoUSDT\". */\n label: string;\n}\n\n/** Most candidate routes priced for one quote (three JSON-RPC batches of ten). */\nexport const MAX_QUOTE_CANDIDATES = 30;\n/** Partial paths explored before the search gives up (an allowlist far larger than any curated one). */\nconst MAX_EXPLORED = 20_000;\n\nconst lc = (a: string) => a.toLowerCase();\nconst STABLE_POOL_TYPES = new Set([1, 10]);\n\n/**\n * Whether a route may hand the swap through `token` between two hops on `chainId`: the router's native sentinel, the\n * pinned wrapped native, or a token the swap2-assets catalog lists on that chain, matched by address. The source and\n * the destination follow the engine's listed / unlisted token policy instead (as for every provider).\n */\nexport function intermediateAllowed(chainId: number, deployment: CurveDeployment, token: string): boolean {\n const t = lc(token);\n if (t === lc(deployment.eth)) return true;\n if (t === lc(deployment.weth)) return t !== lc(ZERO_ADDRESS);\n if (!/^0x[0-9a-f]{40}$/.test(t) || t === lc(ZERO_ADDRESS)) return false;\n const listed = ccAssetByToken(`eip155:${chainId}`, t);\n return !!listed?.contract && lc(listed.contract) === t;\n}\n\n/**\n * Whether `exchange_underlying` (swap_type 2) may run on `pool`, given the chain's allowlisted pools `index`: only on a\n * metapool that names its base pool, with that base pool itself allowlisted (and not denied), and `underlying` the\n * meta coins followed by the base pool's coins. Never on a lending pool (no base pool): its underlying route deposits\n * into the lending venue, which a `get_dy` view never touches (Aave v2 on Polygon has every reserve frozen).\n */\nexport function underlyingAllowed(pool: CurvePool, index: ReadonlyMap<string, CurvePool>): boolean {\n const under = pool.underlying;\n if (!under || under.length < 2 || !pool.swapTypes.includes(2)) return false;\n if (!pool.basePool) return false;\n const base = index.get(lc(pool.basePool));\n if (!base || base === pool) return false;\n const meta = pool.coins.length - 1;\n if (under.length !== meta + base.coins.length) return false;\n return under.every((c, k) => lc(c) === lc(k < meta ? pool.coins[k]! : base.coins[k - meta]!));\n}\n\n/** Pool types the router family can execute: `[4][5]` routers speak only to NG pools (stable-ng, twocrypto-ng, tricrypto-ng). */\nexport function poolTypeAllowed(family: CurveDeployment[\"family\"], poolType: number): boolean {\n return family === \"ng5\" ? [1, 2, 3, 10, 20, 30].includes(poolType) : [10, 20, 30].includes(poolType);\n}\n\ninterface Graph {\n edges: Map<string, CurveStep[]>;\n byAddress: Map<string, CurvePool>;\n}\n\nconst graphs = new WeakMap<CurveChainPools, WeakMap<CurveDeployment, Graph>>();\n\n/** Allowlisted pools by address (lowercase), denied pools left out. */\nexport function poolIndex(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined): Map<string, CurvePool> {\n return graphFor(chainId, deployment, table).byAddress;\n}\n\nfunction graphFor(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined): Graph {\n if (!table) return {edges: new Map(), byAddress: new Map()};\n let perDeployment = graphs.get(table);\n if (!perDeployment) graphs.set(table, (perDeployment = new WeakMap()));\n let g = perDeployment.get(deployment);\n if (g) return g;\n g = {edges: new Map(), byAddress: new Map()};\n const denied = CURVE_DENIED_POOLS[chainId];\n const eth = lc(deployment.eth);\n const add = (s: CurveStep) => {\n const k = lc(s.tokenIn);\n const list = g!.edges.get(k);\n if (list) list.push(s);\n else g!.edges.set(k, [s]);\n };\n for (const pool of table.chainId === chainId ? table.pools : []) {\n const key = lc(pool.address);\n if (denied?.has(key) || g.byAddress.has(key) || !poolTypeAllowed(deployment.family, pool.poolType)) continue;\n if (!/^0x[0-9a-fA-F]{40}$/.test(pool.address) || pool.coins.length < 2 || pool.coins.length > 8) continue;\n // A `[4][5]` router never forwards the native coin to a pool: a pool listing it would take nothing.\n if (deployment.family === \"lite4\" && [...pool.coins, ...(pool.underlying ?? [])].some((c) => lc(c) === eth)) continue;\n g.byAddress.set(key, pool);\n }\n // Edges once every pool is indexed: a metapool's underlying edges need its base pool's entry.\n for (const pool of g.byAddress.values()) {\n const pairs = new Set<string>();\n if (pool.swapTypes.includes(1)) {\n pool.coins.forEach((a, i) => pool.coins.forEach((b, j) => {\n if (i === j || lc(a) === lc(b)) return;\n pairs.add(`${lc(a)}>${lc(b)}`);\n add({kind: \"pool\", pool, swapType: 1, i, j, tokenIn: getAddress(a), tokenOut: getAddress(b)});\n }));\n }\n const under = pool.underlying;\n if (under && underlyingAllowed(pool, g.byAddress) && (deployment.family === \"ng5\" || pool.poolType === 10)) {\n under.forEach((a, i) => under.forEach((b, j) => {\n if (i === j || lc(a) === lc(b) || pairs.has(`${lc(a)}>${lc(b)}`)) return;\n add({kind: \"pool\", pool, swapType: 2, i, j, tokenIn: getAddress(a), tokenOut: getAddress(b)});\n }));\n }\n }\n if (lc(deployment.weth) !== lc(ZERO_ADDRESS)) {\n add({kind: \"wrap\", weth: getAddress(deployment.weth), tokenIn: getAddress(deployment.eth), tokenOut: getAddress(deployment.weth)});\n add({kind: \"wrap\", weth: getAddress(deployment.weth), tokenIn: getAddress(deployment.weth), tokenOut: getAddress(deployment.eth)});\n }\n const v = erc4626Of(deployment);\n if (v) {\n add({kind: \"erc4626\", vault: getAddress(v.vault), deposit: true, tokenIn: getAddress(v.asset), tokenOut: getAddress(v.vault)});\n add({kind: \"erc4626\", vault: getAddress(v.vault), deposit: false, tokenIn: getAddress(v.vault), tokenOut: getAddress(v.asset)});\n }\n perDeployment.set(deployment, g);\n return g;\n}\n\n/** The ERC-4626 hop a deployment may use: only a `[5][5]` router at v1.2 (v1.1 reverts \"Bad swap type\"). */\nfunction erc4626Of(d: CurveDeployment): {vault: Hex; asset: Hex} | undefined {\n return d.erc4626 && d.family === \"ng5\" && d.version === \"1.2.0\" ? d.erc4626 : undefined;\n}\n\nconst minTvl = (r: readonly CurveStep[]) => r.reduce((m, s) => (s.kind === \"pool\" ? Math.min(m, s.pool.tvlUsd) : m), Number.POSITIVE_INFINITY);\nconst poolCount = (r: readonly CurveStep[]) => r.filter((s) => s.kind === \"pool\").length;\n\n/**\n * Candidate routes tokenIn → tokenOut: at most {@link MAX_ROUTE_POOLS} pools and {@link MAX_ROUTE_STEPS} steps, no\n * token or pool twice, at most one wrap and one ERC-4626 hop. Ranked fewest pools first, then by the thinnest pool's\n * TVL, and cut to `limit`. `truncated` says the cut (or the search budget) dropped some.\n */\nexport function findRoutes(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined, tokenIn: Hex, tokenOut: Hex, limit = MAX_QUOTE_CANDIDATES): {routes: CurveRoute[]; truncated: boolean} {\n const g = graphFor(chainId, deployment, table);\n const want = lc(tokenOut);\n const found: CurveStep[][] = [];\n let explored = 0;\n let exhausted = false;\n const walk = (at: string, path: CurveStep[], seenTokens: Set<string>, seenPools: Set<string>) => {\n if (exhausted) return;\n for (const s of g.edges.get(at) ?? []) {\n if (++explored > MAX_EXPLORED) { exhausted = true; return; }\n const next = lc(s.tokenOut);\n if (seenTokens.has(next)) continue;\n if (next !== want && !intermediateAllowed(chainId, deployment, next)) continue;\n if (s.kind === \"pool\" && (seenPools.has(lc(s.pool.address)) || poolCount(path) >= MAX_ROUTE_POOLS)) continue;\n if (s.kind !== \"pool\" && path.some((p) => p.kind === s.kind)) continue;\n const steps = [...path, s];\n if (next === want) {\n if (poolCount(steps) > 0 || steps.some((x) => x.kind === \"erc4626\")) found.push(steps);\n continue;\n }\n if (steps.length >= MAX_ROUTE_STEPS) continue;\n seenTokens.add(next);\n if (s.kind === \"pool\") seenPools.add(lc(s.pool.address));\n walk(next, steps, seenTokens, seenPools);\n seenTokens.delete(next);\n if (s.kind === \"pool\") seenPools.delete(lc(s.pool.address));\n }\n };\n walk(lc(tokenIn), [], new Set([lc(tokenIn)]), new Set());\n found.sort((a, b) => poolCount(a) - poolCount(b) || minTvl(b) - minTvl(a) || a.length - b.length);\n return {routes: found.slice(0, limit).map((steps) => ({steps, label: labelOf(steps)})), truncated: exhausted || found.length > limit};\n}\n\nfunction labelOf(steps: readonly CurveStep[]): string {\n return steps.map((s) => (s.kind === \"pool\" ? `${s.pool.name}${s.swapType === 2 ? \" (underlying)\" : \"\"}` : s.kind === \"wrap\" ? (s.tokenOut === s.weth ? \"wrap\" : \"unwrap\") : s.deposit ? \"scrvUSD deposit\" : \"scrvUSD redeem\")).join(\" → \");\n}\n\n/** The router's `_route` / `_swap_params` for a route, in the deployment's ABI family. */\nexport function routeArgs(family: CurveDeployment[\"family\"], route: CurveRoute): RouterArgs {\n if (route.steps.length < 1 || route.steps.length > MAX_ROUTE_STEPS) throw new Error(`curve: a route has 1–${MAX_ROUTE_STEPS} steps`);\n const path: Hex[] = [route.steps[0]!.tokenIn];\n const params: bigint[][] = [];\n for (const s of route.steps) {\n const swap = s.kind === \"pool\" ? s.pool.address : s.kind === \"wrap\" ? s.weth : s.vault;\n path.push(getAddress(swap), s.tokenOut);\n const row = s.kind === \"pool\"\n ? [BigInt(s.i), BigInt(s.j), BigInt(s.swapType), BigInt(s.pool.poolType), BigInt((s.swapType === 2 ? s.pool.underlying! : s.pool.coins).length)]\n : s.kind === \"wrap\" ? [0n, 0n, 8n, 0n, 0n] : [s.deposit ? 0n : 1n, 0n, 9n, 0n, 0n];\n params.push(family === \"ng5\" ? row : row.slice(0, 4));\n }\n while (path.length < 11) path.push(ZERO_ADDRESS);\n const cols = family === \"ng5\" ? 5 : 4;\n while (params.length < 5) params.push(new Array<bigint>(cols).fill(0n));\n return {route: path, params};\n}\n\n/** Pool addresses a route's router arguments cross, in order. */\nexport function routePools(args: RouterArgs): Hex[] {\n const out: Hex[] = [];\n for (let k = 0; k < 5; k++) {\n const swap = args.route[2 * k + 1];\n const t = args.params[k]?.[2];\n if (!swap || lc(swap) === lc(ZERO_ADDRESS)) break;\n if (t === 1n || t === 2n) out.push(swap);\n }\n return out;\n}\n\n/**\n * Whether router arguments are a route this module would build on `chainId`: from `tokenIn` to `tokenOut`, every pool\n * hop through an allowlisted (and not denied) pool whose pinned coins at `i`/`j` are the hop's tokens, with the pool's\n * own pool type, an allowed swap type (1, or 2 for a metapool listing it whose base pool is allowlisted too) and its\n * coin count; every token between two hops a catalog token, the native coin or the pinned wrapped native; swap_type 8 only through\n * the pinned wrapped native between it and the native sentinel; swap_type 9 only on a v1.2 router through its pinned\n * ERC-4626 vault; no other swap type; at most {@link MAX_ROUTE_POOLS} pools, {@link MAX_ROUTE_STEPS} steps, no pool\n * twice, and nothing after the route's end. The reason it is not, or null.\n */\nexport function checkRoute(chainId: number, deployment: CurveDeployment, table: CurveChainPools | undefined, args: RouterArgs, tokenIn: string, tokenOut: string): string | null {\n const cols = deployment.family === \"ng5\" ? 5 : 4;\n if (args.route.length !== 11 || args.params.length !== 5 || args.params.some((r) => r.length !== cols)) return noted(`the route is not address[11] with uint256[${cols}][5]`, \"policy_refused\");\n const index = poolIndex(chainId, deployment, table);\n const zero = lc(ZERO_ADDRESS);\n const eth = lc(deployment.eth);\n const weth = lc(deployment.weth);\n const v = erc4626Of(deployment);\n let steps = 0;\n while (steps < 5 && lc(args.route[2 * steps + 1]!) !== zero) steps++;\n if (steps === 0) return noted(\"the route has no step\", \"policy_refused\");\n if (steps > MAX_ROUTE_STEPS) return noted(`the route has ${steps} steps, more than ${MAX_ROUTE_STEPS}`, \"policy_refused\");\n for (let k = 2 * steps + 1; k < 11; k++) if (lc(args.route[k]!) !== zero) return noted(\"the route names addresses after its end\", \"policy_refused\");\n for (let k = steps; k < 5; k++) if (args.params[k]!.some((x) => x !== 0n)) return noted(\"the swap params carry rows after the route's end\", \"policy_refused\");\n if (lc(args.route[0]!) !== lc(tokenIn)) return noted(`the route starts at ${args.route[0]}, not the source token`, \"policy_refused\");\n if (lc(args.route[2 * steps]!) !== lc(tokenOut)) return noted(`the route ends at ${args.route[2 * steps]}, not the destination token`, \"price_check_failed\");\n for (let k = 1; k < steps; k++) {\n if (!intermediateAllowed(chainId, deployment, args.route[2 * k]!)) return noted(`step ${k} hands the swap through ${args.route[2 * k]}, a token the catalog does not list on this chain`, \"policy_refused\");\n }\n const pools = new Set<string>();\n let wraps = 0;\n let vaults = 0;\n for (let k = 0; k < steps; k++) {\n const a = lc(args.route[2 * k]!);\n const swap = lc(args.route[2 * k + 1]!);\n const b = lc(args.route[2 * k + 2]!);\n const row = args.params[k]!;\n const type = row[2]!;\n if (a === b) return noted(`step ${k + 1} trades a token for itself`, \"policy_refused\");\n if (type === 1n || type === 2n) {\n if (CURVE_DENIED_POOLS[chainId]?.has(swap)) return noted(`step ${k + 1} crosses ${args.route[2 * k + 1]}, a pool this module refuses (fake coin, drained in 2023, or over a dead venue)`, \"vault_mismatch\");\n const pool = index.get(swap);\n if (!pool) return noted(`step ${k + 1} crosses ${args.route[2 * k + 1]}, which is not in the pool allowlist`, \"vault_mismatch\");\n if (pools.has(swap)) return noted(`the route crosses ${args.route[2 * k + 1]} twice`, \"policy_refused\");\n pools.add(swap);\n if (!pool.swapTypes.includes(type === 1n ? 1 : 2)) return noted(`step ${k + 1} uses swap_type ${type}, which pool ${pool.name} does not allow`, \"policy_refused\");\n if (row[3] !== BigInt(pool.poolType)) return noted(`step ${k + 1} names pool_type ${row[3]}, not pool ${pool.name}'s ${pool.poolType}`, \"policy_refused\");\n if (type === 2n && deployment.family === \"lite4\" && pool.poolType !== 10) return noted(`step ${k + 1}: exchange_underlying is for stable-ng metapools on this router`, \"policy_refused\");\n if (type === 2n && !underlyingAllowed(pool, index)) return noted(`step ${k + 1}: exchange_underlying on pool ${pool.name} needs its base pool in the allowlist`, \"policy_refused\");\n const list = type === 1n ? pool.coins : pool.underlying;\n if (!list) return noted(`step ${k + 1}: pool ${pool.name} lists no underlying coins`, \"policy_refused\");\n const i = row[0]!, j = row[1]!;\n if (i >= BigInt(list.length) || j >= BigInt(list.length) || i === j) return noted(`step ${k + 1}: coin indexes ${i}/${j} are not two coins of pool ${pool.name}`, \"policy_refused\");\n // i, j < list.length (≤ 8) here: Number() of the decimal string is exact.\n if (lc(list[Number(i.toString())]!) !== a || lc(list[Number(j.toString())]!) !== b) return noted(`step ${k + 1}: pool ${pool.name}'s coins ${i}/${j} are not the hop's tokens`, \"policy_refused\");\n if (deployment.family === \"ng5\" && row[4] !== BigInt(list.length)) return noted(`step ${k + 1} names ${row[4]} coins, not pool ${pool.name}'s ${list.length}`, \"policy_refused\");\n if (deployment.family === \"lite4\" && (a === eth || b === eth)) return noted(`step ${k + 1}: this router does not pass the native coin to pools`, \"policy_refused\");\n if (STABLE_POOL_TYPES.has(pool.poolType) && (i > 127n || j > 127n)) return noted(`step ${k + 1}: coin index out of range`, \"policy_refused\");\n } else if (type === 8n) {\n if (weth === zero) return noted(\"this chain's router has no wrapped native\", \"policy_refused\");\n if (swap !== weth) return noted(`step ${k + 1} wraps through ${args.route[2 * k + 1]}, not the pinned wrapped native`, \"vault_mismatch\");\n if (!((a === eth && b === weth) || (a === weth && b === eth))) return noted(`step ${k + 1}: swap_type 8 is only native ↔ the pinned wrapped native here`, \"policy_refused\");\n if (row.some((x, c) => c !== 2 && x !== 0n)) return noted(`step ${k + 1}: a wrap carries no other swap params`, \"policy_refused\");\n if (++wraps > 1) return noted(\"the route wraps more than once\", \"policy_refused\");\n } else if (type === 9n) {\n if (!v) return noted(`swap_type 9 (ERC-4626) is not available on ${deployment.label}'s router ${deployment.version}`, \"policy_refused\");\n if (swap !== lc(v.vault)) return noted(`step ${k + 1}: ERC-4626 hop through ${args.route[2 * k + 1]}, not the pinned vault`, \"vault_mismatch\");\n const deposit = row[0] === 0n && a === lc(v.asset) && b === lc(v.vault);\n const redeem = row[0] === 1n && a === lc(v.vault) && b === lc(v.asset);\n if (!deposit && !redeem) return noted(`step ${k + 1}: the ERC-4626 hop is not a deposit of the vault's asset or a redeem of its shares`, \"policy_refused\");\n if (row.some((x, c) => c > 0 && c !== 2 && x !== 0n)) return noted(`step ${k + 1}: an ERC-4626 hop carries no other swap params`, \"policy_refused\");\n if (++vaults > 1) return noted(\"the route crosses the vault more than once\", \"policy_refused\");\n } else {\n return noted(`step ${k + 1} uses swap_type ${type}, which this module never builds`, \"policy_refused\");\n }\n }\n if (pools.size > MAX_ROUTE_POOLS) return noted(`the route crosses ${pools.size} pools, more than ${MAX_ROUTE_POOLS}`, \"policy_refused\");\n if (pools.size === 0 && vaults === 0) return noted(\"the route crosses no pool\", \"policy_refused\");\n return null;\n}\n","import {refusalNotes, withReason, type Swap2RefusalInfo, type Swap2RefusalReason} from \"@anywalletkit/protocol-swap2-core/errors\";\n\n/**\n * The reason of each refusal text the checks hand back as a string (`checkRoute`, `curveVerifyQuote`, a sealed quote's\n * on-chain check, `curveRemotePins` `verifyBuild`), remembered by the text: the provider reads it right after a check\n * refuses, and the pins answer `reasonOf` from it. Bounded: the last 256 texts.\n */\nexport const notes = refusalNotes(256);\n\n/** `text` as it is, its reason remembered when it has one. */\nexport function noted(text: string, info: Swap2RefusalReason | Swap2RefusalInfo | undefined): string {\n return info === undefined ? text : notes.note(text, info);\n}\n\n/** The error with its reason when there is one (its class and text as they are). */\nexport function tagged<E extends Error>(error: E, info: Swap2RefusalReason | Swap2RefusalInfo | undefined): E {\n return info === undefined ? error : withReason(error, info);\n}\n","import {httpRefusal, refusal, refusalOf, withReason} from \"@anywalletkit/protocol-swap2-core/errors\";\nimport {redactUrls, timeoutSignal} from \"@anywalletkit/protocol-swap2-core/util\";\n\nexport type RpcCall = {method: string; params: unknown[]};\n\n/** Largest JSON-RPC batch sent to one node (X Layer's public RPCs refuse more than 10). */\nexport const RPC_BATCH_MAX = 10;\n\n/** Pause before the endpoints are tried once more when the last one refused for its request rate. */\nexport const RPC_RATE_LIMIT_PAUSE_MS = 1_000;\n\n/**\n * A batch element's error that is still an answer about the call: the EVM ran it and stopped (a revert — geth's code 3 —\n * an invalid opcode, out of gas). Anything else says nothing about the call — a rate limit inside an HTTP-200 batch\n * (QuickNode's -32007 \"50/second request limit reached\"), a node fault — and the batch goes to the next endpoint.\n */\nexport function isExecutionError(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n const {code, message} = error as {code?: unknown; message?: unknown};\n return code === 3 || (typeof message === \"string\" && /revert|invalid opcode|out of gas/i.test(message));\n}\n\n/** A refusal for the request rate: HTTP 429, or JSON-RPC -32005 / -32007 / 429, or a message naming a limit. */\nfunction isRateLimit(error: unknown): boolean {\n if (!error || typeof error !== \"object\") return false;\n const {code, message} = error as {code?: unknown; message?: unknown};\n return code === -32005 || code === -32007 || code === 429 || (typeof message === \"string\" && /rate|limit|too many/i.test(message));\n}\n\nconst errorText = (error: unknown): string => {\n const m = error && typeof error === \"object\" ? (error as {message?: unknown}).message : undefined;\n return redactUrls(typeof m === \"string\" ? m : JSON.stringify(error) ?? String(error)).slice(0, 160);\n};\n\n/**\n * JSON-RPC over the caller's endpoints for one chain: batches of at most {@link RPC_BATCH_MAX} calls, each batch tried\n * on the endpoints in order until one answers every call (once more after {@link RPC_RATE_LIMIT_PAUSE_MS} when the last\n * refusal was for the request rate). Each slot is the result, or null when that call reverted — a revert is an answer,\n * not a dead endpoint. An element error that is not an execution error, or a call left unanswered, fails the endpoint:\n * a rate-limited read is never returned as a missing code or coin.\n */\nexport function rpcClient(rpcUrls: Readonly<Record<number, readonly string[]>>) {\n async function once(url: string, calls: RpcCall[], signal?: AbortSignal): Promise<(unknown | null)[]> {\n const res = await fetch(url, {\n method: \"POST\",\n headers: {\"content-type\": \"application/json\"},\n body: JSON.stringify(calls.map((c, id) => ({jsonrpc: \"2.0\", id, ...c}))),\n signal: signal ?? timeoutSignal(12_000),\n });\n // A node's refusal by its status: 429 rate_limited (with Retry-After), 401 / 403 key_rejected, anything else upstream_unavailable.\n if (!res.ok) throw withReason(Object.assign(new Error(`HTTP ${res.status}`), {limited: res.status === 429}), httpRefusal(res.status, res.headers?.get?.(\"retry-after\")) ?? {reason: \"upstream_unavailable\", httpStatus: res.status});\n const body = (await res.json()) as {id: number; result?: unknown; error?: unknown}[] | {error?: {message?: string}};\n if (!Array.isArray(body)) throw withReason(Object.assign(new Error(body.error?.message ?? \"batch refused\"), {limited: isRateLimit(body.error)}), isRateLimit(body.error) ? \"rate_limited\" : \"upstream_unavailable\");\n const out: (unknown | null)[] = calls.map(() => null);\n const answered = new Set<number>();\n for (const r of body) {\n if (typeof r.id !== \"number\" || r.id < 0 || r.id >= out.length) continue;\n if (r.error !== undefined && r.error !== null && !isExecutionError(r.error)) throw withReason(Object.assign(new Error(errorText(r.error)), {limited: isRateLimit(r.error)}), isRateLimit(r.error) ? \"rate_limited\" : \"upstream_unavailable\");\n answered.add(r.id);\n if (r.error === undefined || r.error === null) out[r.id] = r.result ?? null;\n }\n if (answered.size !== calls.length) throw refusal(\"upstream_unavailable\", `answered ${answered.size} of ${calls.length} calls`);\n return out;\n }\n\n async function batch(chainId: number, calls: RpcCall[], signal?: AbortSignal): Promise<(unknown | null)[]> {\n let lastErr: unknown;\n for (let pass = 0; pass < 2; pass++) {\n if (pass > 0) {\n if (!(lastErr as {limited?: boolean} | undefined)?.limited || signal?.aborted) break;\n await new Promise((r) => setTimeout(r, RPC_RATE_LIMIT_PAUSE_MS));\n }\n for (const url of rpcUrls[chainId] ?? []) {\n try {\n return await once(url, calls, signal);\n } catch (e) {\n lastErr = e;\n }\n }\n }\n const error = new Error(`curve: no RPC answered on chain ${chainId} (${lastErr instanceof Error ? lastErr.message : String(lastErr)})`);\n // Every endpoint failed: the last one's reason (throttled, a rejected key), else upstream_unavailable — a node down, a\n // timeout, an answer in another shape. The caller's own abort, or a chain with no endpoint at all, stays unclassified.\n if (lastErr === undefined || signal?.aborted) throw error;\n throw withReason(error, refusalOf(lastErr) ?? \"upstream_unavailable\");\n }\n return async function rpc(chainId: number, calls: RpcCall[], signal?: AbortSignal): Promise<(unknown | null)[]> {\n if (calls.length <= RPC_BATCH_MAX) return batch(chainId, calls, signal);\n const chunks: RpcCall[][] = [];\n for (let i = 0; i < calls.length; i += RPC_BATCH_MAX) chunks.push(calls.slice(i, i + RPC_BATCH_MAX));\n return (await Promise.all(chunks.map((c) => batch(chainId, c, signal)))).flat();\n };\n}\n\nexport const ethCall = (to: string, data: string): RpcCall => ({method: \"eth_call\", params: [{to, data}, \"latest\"]});\n\n/** The first 32-byte ABI word of a return (whole words, at least one) as 64 lowercase hex, or null. */\nfunction firstWord(raw: unknown): string | null {\n return typeof raw === \"string\" && raw.length >= 66 && /^0x(?:[0-9a-fA-F]{64})+$/.test(raw) ? raw.slice(2, 66).toLowerCase() : null;\n}\n\n/**\n * A return whose first ABI word holds an address → the address (lowercase), or null when the word's upper 12 bytes are\n * not zero. Only the first word is read: the Liquity factory metapool answers `coins(i)` with 4096 bytes.\n */\nexport function wordAddress(raw: unknown): string | null {\n const w = firstWord(raw);\n return w !== null && /^0{24}/.test(w) ? `0x${w.slice(24)}` : null;\n}\n\n/** A return's first ABI word → uint256, or null. */\nexport function wordUint(raw: unknown): bigint | null {\n const w = firstWord(raw);\n return w === null ? null : BigInt(`0x${w}`);\n}\n","import {bigintToNumber} from \"@anywalletkit/core\";\nimport {ccAssetByToken} from \"@anywalletkit/swap2-assets\";\nimport {suggestSlippage} from \"@anywalletkit/protocol-swap2-core/slippage\";\nimport {sourceAssetOf} from \"@anywalletkit/protocol-swap2-core/util\";\nimport type {QuoteParams} from \"@anywalletkit/protocol-swap2-core/types\";\n\n/**\n * The route's price impact in bps: a probe 1/1000 the size on the same route gives the marginal rate; the full-size\n * rate's shortfall against it is the impact (pool fees are paid on both sides and cancel). Undefined without a probe.\n */\nexport function curveImpactBps(amountIn: bigint, out: bigint, probeOut: bigint | null | undefined): number | undefined {\n const probeIn = amountIn / 1000n;\n if (probeIn <= 0n || probeOut === null || probeOut === undefined || probeOut <= 0n) return undefined;\n const ratioBps = (out * probeIn * 10_000n) / (probeOut * amountIn);\n return Math.max(0, bigintToNumber(10_000n - ratioBps));\n}\n\n/**\n * Slippage when the caller names none: `suggestSlippage` from swap2-core for the pair (catalog symbols) and the route's\n * price impact — stable ↔ stable 10 bps, majors 50, others 100, plus half the impact. The provider sizes its minimum\n * with it, and `curveRemotePins` re-derives it on the device to bound a remote build's minimum.\n */\nexport function curveAutoSlippageBps(params: QuoteParams, priceImpactBps: number | undefined): number {\n const nativeOut = /^0x0+$/.test(params.destToken);\n return suggestSlippage({\n fromChain: params.sourceChain,\n toChain: params.destChain,\n fromSymbol: sourceAssetOf(params)?.symbol ?? \"\",\n toSymbol: ccAssetByToken(params.destChain, nativeOut ? \"\" : params.destToken)?.symbol ?? \"\",\n ...(priceImpactBps !== undefined ? {priceImpactBps} : {}),\n }).bps;\n}\n","/** `curve:<chainId>:<16 hex>`, and on the wire of a swap2 server `~<32 hex>` (its intent token) after it. */\nconst INTENT_ID = /^curve:([1-9][0-9]{0,15}):[0-9a-f]{16}(?:~[0-9a-f]{32})?$/;\n\n/** A fresh Curve intent id for a quote on `chainId`: one per quote, so a remote stub never checks a build against another request. */\nexport function mintCurveIntentId(chainId: number): string {\n const nonce = globalThis.crypto.getRandomValues(new Uint8Array(8));\n return `curve:${chainId}:${Array.from(nonce, (b) => b.toString(16).padStart(2, \"0\")).join(\"\")}`;\n}\n\n/** The chain a Curve intent id names (its on-chain checks and receipt tracking run there), or null. */\nexport function curveIntentChain(intentId: unknown): number | null {\n const m = typeof intentId === \"string\" ? INTENT_ID.exec(intentId) : null;\n const id = m ? Number(m[1]) : NaN;\n return Number.isSafeInteger(id) ? id : null;\n}\n","import {decodeFunctionResult, encodeFunctionData, keccak256, type Hex as ViemHex} from \"viem\";\nimport {sourceAssetOf} from \"@anywalletkit/protocol-swap2-core/util\";\nimport {slippageFloor} from \"@anywalletkit/protocol-swap2-core/validate\";\nimport type {Quote, QuoteParams, RemotePins, UnsignedTx} from \"@anywalletkit/protocol-swap2-core/types\";\nimport {refusal, refusalOf} from \"@anywalletkit/protocol-swap2-core/errors\";\nimport {ADDRESS_PROVIDER_ABI, COINS_INT, COINS_UINT, EXCHANGE_SELECTOR, VERSION_ABI, decodeExchange, encodeGetDy, type DecodedExchange} from \"./abi.js\";\nimport {CURVE_DEPLOYMENTS, ZERO_ADDRESS, chainIdOf, deploymentOf, type CurveDeployment} from \"./deployments.js\";\nimport {CURVE_POOLS} from \"./pools/index.js\";\nimport type {CurveChainPools, CurvePool, Hex} from \"./pools/types.js\";\nimport {checkRoute, poolIndex, routePools} from \"./routes.js\";\nimport {ethCall, rpcClient, wordAddress, wordUint, type RpcCall} from \"./rpc.js\";\nimport {curveIntentChain} from \"./intent.js\";\nimport {curveAutoSlippageBps, curveImpactBps} from \"./slippage.js\";\nimport {notes, noted} from \"./reasons.js\";\n\nexport interface CurveTables {\n /** Override the deployments (tests). */\n deployments?: Readonly<Record<number, CurveDeployment>>;\n /** Override the pool allowlist (tests). */\n pools?: Readonly<Record<number, CurveChainPools>>;\n}\n\nconst lc = (a: string) => a.toLowerCase();\nconst isAddress = (a: string) => /^0x[0-9a-fA-F]{40}$/.test(a);\nconst own = <T>(o: Readonly<Record<number, T>>, k: number): T | undefined => (Object.prototype.hasOwnProperty.call(o, k) ? o[k] : undefined);\n\n/**\n * The check of a Curve quote's router call against the app's own request, with the tables it uses. The returned\n * function is {@link curveVerifyQuote} for the shipped tables: synchronous, no I/O — the allowlist is static.\n */\nexport function curveQuoteCheck(tables: CurveTables = {}): (params: QuoteParams, quote: Quote) => string | null {\n const deployments = tables.deployments ?? CURVE_DEPLOYMENTS;\n const pools = tables.pools ?? CURVE_POOLS;\n return function verify(params: QuoteParams, quote: Quote): string | null {\n const chainId = chainIdOf(params.sourceChain);\n const d = deploymentOf(deployments, chainId);\n if (!d || params.destChain !== params.sourceChain) return noted(\"not a same-chain swap on a pinned Curve router\", \"unsupported_pair\");\n const tx = quote.txRequest;\n if (!tx?.data || !tx.to || tx.serializedTx !== undefined) return noted(\"the quote carries no router call\", \"policy_refused\");\n if (!isAddress(tx.to) || lc(tx.to) !== lc(d.router)) return noted(`the call targets ${tx.to}, not the Curve router`, \"vault_mismatch\");\n if (tx.chainId !== undefined && tx.chainId !== chainId) return noted(`the call is for chain ${tx.chainId}`, \"policy_refused\");\n // The chain the build's on-chain checks and the receipt tracking run on (`curve:<chainId>:…`): this request's.\n if (curveIntentChain(quote.intentId) !== chainId) return noted(`the quote names ${String(quote.intentId).slice(0, 40)}, not a curve:${chainId} swap`, \"policy_refused\");\n const src = sourceAssetOf(params);\n if (!src) return noted(`unknown source token ${params.sourceToken}`, \"unsupported_pair\");\n const nativeIn = !src.contract;\n const nativeOut = /^0x0+$/.test(params.destToken);\n if (!nativeOut && !isAddress(params.destToken)) return noted(\"destination token must be an EVM address\", \"unsupported_pair\");\n if (!isAddress(params.destAddress)) return noted(\"recipient must be an EVM address\", \"recipient_mismatch\");\n if ((!nativeIn && lc(src.contract!) === lc(d.eth)) || (!nativeOut && lc(params.destToken) === lc(d.eth))) return noted(\"the router's native sentinel is not a token\", \"unsupported_pair\");\n const tokenIn = nativeIn ? d.eth : src.contract!;\n const tokenOut = nativeOut ? d.eth : params.destToken;\n let amountIn: bigint, minOut: bigint, value: bigint;\n try {\n amountIn = BigInt(params.amountIn);\n minOut = BigInt(quote.minDestAmount);\n value = BigInt(tx.value ?? \"0\");\n } catch {\n return noted(\"the request does not name amounts\", \"policy_refused\");\n }\n if (nativeIn ? value !== amountIn || tx.approvalAddress !== undefined\n : value !== 0n || !tx.approvalAddress || !isAddress(tx.approvalAddress) || lc(tx.approvalAddress) !== lc(d.router)) {\n return noted(nativeIn ? \"a native input is paid as exactly the input in value, with no approval\" : \"a token input attaches no value and approves exactly the Curve router\", \"policy_refused\");\n }\n const call = decodeExchange(d.family, tx.data);\n if (!call) return noted(\"the router call is not exchange(route, params, amount, min, receiver)\", \"policy_refused\");\n if (call.selector !== EXCHANGE_SELECTOR[d.family]) return noted(`selector ${call.selector} is not the explicit-receiver exchange ${EXCHANGE_SELECTOR[d.family]}`, \"policy_refused\");\n if (!call.receiver || lc(call.receiver) !== lc(params.destAddress)) return noted(`the swap pays ${call.receiver ?? \"the sender\"}, not the recipient`, \"recipient_mismatch\");\n if (call.pools && call.pools.some((p) => lc(p) !== lc(ZERO_ADDRESS))) return noted(\"the call names zap pools this module never uses\", \"policy_refused\");\n if (call.amount !== amountIn) return noted(`the swap sells ${call.amount}, not the ${amountIn} input`, \"policy_refused\");\n if (call.minDy <= 0n) return noted(\"the swap has no minimum (min_dy 0)\", \"price_check_failed\");\n if (call.minDy !== minOut) return noted(`the swap's minimum ${call.minDy} is not the quote's ${minOut}`, \"price_check_failed\");\n if (quote.providerData?.minOut !== undefined && quote.providerData.minOut !== minOut.toString()) return noted(\"the quote's facts disagree on the minimum\", \"price_check_failed\");\n return checkRoute(chainId, d, own(pools, chainId), call, tokenIn, tokenOut);\n };\n}\n\n/**\n * The swap a Curve quote's router call makes, opened on the client against the app's own request: the explicit-receiver\n * `exchange` on the chain's pinned Router NG (`0xc872a3c5` on `[5][5]` routers, `0xfd44959c` on `[4][5]`), selling\n * exactly the input of the source token (the router's native sentinel for a native input, paid as exactly that\n * `value`; a token input attaches no value and approves exactly the router), for the destination token, with\n * `min_dy` the quote's minimum (never 0), paid to the recipient, no zap pools, and a route that `checkRoute` accepts:\n * allowlisted pools only, their pinned coins, swap types 1/2 (8 through the pinned wrapped native, 9 only on router\n * v1.2 through scrvUSD). The reason it fails, or null.\n */\nexport const curveVerifyQuote: (params: QuoteParams, quote: Quote) => string | null = curveQuoteCheck();\n\n/**\n * The Router NG a Curve swap calls and approves on a chain (the shipped {@link CURVE_DEPLOYMENTS} table), and\n * {@link curveVerifyQuote} — the app's pins for `remoteProvider({name: \"curve\", baseUrl, ...curvePins})`. For the build\n * checked on chain as well (router code hash, fresh `get_dy`, pool coins), use {@link curveRemotePins}.\n */\nexport const curvePins: RemotePins = Object.freeze({\n callTargets: (chain: string): readonly string[] => routerFor(CURVE_DEPLOYMENTS, chain),\n spenders: (chain: string): readonly string[] => routerFor(CURVE_DEPLOYMENTS, chain),\n verifyQuote: curveVerifyQuote,\n // The reason of each text verifyQuote returned (remoteProvider puts it on its refusal).\n reasonOf: notes.reasonOf,\n});\n\nfunction routerFor(deployments: Readonly<Record<number, CurveDeployment>>, chain: string): readonly string[] {\n const d = deploymentOf(deployments, chainIdOf(chain));\n return d ? [d.router] : [];\n}\n\nexport interface CurveOnChainOptions extends CurveTables {\n rpcUrls: Readonly<Record<number, readonly string[]>>;\n /** Told when the chain's AddressProvider lists another router than the pinned one (never acted on). Default console.warn. */\n onWarning?: (message: string) => void;\n}\n\n/**\n * On-chain checks shared by the provider and {@link curveRemotePins}: the pinned router's code hash and version (once\n * per chain; the AddressProvider's id 2 only compared), and a sealed quote re-checked right before broadcast.\n */\nexport function curveOnChain(opts: CurveOnChainOptions) {\n const deployments = opts.deployments ?? CURVE_DEPLOYMENTS;\n const pools = opts.pools ?? CURVE_POOLS;\n const rpc = rpcClient(opts.rpcUrls);\n const warn = opts.onWarning ?? ((m: string) => console.warn(m));\n const verified = new Map<number, Promise<void>>();\n\n /** The pinned router is still the code we pinned, at the version we pinned. */\n function verifyDeployment(chainId: number): Promise<void> {\n let p = verified.get(chainId);\n if (!p) {\n const d = deploymentOf(deployments, chainId);\n p = (async () => {\n if (!d) throw refusal(\"unsupported_pair\", `curve: no pinned router on chain ${chainId}`);\n const [code, version, listed] = await rpc(chainId, [\n {method: \"eth_getCode\", params: [d.router, \"latest\"]},\n ethCall(d.router, encodeFunctionData({abi: VERSION_ABI, functionName: \"version\"})),\n ethCall(d.addressProvider, encodeFunctionData({abi: ADDRESS_PROVIDER_ABI, functionName: \"get_address\", args: [2n]})),\n ]);\n if (typeof code !== \"string\" || code.length <= 2 || lc(keccak256(code as ViemHex)) !== lc(d.codeHash)) {\n throw refusal(\"vault_mismatch\", `curve: the router on chain ${chainId} is not the pinned code (code hash mismatch) — refusing`);\n }\n let v = \"\";\n try { v = typeof version === \"string\" ? decodeFunctionResult({abi: VERSION_ABI, functionName: \"version\", data: version as ViemHex}) : \"\"; } catch { /* below */ }\n if (v !== d.version) throw refusal(\"vault_mismatch\", `curve: the router on chain ${chainId} reports version ${v || \"none\"}, not ${d.version} — refusing`);\n // The AddressProvider is informational (its admin may change any id): a different id 2 is a signal for the\n // module watch, never a router to use.\n const ap = wordAddress(listed);\n if (ap && ap !== lc(d.addressProviderRouter) && ap !== lc(d.router)) {\n warn(`curve: the AddressProvider on ${d.label} lists router ${ap} (id 2); this module keeps the pinned ${d.router}`);\n }\n })();\n p.catch(() => verified.delete(chainId));\n verified.set(chainId, p);\n }\n return p;\n }\n\n /**\n * A sealed quote right before broadcast (or a remote build on the client): the transaction is byte for byte the\n * quote's router call, the route passes `checkRoute`, the router was verified as the pinned code and version (once\n * per chain per process — it is immutable), every hop pool still has its pinned code and coins (re-read each time),\n * and a fresh `get_dy` of that exact route still pays at least the minimum. The reason it fails, or null.\n */\n async function checkSealed(quote: Quote, tx: UnsignedTx): Promise<string | null> {\n const r = await inspectSealed(quote, tx, false);\n return typeof r === \"string\" ? r : null;\n }\n\n /**\n * {@link checkSealed}, and what it read when it passes: the fresh `get_dy` of the exact route at the sealed amount,\n * the call's minimum and, with `probe`, the same route at 1/1000 of the amount (null when it reverts).\n */\n async function inspectSealed(quote: Quote, tx: UnsignedTx, probe: boolean): Promise<string | {out: bigint; probeOut: bigint | null; amount: bigint; minDy: bigint}> {\n const chainId = curveIntentChain(quote.intentId);\n const d = chainId === null ? undefined : deploymentOf(deployments, chainId);\n if (chainId === null || !d) return noted(\"the quote is not a Curve swap on a pinned chain\", \"policy_refused\");\n const quoted = quote.txRequest;\n if (!quoted?.data || !quoted.to || !tx.data) return noted(\"the quote or the transaction carries no router call\", \"policy_refused\");\n if (tx.data.length !== quoted.data.length || lc(tx.data) !== lc(quoted.data)) return noted(\"the transaction is not the quoted router call\", \"policy_refused\");\n if (!isAddress(tx.to) || lc(tx.to) !== lc(d.router) || lc(quoted.to) !== lc(d.router)) return noted(`the transaction calls ${tx.to}, not the Curve router`, \"vault_mismatch\");\n if ((tx.value ?? \"0\") !== (quoted.value ?? \"0\")) return noted(\"the transaction's value is not the quote's\", \"policy_refused\");\n if ((tx.chainId !== undefined && tx.chainId !== chainId) || (quoted.chainId !== undefined && quoted.chainId !== chainId)) return noted(`the transaction is not for chain ${chainId}`, \"policy_refused\");\n if ((tx.approvalAddress ?? \"\").toLowerCase() !== (quoted.approvalAddress ?? \"\").toLowerCase()) return noted(\"the transaction's approval is not the quote's\", \"vault_mismatch\");\n const call = decodeExchange(d.family, quoted.data);\n if (!call || call.selector !== EXCHANGE_SELECTOR[d.family]) return noted(\"the quoted call is not the explicit-receiver exchange\", \"policy_refused\");\n if (call.minDy <= 0n) return noted(\"the swap has no minimum (min_dy 0)\", \"price_check_failed\");\n const last = lastToken(call);\n const reason = checkRoute(chainId, d, own(pools, chainId), call, call.route[0]!, last);\n if (reason) return reason;\n await verifyDeployment(chainId);\n const index = poolIndex(chainId, d, own(pools, chainId));\n const hops = routePools(call).map((a) => index.get(lc(a))!);\n const reads = poolCalls(hops);\n const calls: RpcCall[] = [ethCall(d.router, encodeGetDy(d.family, call, call.amount)), ...reads];\n const probeIn = call.amount / 1000n;\n const probeAt = calls.length;\n if (probe && probeIn > 0n) calls.push(ethCall(d.router, encodeGetDy(d.family, call, probeIn)));\n const res = await rpc(chainId, calls);\n const poolReason = await poolsReason(chainId, hops, res.slice(1, 1 + reads.length));\n if (poolReason) return poolReason;\n const out = wordUint(res[0]);\n if (out === null) return noted(\"the router no longer quotes this route\", \"simulation_failed\");\n if (out < call.minDy) return noted(`price moved — the pools now pay ${out}, under your minimum ${call.minDy}`, \"price_check_failed\");\n return {out, probeOut: probe && probeIn > 0n ? wordUint(res[probeAt]) : null, amount: call.amount, minDy: call.minDy};\n }\n\n /** Per pool: its code, then `coins(uint256)` for each pinned coin. */\n function poolCalls(list: readonly CurvePool[]): RpcCall[] {\n return list.flatMap((pool) => [\n {method: \"eth_getCode\", params: [pool.address, \"latest\"]},\n ...pool.coins.map((_, k) => ethCall(pool.address, `${COINS_UINT}${k.toString(16).padStart(64, \"0\")}`)),\n ]);\n }\n\n /** The answers to {@link poolCalls} held to the pins (`coins(int128)` asked where `coins(uint256)` reverts). */\n async function poolsReason(chainId: number, list: readonly CurvePool[], res: readonly unknown[]): Promise<string | null> {\n let at = 0;\n const retry: {pool: CurvePool; k: number}[] = [];\n for (const pool of list) {\n const code = res[at++];\n // eth_getCode does not revert: no string means the read itself failed, which says nothing about the pool.\n if (typeof code !== \"string\") return noted(`could not read pool ${pool.name} (${pool.address}) over RPC`, \"upstream_unavailable\");\n if (code.length <= 2 || lc(keccak256(code as ViemHex)) !== lc(pool.codeHash)) return noted(`pool ${pool.name} (${pool.address}) is not the pinned code`, \"vault_mismatch\");\n for (let k = 0; k < pool.coins.length; k++) {\n const coin = wordAddress(res[at++]);\n if (coin === null) retry.push({pool, k});\n else if (coin !== lc(pool.coins[k]!)) return noted(`pool ${pool.name} now reports coin ${k} = ${coin}, not the pinned ${pool.coins[k]}`, \"vault_mismatch\");\n }\n }\n if (retry.length) {\n // The oldest stable pools take coins(int128).\n const again = await rpc(chainId, retry.map(({pool, k}) => ethCall(pool.address, `${COINS_INT}${k.toString(16).padStart(64, \"0\")}`)));\n for (const [n, {pool, k}] of retry.entries()) {\n const coin = wordAddress(again[n]);\n if (coin !== lc(pool.coins[k]!)) return noted(`pool ${pool.name} does not report its pinned coin ${k}`, \"vault_mismatch\");\n }\n }\n return null;\n }\n\n /**\n * Allowlisted pools as a sealed quote's preflight reads them, without a route: each still has its pinned code and\n * coins. The reason the first one fails, or null (a failed read throws). For live checks over a whole allowlist.\n */\n async function checkPools(chainId: number, list: readonly CurvePool[]): Promise<string | null> {\n return list.length ? poolsReason(chainId, list, await rpc(chainId, poolCalls(list))) : null;\n }\n\n return {rpc, verifyDeployment, checkSealed, inspectSealed, checkPools};\n}\n\nfunction lastToken(call: DecodedExchange): Hex {\n let k = 0;\n while (k < 5 && lc(call.route[2 * k + 1]!) !== lc(ZERO_ADDRESS)) k++;\n return call.route[2 * k]!;\n}\n\n/**\n * How far the device's own auto slippage may sit under the backend's before a remote build's minimum counts as too low:\n * the backend sized it from its probe at quote time, the device from a fresh one, and half the impact moves it.\n */\nexport const CURVE_AUTO_SLIPPAGE_DRIFT_BPS = 5;\n\nexport interface CurveRemotePinsOptions extends CurveOnChainOptions {\n /** The backend provider's `defaultSlippageBps`, when it sets one (a build's minimum is bounded by it). Default: auto slippage. */\n defaultSlippageBps?: number;\n}\n\n/**\n * {@link curvePins} plus `verifyBuild`: a remote Curve build checked on the client — {@link curveVerifyQuote} on the\n * request it answered, then on chain (over the app's own RPCs) the pinned router (code and version, once per chain),\n * each hop pool's pinned code and coins, and a fresh `get_dy` of the exact route at or above the minimum. The quote's\n * figures are then held to that fresh `get_dy` (§5.3 C9: the minimum is the device's own): `destAmount` no more than the\n * slippage above it, and `min_dy` no more than the slippage below it (or below `destAmount`, if lower) — the request's\n * `slippageBps`, else `defaultSlippageBps`, else the provider's auto slippage re-derived here from a fresh 1/1000 probe\n * (plus {@link CURVE_AUTO_SLIPPAGE_DRIFT_BPS}). A backend naming `min_dy = 1` or an inflated output is refused.\n * `remoteProvider({name: \"curve\", baseUrl, ...curveRemotePins({rpcUrls})})`.\n */\nexport function curveRemotePins(opts: CurveRemotePinsOptions): RemotePins & {verifyBuild(quote: Quote, tx: UnsignedTx, params?: QuoteParams): Promise<string | null>} {\n const deployments = opts.deployments ?? CURVE_DEPLOYMENTS;\n const fixedSlippage = opts.defaultSlippageBps;\n if (fixedSlippage !== undefined && (!Number.isInteger(fixedSlippage) || fixedSlippage <= 0 || fixedSlippage >= 5_000)) throw new Error(\"curve: defaultSlippageBps must be 1..4999\");\n const verifyQuote = curveQuoteCheck(opts);\n const chain = curveOnChain(opts);\n return Object.freeze({\n callTargets: (c: string): readonly string[] => routerFor(deployments, c),\n spenders: (c: string): readonly string[] => routerFor(deployments, c),\n verifyQuote,\n // The reason of each text verifyQuote / verifyBuild returned (remoteProvider puts it on its refusal).\n reasonOf: notes.reasonOf,\n async verifyBuild(quote: Quote, tx: UnsignedTx, params?: QuoteParams): Promise<string | null> {\n if (!params) return noted(\"the request this quote answered is unknown\", \"policy_refused\");\n const reason = verifyQuote(params, quote);\n if (reason) return reason;\n try {\n const auto = params.slippageBps === undefined && fixedSlippage === undefined;\n const seen = await chain.inspectSealed(quote, tx, auto);\n if (typeof seen === \"string\") return seen;\n const {out, probeOut, amount, minDy} = seen;\n let dest: bigint;\n try { dest = BigInt(quote.destAmount); } catch { return noted(\"the quote names no output\", \"upstream_unavailable\"); }\n const bps = params.slippageBps ?? fixedSlippage ?? Math.min(9_999, curveAutoSlippageBps(params, curveImpactBps(amount, out, probeOut)) + CURVE_AUTO_SLIPPAGE_DRIFT_BPS);\n if (slippageFloor(dest, bps) > out) return noted(`the quote promises ${dest}, more than ${bps} bps above the ${out} the pools pay now`, \"price_check_failed\");\n const fresh = dest < out ? dest : out;\n if (minDy < slippageFloor(fresh, bps)) return noted(`the swap's minimum ${minDy} is more than ${bps} bps under the ${fresh} the pools pay now`, \"price_check_failed\");\n return null;\n } catch (e) {\n return noted(e instanceof Error ? e.message.replace(/^curve: /, \"\") : String(e), refusalOf(e));\n }\n },\n });\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,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AI,aAAY,IAAI,EAAC,OAAO,SAAQ;AAAA,MACzG,QAAQ;AACN,eAAO,EAAC,OAAO,UAAS;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AACF;","names":["import_viem","import_util","import_errors","c","a","d","import_viem","d","import_errors","import_util","import_swap2_assets","import_util","import_viem","import_util","import_errors","lc","d","chainIdOf","d","out"]}
|