@panoptic-eng/sdk 1.0.59 → 1.0.61

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.
@@ -9400,6 +9400,10 @@ function extractErrorData(error) {
9400
9400
  error.walk((e) => {
9401
9401
  if (foundData) return false;
9402
9402
  const node = e;
9403
+ if (typeof node.raw === "string" && node.raw.startsWith("0x") && node.raw.length > 10) {
9404
+ foundData = node.raw;
9405
+ return true;
9406
+ }
9403
9407
  if (node.data && typeof node.data === "string" && node.data.startsWith("0x")) {
9404
9408
  foundData = node.data;
9405
9409
  return true;
@@ -9428,6 +9432,7 @@ function extractErrorData(error) {
9428
9432
  let current = error;
9429
9433
  const maxDepth = 10;
9430
9434
  for (let i = 0; i < maxDepth && current; i++) {
9435
+ if (typeof current.raw === "string" && current.raw.startsWith("0x") && current.raw.length > 10) return current.raw;
9431
9436
  if (current.data && typeof current.data === "string" && current.data.startsWith("0x")) return current.data;
9432
9437
  if (current.data && typeof current.data === "object") {
9433
9438
  const nested = current.data;
@@ -9441,7 +9446,7 @@ function extractErrorData(error) {
9441
9446
  }
9442
9447
  const obj = error;
9443
9448
  if (obj.message && typeof obj.message === "string") {
9444
- const signatureMatch = obj.message.match(/signature:\s*(0x[a-fA-F0-9]{8,})/i);
9449
+ const signatureMatch = obj.message.match(/signature:?\s*["']?(0x[a-fA-F0-9]{8,})/i);
9445
9450
  if (signatureMatch) return signatureMatch[1];
9446
9451
  }
9447
9452
  return null;
@@ -9990,6 +9995,21 @@ function isLoan(tokenId) {
9990
9995
  return legs.length > 0 && legs.every(isLoanLeg);
9991
9996
  }
9992
9997
  /**
9998
+ * Index of the borrowed token when a TokenId is a single-leg loan.
9999
+ *
10000
+ * Returns undefined for credits, multi-leg loans, and positions mixing loans
10001
+ * with options: closing those can move both tokens for reasons other than
10002
+ * repaying one borrowed principal.
10003
+ *
10004
+ * @param tokenId - The TokenId to classify
10005
+ * @returns The borrowed token index (the leg's tokenType), or undefined
10006
+ */
10007
+ function getSimpleLoanTokenIndex(tokenId) {
10008
+ const legs = decodeAllLegs(tokenId);
10009
+ if (legs.length !== 1 || !isLoanLeg(legs[0])) return void 0;
10010
+ return legs[0].tokenType === 0n ? 0n : 1n;
10011
+ }
10012
+ /**
9993
10013
  * Check if a TokenId is a pure credit (all legs are credits).
9994
10014
  *
9995
10015
  * @param tokenId - The TokenId to check
@@ -11097,12 +11117,12 @@ function generateOverlappingTokenIds(params) {
11097
11117
  //#region src/panoptic/v2/tokenId/split.ts
11098
11118
  const POOL_ID_MASK$3 = (1n << TOKEN_ID_BITS.POOL_ID_SIZE) - 1n;
11099
11119
  const MAX_UINT128$3 = (1n << 128n) - 1n;
11100
- const MAX_UINT256$1 = (1n << 256n) - 1n;
11120
+ const MAX_UINT256$2 = (1n << 256n) - 1n;
11101
11121
  function invalid(message) {
11102
11122
  throw new PanopticValidationError(`splitTokenIdByTimescale: ${message}`);
11103
11123
  }
11104
11124
  function validateInput(tokenId, positionSize) {
11105
- if (tokenId < 0n || tokenId > MAX_UINT256$1) invalid("tokenId must fit in uint256");
11125
+ if (tokenId < 0n || tokenId > MAX_UINT256$2) invalid("tokenId must fit in uint256");
11106
11126
  if (positionSize <= 0n || positionSize > MAX_UINT128$3) invalid("positionSize must be between 1 and uint128.max");
11107
11127
  const legs = decodeAllLegs(tokenId);
11108
11128
  if (legs.length === 0) invalid("tokenId must contain at least one active leg");
@@ -12725,6 +12745,17 @@ function createTxResult(client, hash) {
12725
12745
  * @returns TxResult
12726
12746
  */
12727
12747
  async function submitWrite(params) {
12748
+ try {
12749
+ return await submitWriteRequest({
12750
+ ...params,
12751
+ abi: [...params.abi, ...panopticErrorsAbi]
12752
+ });
12753
+ } catch (error) {
12754
+ if (error instanceof PanopticError) throw error;
12755
+ throw parsePanopticError(error)?.error ?? error;
12756
+ }
12757
+ }
12758
+ async function submitWriteRequest(params) {
12728
12759
  const { client, walletClient, account, address, abi: abi$1, functionName, args, value, txOverrides } = params;
12729
12760
  const broadcaster = txOverrides?.broadcaster;
12730
12761
  if (broadcaster) {
@@ -22306,6 +22337,73 @@ async function optimizeTokenIdRiskPartners(params) {
22306
22337
  return optimizedTokenId;
22307
22338
  }
22308
22339
 
22340
+ //#endregion
22341
+ //#region src/panoptic/v2/reads/tickNetWindows.ts
22342
+ /**
22343
+ * Wide liquidity distributions from several adjacent `getTickNets*` windows.
22344
+ *
22345
+ * @module v2/reads/tickNetWindows
22346
+ */
22347
+ /** Absolute Uniswap V3/V4 tick bounds. */
22348
+ const TICK_MIN$1 = -887272;
22349
+ const TICK_MAX$1 = 887272;
22350
+ /**
22351
+ * Join ascending, edge-sharing windows into one distribution anchored to `windows[mainIndex]`.
22352
+ *
22353
+ * Each `getTickNets*` window is a running sum of liquidityNet from its own first tick (only the
22354
+ * window holding the current tick is rescaled to the pool's liquidity), so a neighbour's values
22355
+ * are off by a constant. Adjacent windows share their edge tick; the offset that makes that tick
22356
+ * agree is applied to the whole neighbour. Stitching stops at the first window that does not share
22357
+ * an edge with the one before it.
22358
+ */
22359
+ function stitchTickNetWindows(windows, mainIndex) {
22360
+ const main = windows[mainIndex];
22361
+ if (!main) return {
22362
+ ticks: [],
22363
+ liquidityNets: []
22364
+ };
22365
+ const ticks = [...main.ticks];
22366
+ const nets = [...main.liquidityNets];
22367
+ for (let i = mainIndex + 1; i < windows.length; i++) {
22368
+ const window = windows[i];
22369
+ const edge = ticks.length - 1;
22370
+ if (!window.ticks.length || window.ticks[0] !== ticks[edge]) break;
22371
+ const offset = nets[edge] - window.liquidityNets[0];
22372
+ ticks.push(...window.ticks.slice(1));
22373
+ nets.push(...window.liquidityNets.slice(1).map((value) => value + offset));
22374
+ }
22375
+ for (let i = mainIndex - 1; i >= 0; i--) {
22376
+ const window = windows[i];
22377
+ const last = window.ticks.length - 1;
22378
+ if (last < 0 || window.ticks[last] !== ticks[0]) break;
22379
+ const offset = nets[0] - window.liquidityNets[last];
22380
+ ticks.unshift(...window.ticks.slice(0, last));
22381
+ nets.unshift(...window.liquidityNets.slice(0, last).map((value) => value + offset));
22382
+ }
22383
+ return {
22384
+ ticks,
22385
+ liquidityNets: nets
22386
+ };
22387
+ }
22388
+ /**
22389
+ * Read the main window around `startTick` plus up to `windowsPerSide` windows of `nTicks` on each
22390
+ * side, in parallel, and stitch them. Side windows that would cross the tick bounds are skipped.
22391
+ */
22392
+ async function readTickNetWindows({ startTick, mainNTicks, nTicks, tickSpacing, windowsPerSide, read }) {
22393
+ const center = Math.trunc(startTick / tickSpacing) * tickSpacing;
22394
+ const half = Number(nTicks) * tickSpacing;
22395
+ const mainHalf = Number(mainNTicks) * tickSpacing;
22396
+ const sideCenters = (direction) => Array.from({ length: windowsPerSide }, (_, k) => center + direction * (mainHalf + half + 2 * half * k)).filter((side) => side - half >= TICK_MIN$1 && side + half <= TICK_MAX$1);
22397
+ const below = sideCenters(-1).reverse();
22398
+ const above = sideCenters(1);
22399
+ const windows = await Promise.all([
22400
+ ...below.map((side) => read(side, nTicks)),
22401
+ read(startTick, mainNTicks),
22402
+ ...above.map((side) => read(side, nTicks))
22403
+ ]);
22404
+ return stitchTickNetWindows(windows, below.length);
22405
+ }
22406
+
22309
22407
  //#endregion
22310
22408
  //#region src/panoptic/v2/reads/liquidity.ts
22311
22409
  /**
@@ -22323,24 +22421,35 @@ async function optimizeTokenIdRiskPartners(params) {
22323
22421
  async function getPoolLiquidities(params) {
22324
22422
  const { client, poolAddress, queryAddress, startTick, nTicks, blockNumber } = params;
22325
22423
  const targetBlockNumber = blockNumber ?? params._meta?.blockNumber ?? await client.getBlockNumber();
22326
- const [result, _meta] = await Promise.all([client.readContract({
22327
- address: queryAddress,
22328
- abi: panopticQueryAbi$1,
22329
- functionName: "getTickNets",
22330
- args: [
22331
- poolAddress,
22332
- Number(startTick),
22333
- nTicks
22334
- ],
22335
- blockNumber: targetBlockNumber
22424
+ const windowsPerSide = params.windowsPerSide ?? 0;
22425
+ if (windowsPerSide > 0 && params.tickSpacing === void 0) throw new PanopticValidationError("getPoolLiquidities: tickSpacing is required with windowsPerSide");
22426
+ const [{ ticks, liquidityNets }, _meta] = await Promise.all([readTickNetWindows({
22427
+ startTick: Number(startTick),
22428
+ mainNTicks: nTicks,
22429
+ nTicks,
22430
+ tickSpacing: params.tickSpacing ?? 1,
22431
+ windowsPerSide,
22432
+ read: (centerTick, windowTicks) => client.readContract({
22433
+ address: queryAddress,
22434
+ abi: panopticQueryAbi$1,
22435
+ functionName: "getTickNets",
22436
+ args: [
22437
+ poolAddress,
22438
+ centerTick,
22439
+ windowTicks
22440
+ ],
22441
+ blockNumber: targetBlockNumber
22442
+ }).then(([tickData, nets]) => ({
22443
+ ticks: tickData,
22444
+ liquidityNets: nets
22445
+ }))
22336
22446
  }), params._meta ?? getBlockMeta({
22337
22447
  client,
22338
22448
  blockNumber: targetBlockNumber
22339
22449
  })]);
22340
- const [tickData, liquidityNets] = result;
22341
22450
  return {
22342
- ticks: [...tickData],
22343
- liquidityNets: [...liquidityNets],
22451
+ ticks,
22452
+ liquidityNets,
22344
22453
  _meta
22345
22454
  };
22346
22455
  }
@@ -23419,6 +23528,32 @@ function computeUniswapFeesForBlock(blockData, legs) {
23419
23528
  total1
23420
23529
  };
23421
23530
  }
23531
+ const MAX_UINT256$1 = 2n ** 256n - 1n;
23532
+ /**
23533
+ * Fee growth per unit of liquidity inside `[lowerTick, upperTick)` at one block,
23534
+ * wrapped to uint256 as the pool computes it. Diff two snapshots with
23535
+ * `feesFromFeeGrowthDelta` to get the fees a constant liquidity earned between them.
23536
+ */
23537
+ function feeGrowthInsideX128(blockData, lowerTick, upperTick) {
23538
+ const lower = blockData.tickData.get(lowerTick);
23539
+ const upper = blockData.tickData.get(upperTick);
23540
+ if (!lower || !upper) return null;
23541
+ const { currentTick } = blockData;
23542
+ const inside = (global, lowerOutside, upperOutside) => {
23543
+ const below = currentTick >= lowerTick ? lowerOutside : global - lowerOutside;
23544
+ const above = currentTick < upperTick ? upperOutside : global - upperOutside;
23545
+ return global - below - above & MAX_UINT256$1;
23546
+ };
23547
+ return {
23548
+ feeGrowthInside0X128: inside(blockData.feeGrowthGlobal0, lower.feeGrowthOutside0, upper.feeGrowthOutside0),
23549
+ feeGrowthInside1X128: inside(blockData.feeGrowthGlobal1, lower.feeGrowthOutside1, upper.feeGrowthOutside1)
23550
+ };
23551
+ }
23552
+ /** Blocks before the chain's Multicall3 deployment need viem's deployless multicall. */
23553
+ function predatesMulticall3(client, blockNumber) {
23554
+ const deployedAt = client.chain?.contracts?.multicall3?.blockCreated;
23555
+ return blockNumber != null && deployedAt != null && blockNumber < BigInt(deployedAt);
23556
+ }
23422
23557
  async function fetchUniswapBlockSnapshot(client, blockNumber, uniqueTicks, poolConfig) {
23423
23558
  if (poolConfig.version === "v3") return fetchV3BlockSnapshot(client, poolConfig.poolAddress, blockNumber, uniqueTicks);
23424
23559
  else return fetchV4BlockSnapshot(client, poolConfig.stateViewAddress, poolConfig.poolId, blockNumber, uniqueTicks);
@@ -23450,7 +23585,8 @@ async function fetchV3BlockSnapshot(client, poolAddress, blockNumber, uniqueTick
23450
23585
  const results = await client.multicall({
23451
23586
  contracts,
23452
23587
  blockNumber,
23453
- allowFailure: false
23588
+ allowFailure: false,
23589
+ deployless: predatesMulticall3(client, blockNumber)
23454
23590
  });
23455
23591
  const slot0Result = results[0];
23456
23592
  const feeGrowthGlobal0 = results[1];
@@ -23495,7 +23631,8 @@ async function fetchV4BlockSnapshot(client, stateViewAddress, poolId, blockNumbe
23495
23631
  const results = await client.multicall({
23496
23632
  contracts,
23497
23633
  blockNumber,
23498
- allowFailure: false
23634
+ allowFailure: false,
23635
+ deployless: predatesMulticall3(client, blockNumber)
23499
23636
  });
23500
23637
  const slot0Result = results[0];
23501
23638
  const feeGrowthResult = results[1];
@@ -23805,23 +23942,34 @@ function clampNTicks(startTick, tickSpacing, nTicks) {
23805
23942
  * for the pool — only a deployed PanopticQuery on the chain.
23806
23943
  */
23807
23944
  async function getUniswapV3PoolLiquidities(params) {
23808
- const { client, poolAddress, queryAddress, startTick, nTicks } = params;
23809
- const safeN = clampNTicks(startTick, 1, nTicks);
23945
+ const { client, poolAddress, queryAddress, startTick, nTicks, windowsPerSide = 0 } = params;
23946
+ if (windowsPerSide > 0 && params.tickSpacing === void 0) throw new PanopticValidationError("getUniswapV3PoolLiquidities: tickSpacing is required with windowsPerSide");
23947
+ const safeN = clampNTicks(startTick, params.tickSpacing ?? 1, nTicks);
23810
23948
  const _meta = await getBlockMeta({ client });
23811
- const [ticks, liquidityNets] = await client.readContract({
23812
- address: queryAddress,
23813
- abi: panopticQueryAbi$1,
23814
- functionName: "getTickNetsV3",
23815
- args: [
23816
- poolAddress,
23817
- startTick,
23818
- safeN
23819
- ],
23820
- blockNumber: _meta.blockNumber
23949
+ const { ticks, liquidityNets } = await readTickNetWindows({
23950
+ startTick,
23951
+ mainNTicks: safeN,
23952
+ nTicks,
23953
+ tickSpacing: params.tickSpacing ?? 1,
23954
+ windowsPerSide,
23955
+ read: (centerTick, windowTicks) => client.readContract({
23956
+ address: queryAddress,
23957
+ abi: panopticQueryAbi$1,
23958
+ functionName: "getTickNetsV3",
23959
+ args: [
23960
+ poolAddress,
23961
+ centerTick,
23962
+ windowTicks
23963
+ ],
23964
+ blockNumber: _meta.blockNumber
23965
+ }).then(([windowTickData, windowNets]) => ({
23966
+ ticks: windowTickData,
23967
+ liquidityNets: windowNets
23968
+ }))
23821
23969
  });
23822
23970
  return {
23823
- ticks: [...ticks],
23824
- liquidityNets: [...liquidityNets],
23971
+ ticks,
23972
+ liquidityNets,
23825
23973
  _meta
23826
23974
  };
23827
23975
  }
@@ -23994,22 +24142,32 @@ async function getUniswapV4PoolLiquidities(params) {
23994
24142
  const { client, queryAddress, poolManager, poolId, tickSpacing, startTick, nTicks } = params;
23995
24143
  const safeN = clampNTicks(startTick, tickSpacing, nTicks);
23996
24144
  const _meta = await getBlockMeta({ client });
23997
- const [ticks, liquidityNets] = await client.readContract({
23998
- address: queryAddress,
23999
- abi: panopticQueryAbi$1,
24000
- functionName: "getTickNetsV4",
24001
- args: [
24002
- poolManager,
24003
- poolId,
24004
- tickSpacing,
24005
- startTick,
24006
- safeN
24007
- ],
24008
- blockNumber: _meta.blockNumber
24145
+ const { ticks, liquidityNets } = await readTickNetWindows({
24146
+ startTick,
24147
+ mainNTicks: safeN,
24148
+ nTicks,
24149
+ tickSpacing,
24150
+ windowsPerSide: params.windowsPerSide ?? 0,
24151
+ read: (centerTick, windowTicks) => client.readContract({
24152
+ address: queryAddress,
24153
+ abi: panopticQueryAbi$1,
24154
+ functionName: "getTickNetsV4",
24155
+ args: [
24156
+ poolManager,
24157
+ poolId,
24158
+ tickSpacing,
24159
+ centerTick,
24160
+ windowTicks
24161
+ ],
24162
+ blockNumber: _meta.blockNumber
24163
+ }).then(([windowTickData, windowNets]) => ({
24164
+ ticks: windowTickData,
24165
+ liquidityNets: windowNets
24166
+ }))
24009
24167
  });
24010
24168
  return {
24011
- ticks: [...ticks],
24012
- liquidityNets: [...liquidityNets],
24169
+ ticks,
24170
+ liquidityNets,
24013
24171
  _meta
24014
24172
  };
24015
24173
  }
@@ -28532,6 +28690,62 @@ async function getLoanPositionsForToken(client, poolAddress, account, existingPo
28532
28690
  };
28533
28691
  });
28534
28692
  }
28693
+ async function buildRepayDispatch(params) {
28694
+ const { client, account, poolAddress, chainId, token, amount, slippageBps, existingPositionIds, builderCode = 0n } = params;
28695
+ if (amount <= 0n) throw new Error("Repayment amount must be positive");
28696
+ const pool = await getPool({
28697
+ client,
28698
+ poolAddress,
28699
+ chainId
28700
+ });
28701
+ const tokenIndex = resolveTokenIndex(token, pool.collateralTracker0.token, pool.collateralTracker1.token);
28702
+ const loans = await getLoanPositionsForToken(client, poolAddress, account, existingPositionIds, tokenIndex);
28703
+ if (loans.length === 0) throw new NoLoanPositionsError(token);
28704
+ const totalDebt = loans.reduce((sum$1, l) => sum$1 + l.tokenAmount, 0n);
28705
+ const loanIds = loans.map((l) => l.tokenId);
28706
+ const remainder = totalDebt > amount ? totalDebt - amount : 0n;
28707
+ const { low: tickLimitLow, high: tickLimitHigh } = tickLimits(pool.currentTick, slippageBps);
28708
+ const ascendingLimits = [
28709
+ tickLimitLow,
28710
+ tickLimitHigh,
28711
+ 0n
28712
+ ];
28713
+ const nonLoanIds = existingPositionIds.filter((id) => !loanIds.includes(id));
28714
+ const opsPositionIds = [...loanIds];
28715
+ const opsSizes = loanIds.map(() => 0n);
28716
+ const opsLimits = loanIds.map(() => ascendingLimits);
28717
+ let finalPositionIdList;
28718
+ if (remainder > 0n) {
28719
+ const { tokenId: newLoanId, adjustedSize } = buildUniqueLoan(pool.poolId, tokenIndex, tokenIndex, pool.currentTick, pool.tickSpacing, nonLoanIds, remainder);
28720
+ opsPositionIds.push(newLoanId);
28721
+ opsSizes.push(adjustedSize);
28722
+ opsLimits.push(ascendingLimits);
28723
+ finalPositionIdList = [...nonLoanIds, newLoanId];
28724
+ } else finalPositionIdList = nonLoanIds;
28725
+ return {
28726
+ positionIdList: opsPositionIds,
28727
+ finalPositionIdList,
28728
+ positionSizes: opsSizes,
28729
+ tickAndSpreadLimits: opsLimits,
28730
+ usePremiaAsCollateral: false,
28731
+ builderCode
28732
+ };
28733
+ }
28734
+ /** Preview the same full or partial repayment dispatch used by smartRepay. */
28735
+ async function previewRepay(params) {
28736
+ const dispatch$1 = await buildRepayDispatch(params);
28737
+ const simulation = await simulateDispatch({
28738
+ client: params.client,
28739
+ account: params.account,
28740
+ poolAddress: params.poolAddress,
28741
+ existingPositionIdList: params.existingPositionIds,
28742
+ ...dispatch$1
28743
+ });
28744
+ return {
28745
+ dispatch: dispatch$1,
28746
+ simulation
28747
+ };
28748
+ }
28535
28749
  /**
28536
28750
  * Smart repay: burns all loan positions for a token and optionally re-opens a smaller one.
28537
28751
  *
@@ -28545,37 +28759,9 @@ async function getLoanPositionsForToken(client, poolAddress, account, existingPo
28545
28759
  * @returns TxResult
28546
28760
  */
28547
28761
  async function smartRepay(params) {
28548
- const { client, walletClient, account, poolAddress, chainId, token, amount, slippageBps, existingPositionIds, builderCode = 0n, txOverrides } = params;
28762
+ const { client, walletClient, account, poolAddress, txOverrides } = params;
28549
28763
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
28550
- const pool = await getPool({
28551
- client,
28552
- poolAddress,
28553
- chainId
28554
- });
28555
- const tokenIndex = resolveTokenIndex(token, pool.collateralTracker0.token, pool.collateralTracker1.token);
28556
- const loans = await getLoanPositionsForToken(client, poolAddress, account, existingPositionIds, tokenIndex);
28557
- if (loans.length === 0) throw new NoLoanPositionsError(token);
28558
- const totalDebt = loans.reduce((sum$1, l) => sum$1 + l.tokenAmount, 0n);
28559
- const loanIds = loans.map((l) => l.tokenId);
28560
- const remainder = totalDebt > amount ? totalDebt - amount : 0n;
28561
- const { low: tickLimitLow, high: tickLimitHigh } = tickLimits(pool.currentTick, slippageBps);
28562
- const ascendingLimits = [
28563
- Number(tickLimitLow),
28564
- Number(tickLimitHigh),
28565
- 0
28566
- ];
28567
- const nonLoanIds = existingPositionIds.filter((id) => !loanIds.includes(id));
28568
- const opsPositionIds = [...loanIds];
28569
- const opsSizes = loanIds.map(() => 0n);
28570
- const opsLimits = loanIds.map(() => ascendingLimits);
28571
- let finalPositionIdList;
28572
- if (remainder > 0n) {
28573
- const { tokenId: newLoanId, adjustedSize } = buildUniqueLoan(pool.poolId, tokenIndex, tokenIndex, pool.currentTick, pool.tickSpacing, nonLoanIds, remainder);
28574
- opsPositionIds.push(newLoanId);
28575
- opsSizes.push(adjustedSize);
28576
- opsLimits.push(ascendingLimits);
28577
- finalPositionIdList = [...nonLoanIds, newLoanId];
28578
- } else finalPositionIdList = nonLoanIds;
28764
+ const intent = await buildRepayDispatch(params);
28579
28765
  try {
28580
28766
  return await submitWrite({
28581
28767
  client,
@@ -28585,12 +28771,12 @@ async function smartRepay(params) {
28585
28771
  abi: panopticPoolV2Abi,
28586
28772
  functionName: "dispatch",
28587
28773
  args: [
28588
- opsPositionIds,
28589
- finalPositionIdList,
28590
- opsSizes,
28591
- opsLimits,
28592
- false,
28593
- builderCode
28774
+ intent.positionIdList,
28775
+ intent.finalPositionIdList,
28776
+ intent.positionSizes,
28777
+ intent.tickAndSpreadLimits.map((limits) => limits.map(Number)),
28778
+ intent.usePremiaAsCollateral,
28779
+ intent.builderCode
28594
28780
  ],
28595
28781
  txOverrides
28596
28782
  });
@@ -29541,6 +29727,15 @@ async function quoteOneTokenFlow(params) {
29541
29727
  detail: recovery.detail,
29542
29728
  error: recovery.error
29543
29729
  };
29730
+ if (minSwapRatioBps > 0n) {
29731
+ const residualInTargetTerms = convertToTokenIndex(abs(recovery.quote.netTokenOutChange), otherTokenIndex, targetTokenIndex, pool.sqrtPriceX96);
29732
+ const settledInTargetTerms = abs(recovery.quote.netTokenInChange) + residualInTargetTerms;
29733
+ if (residualInTargetTerms * BPS_DENOMINATOR$4 >= minSwapRatioBps * settledInTargetTerms) return {
29734
+ available: false,
29735
+ reason: "residual-not-single-token",
29736
+ detail: `covering the shortfall leaves ${recovery.quote.netTokenOutChange} of the other token (${residualInTargetTerms} in target token terms) against a target flow of ${recovery.quote.netTokenInChange}`
29737
+ };
29738
+ }
29544
29739
  return {
29545
29740
  available: true,
29546
29741
  quote: {
@@ -33070,14 +33265,18 @@ function usePoolLiquidities(poolAddress, params, options) {
33070
33265
  getClientCacheScopeKey(publicClient, clientScope),
33071
33266
  params.queryAddress,
33072
33267
  params.startTick,
33073
- params.nTicks
33268
+ params.nTicks,
33269
+ params.windowsPerSide ?? 0,
33270
+ params.tickSpacing
33074
33271
  ],
33075
33272
  queryFn: () => getPoolLiquidities({
33076
33273
  client: publicClient,
33077
33274
  poolAddress,
33078
33275
  queryAddress: params.queryAddress,
33079
33276
  startTick: params.startTick,
33080
- nTicks: params.nTicks
33277
+ nTicks: params.nTicks,
33278
+ windowsPerSide: params.windowsPerSide,
33279
+ tickSpacing: params.tickSpacing
33081
33280
  }),
33082
33281
  enabled: options?.enabled,
33083
33282
  refetchInterval: options?.refetchInterval,
@@ -34328,17 +34527,21 @@ function useUniswapV3PoolLiquidities(poolAddress, queryAddress, args, options) {
34328
34527
  queryAddress,
34329
34528
  args?.startTick,
34330
34529
  args?.nTicks,
34530
+ args?.windowsPerSide ?? 0,
34531
+ args?.tickSpacing,
34331
34532
  getClientCacheScopeKey(publicClient, clientScope)
34332
34533
  ],
34333
34534
  queryFn: () => {
34334
34535
  if (!poolAddress || !queryAddress || queryAddress === zeroAddress || !args) throw new PanopticValidationError("useUniswapV3PoolLiquidities: missing required args");
34335
- const { startTick, nTicks } = args;
34536
+ const { startTick, nTicks, windowsPerSide, tickSpacing } = args;
34336
34537
  return getUniswapV3PoolLiquidities({
34337
34538
  client: publicClient,
34338
34539
  poolAddress,
34339
34540
  queryAddress,
34340
34541
  startTick,
34341
- nTicks
34542
+ nTicks,
34543
+ windowsPerSide,
34544
+ tickSpacing
34342
34545
  });
34343
34546
  },
34344
34547
  enabled: (options?.enabled ?? true) && !!poolAddress && !!queryAddress && queryAddress !== zeroAddress && !!args,
@@ -34466,11 +34669,12 @@ function useUniswapV4PoolLiquidities(queryAddress, poolManager, poolId, args, op
34466
34669
  args?.tickSpacing,
34467
34670
  args?.startTick,
34468
34671
  args?.nTicks,
34672
+ args?.windowsPerSide ?? 0,
34469
34673
  getClientCacheScopeKey(publicClient, clientScope)
34470
34674
  ],
34471
34675
  queryFn: () => {
34472
34676
  if (!queryAddress || !poolManager || !poolId || !args) throw new PanopticValidationError("useUniswapV4PoolLiquidities: missing required args");
34473
- const { tickSpacing, startTick, nTicks } = args;
34677
+ const { tickSpacing, startTick, nTicks, windowsPerSide } = args;
34474
34678
  return getUniswapV4PoolLiquidities({
34475
34679
  client: publicClient,
34476
34680
  queryAddress,
@@ -34478,7 +34682,8 @@ function useUniswapV4PoolLiquidities(queryAddress, poolManager, poolId, args, op
34478
34682
  poolId,
34479
34683
  tickSpacing,
34480
34684
  startTick,
34481
- nTicks
34685
+ nTicks,
34686
+ windowsPerSide
34482
34687
  });
34483
34688
  },
34484
34689
  enabled: (options?.enabled ?? true) && !!queryAddress && !!poolManager && !!poolId && !!args,
@@ -37991,5 +38196,5 @@ function useTxEventConfirmation({ txHash, poolAddress = zeroAddress, collateralT
37991
38196
  }
37992
38197
 
37993
38198
  //#endregion
37994
- export { AccountInsolventError, AlreadyInitializedError, BORROW_INDEX_BITS, BPS_DENOMINATOR, BPS_SCALE, BatchValidationError, BelowMinimumRedemptionError, CastingError, ChunkHasZeroLiquidityError, ChunkLimitError, CrossPoolError, DEFAULT_MAX_SPREAD, DEFAULT_MINT_BUFFER, DEFAULT_MIN_SWAP_RATIO_BPS, DEFAULT_RECONNECT_CONFIG, DEFAULT_VEGOID, DepositTooLargeError, DuplicateTokenIdError, EffectiveLiquidityAboveThresholdError, ExceedsMaximumRedemptionError, InputListFailError, InsufficientCreditLiquidityError, InvalidBuilderCodeError, InvalidHistoryRangeError, InvalidTickBoundError, InvalidTickError, InvalidTokenIdParameterError, InvalidUniswapCallbackError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LengthMismatchError, LiquidityTooHighError, LoanSlotExhaustedError, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, MARKET_INDICATOR_PERIODS, MAX_TICK, MAX_TRACKED_CHUNKS, MINT_BUFFER, MINT_BUFFER_DENOMINATOR, MIN_TICK, MaxRetriesExceededError, MissingPositionIdsError, NO_LOWER_LIQUIDATION_TICK, NO_UPPER_LIQUIDATION_TICK, NetLiquidityZeroError, NetworkMismatchError, NoLegsExercisableError, NotALongLegError, NotBuilderError, NotEnoughLiquidityInChunkError, NotEnoughTokensError, NotGuardianError, NotMarginCalledError, NotPanopticPoolError, ORACLE_EPOCH_SECONDS, OracleRateLimitedError, PanopticError, PanopticHelperNotDeployedError, PanopticProvider, PanopticValidationError, PoolNotInitializedError, PositionCountNotZeroError, PositionNotOwnedError, PositionSnapshotNotFoundError, PositionTooLargeError, PriceBoundFailError, PriceImpactTooLargeError, ProviderLagError, RATE_AT_TARGET_BITS, REORG_DEPTH, REQUIRED_BASE_ERROR_SENTINEL, ReentrancyError, RpcError, RpcResponseError, SCHEMA_VERSION, SECONDS_PER_YEAR, STANDARD_TICK_WIDTHS, STORAGE_PREFIX, STRIKE_LADDER_TARGET_STRIKES, SafeModeError, StaleDataError, StaleOracleError, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, TokenIdHasZeroLegsError, TooManyLegsOpenError, TransferFailedError, UNREALIZED_INTEREST_BITS, UTILIZATION_DENOMINATOR, UnauthorizedUniswapCallbackError, UnderOverFlowError, UnhealthyPoolError, UnsafePremiumSettlementError, VARIANCE_RATIO_LAG, WAD, WrongPoolIdError, WrongUniswapPoolError, ZERO_COLLATERAL, ZERO_VALUATION, ZeroAddressError, ZeroCollateralRequirementError, addLegToTokenId, addPendingPosition, addTrackedChunks, annualizePerSecondRateWad, applyMintBuffer, applyMintBufferPerToken, apportion, approve, approveAndWait, approvePool, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertLpPositionFunded, assertTradeable, borrow, borrowAndWait, buildBatchDispatchArgs, buildCreditSwapCall, buildCreditWrappedDispatch, buildOpenPositionCalldata, buildProtectedSettleDispatch, buildProtectedSettlePlan, buildSettleSequenceCalls, buildSfpmSwapCalldata, buildSfpmSwapPlan, buildTemporaryLoanRecoveryDispatch, buildTokenShortfallRecoveryDispatch, buildUniqueCredit, buildUniqueLoan, buildUniqueWidthZeroLeg, calculateAccountGreeksPure, calculateMarketIndicator, calculatePortfolioDelta, calculatePortfolioGamma, calculatePortfolioGreeks, calculatePortfolioValue, calculatePositionDelta, calculatePositionDeltaDebtOnly, calculatePositionDeltaWithSwap, calculatePositionGamma, calculatePositionGreeks, calculatePositionValue, calculatePositionValues, calculateResyncBlock, calculateSpreadWad, calculateVarianceProfile, cancelTransaction, checkApproval, checkCollateralAcrossTicks, classifyStrategyGroups, classifyStrike, cleanupStalePendingPositions, clearCheckpoint, clearPendingPositions, clearTrackedChunks, clearTrackedPositions, clearTradeHistory, closePosition, closePositionAndWait, collateralCurveTicks, collateralRuleKindFor, collateralTrackerV2Abi, computeV4PoolId, confirmPendingPosition, convertToAssets, convertToShares, countLegs, createEventPoller, createEventSubscription, createFileStorage, createFlowNeutralTokenId, createMemoryStorage, createNonceManager, createPoolFormatters, createTokenIdBuilder, decodeAllDispatchCalldata, decodeAllLegs, decodeDispatchCalldata, decodeLeftRightSigned, decodeLeftRightUnsigned, decodeLeg, decodeOraclePack, decodeOracleRiskParameters, decodeOracleTiming, decodePanopticTokenURI, decodePoolId, decodeTickSpacing, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, deriveSupplyRatePerSecWad, deriveUniqueTokenId, detectReorg, diagnoseOracleSafeMode, dispatch, dispatchAndWait, emptyLiquidateParams, encodeLeg, encodePoolId, encodePoolKeyBytes, encodeV3PoolKeyBytes, encodeV4PoolId, ensureSfpmV3PoolInitialized, estimateBlockNumbers, estimateCollateralBreakdown, estimateCollateralRequired, executeBatchDispatch, executeBatchDispatchAndWait, executeSettleSequence, executeSettleSequenceAndWait, failPendingPosition, feesFromFeeGrowthDelta, fetchPoolId, fetchSfpmV3PoolId, forceExercise, forceExerciseAndWait, formatBlockNumber, formatBps, formatCompact, formatDatetime, formatDuration, formatDurationSeconds, formatFeeTier, formatGas, formatGwei, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatPoolIdHex, formatPriceRange, formatRateWad, formatRatioPercent, formatTick, formatTickRange, formatTimestamp, formatTimestampLocale, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatTokenIdHex, formatTokenIdShort, formatTxHash, formatUtilization, formatWad, formatWadPercent, formatWadSigned, formatWei, generateOverlappingTokenIds, getAccountBuyingPower, getAccountCollateral, getAccountGreeks, getAccountHistory, getAccountPremia, getAccountSummaryBasic, getAccountSummaryRisk, getAssetIndex, getBlockMeta, getChainDeployment, getChunkLiquidities, getChunkSpreads, getClosedPositions, getClosedPositionsKey, getCollateralAddresses, getCollateralCurve, getCollateralCurveInputs, getCollateralData, getCollateralRequiredBase, getCollateralSharePrices, getCollateralTotalAssetsBatch, getCurrentRates, getDeltaHedgeParams, getEnforcedTickLimits, getExecutableLpMaxSize, getFactoryConstructMetadata, getFactoryOwnerOf, getFactoryTokenURI, getForfeitablePremium, getGuardianUnlockState, getHedgeLimits, getInterestState, getIrmCurrent, getIrmCurve, getItmAmounts, getLegDelta, getLegDeltaInVaultFrame, getLegGamma, getLegNetValueWidth0, getLegValue, getLiquidationPrices, getMarginBuffer, getMaxPositionSize, getMaxRedeem, getMaxWithdrawable, getNativeTokenPrice, getNetLiquidationValue, getNetLiquidationValues, getNotEnoughTokensError, getOpenPositionIds, getOpenPositionPreview, getOracleRiskParameters, getOracleState, getPanopticPoolAddress, getPanopticPoolFromPoolId, getPendingPositions, getPendingPositionsKey, getPool, getPoolCurrentTick, getPoolDeploymentBlock, getPoolDisplayId, getPoolLiquidities, getPoolMetaKey, getPoolMetadata, getPoolPrefix, getPortfolioValue, getPosition, getPositionChunkData, getPositionDeltaMetrics, getPositionEnrichmentData, getPositionGreeks, getPositionMetaKey, getPositionValueCurve, getPositions, getPositionsKey, getPositionsWithPremia, getPriceHistory, getPricesAtTick, getRealizedPnL, getRequiredCreditForITM, getRiskParameters, getSafeMode, getSchemaVersionKey, getStreamiaHistory, getSyncCheckpointKey, getSyncStatus, getTickSpacing, getTokenListId, getTrackedChunks, getTrackedChunksKey, getTrackedPositionIds, getTradeHistory, getUniswapFeeHistory, getUniswapV3LpPositionState, getUniswapV3PoolFromId, getUniswapV3PoolInfo, getUniswapV3PoolLiquidities, getUniswapV4LpPositionState, getUniswapV4PoolBasicState, getUniswapV4PoolInfo, getUniswapV4PoolKeyFromId, getUniswapV4PoolLiquidities, getUtilization, hasLoanOrCredit, hasLongLeg, interpolateBlocks, isCall, isCowSupportedChain, isCredit, isCreditLeg, isDefinedRisk, isGasError, isInputListFailError, isLiquidatable, isLoan, isLoanLeg, isNonceError, isPanopticErrorType, isPositionTracked, isRetryableRpcError, isShortOnly, isSpread, isSupportedChain, isolateGroupTokenId, jsonSerializer, ladderStrikeSequence, liquidate, liquidateAndWait, loadCheckpoint, logReturns, marketPnlInQuote, marketRiskFromValues, marketScenario, minePoolAddress, mint, mintAndWait, mintableAfterBuffer, multicallRead, mutationEffects, netLiquidationValueInQuote, openPosition, openPositionAndWait, optimizeTokenIdRiskPartners, oracleEpochAt, orderListForSettle, packMarketState, panopticLiquidatorAbi, panopticPoolV2Abi, panopticQueryAbi, parseBps, parseCollateralLog, parsePanopticError, parsePoolLog, parseTokenAmount, parseTokenListId, parseWad, planDeriveStrategy, pokeOracle, pokeOracleAndWait, positionValueKey, positionValueTicks, prepareIndicatorCandles, preparePositionValue, preparePositionValueCurve, previewBorrow, previewDeposit, previewMint, previewRedeem, previewUnwrap, previewWithdraw, previewWrap, priceToTick, publicBroadcaster, queryKeys, quoteLiquidation, quoteOneTokenFlow, quoteSfpmSwap, quoteTemporaryLoanRecovery, quoteTokenShortfallRecovery, quoteV3ExactIn, ratePerSecWadToAprPct, realizedBeta, reconstructFromEvents, recoverSnapshot, recoverSnapshotFromTx, redeem, redeemAndWait, removeTrackedChunks, repay, repayAndWait, requireChainDeployment, resolveBlockNumbers, resolveLadderStrike, resolvePanopticPoolFromPoolId, resolveTokenIndex, resolveUniswapV4PoolKey, riskEngineAbi, rollPosition, rollPositionAndWait, roundToTickSpacing, saveCheckpoint, saveClosedPosition, scaleCollateralRequired, scanChunks, screenAccountExact, selectDispatchForAccount, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, settlePremiumFrom, settlePremiumFromAndWait, simulateBatchDispatch, simulateClosePosition, simulateDeployNewPool, simulateDeposit, simulateDispatch, simulateForceExercise, simulateLiquidate, simulateOpenPosition, simulateSFPMBurn, simulateSFPMMint, simulateSettle, simulateSettlePremiumBatch, simulateSettlePremiumFrom, simulateSettleSequence, simulateSwapExactIn, simulateSwapExactOut, simulateWithTokenFlow, simulateWithdraw, slippageBpsToTickDistance, smartRepay, smartRepayAndWait, speedUpTransaction, splitTokenIdByTimescale, sqrtPriceX96ToPriceDecimalScaled, sqrtPriceX96ToTick, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, tickLimits, tickToPrice, tickToPriceDecimalScaled, tickToSqrtPriceX96, toVaultFrameAtTick, truncateAddress, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, useAccountCollateral, useAccountGreeks, useAccountPremia, useAccountSummaryBasic, useAccountSummaryRisk, useAddPendingPosition, useApprove, useApproveErc20ForCow, useApproveErc20ForPermit2, useApprovePool, useApproveRouterViaPermit2, useBatchDispatch as useBatchDispatchHook, useBorrow as useBorrowHook, useCancelCowOrder, useCheckCowApproval, useCheckRouterApproval, useChunkSpreads, useClearTrackedPositions, useClosePosition as useClosePositionHook, useClosedPositions, useCollateralBreakdown, useCollateralData, useConfirmPendingPosition, useCowOrderStatus, useCurrentRates, useDeployNewPool as useDeployNewPoolHook, useDeposit as useDepositHook, useDispatch as useDispatchHook, useEstimateCollateralRequired, useEventPoller, useEventSubscription, useExecuteSettleSequence, useFactoryConstructMetadata, useFactoryOwnerOf, useFactoryTokenURI, useFailPendingPosition, useFlowNeutralTokenId, useForceExercise as useForceExerciseHook, useForfeitablePremium, useGuardianUnlockState, useInterestState, useIsLiquidatable, useLiquidate as useLiquidateHook, useLiquidationPrices, useMarginBuffer, useMaxPositionSize, useMaxRedeem, useMaxWithdrawable, useMinePoolAddress as useMinePoolAddressHook, useMintShares, useNativeTokenPrice, useNetLiquidationValue, useNetLiquidationValues, useOpenPosition as useOpenPositionHook, useOpenPositionPreview, useOptimizeRiskPartners, useOracleState, usePanopticContext, usePanopticPoolAddress, usePokeOracle as usePokeOracleHook, usePool, usePoolLiquidities, usePoolVersion, usePosition, usePositionGreeks, usePositions, usePositionsWithPremia, usePreviewBorrow, usePreviewDeposit, usePreviewMint, usePreviewRedeem, usePreviewWithdraw, usePriceHistory, useQuoteCowSwap, useQuoteSwapExactInViaRouter, useQuoteSwapExactOutViaRouter, useRealizedPnL, useRedeem as useRedeemHook, useRepay as useRepayHook, useResolveUniswapV4PoolKey, useRiskParameters, useRollPosition as useRollPositionHook, useSafeMode, useSettleAccumulatedPremia as useSettleAccumulatedPremiaHook, useSettlePremiumFrom as useSettlePremiumFromHook, useSimulateBatchDispatch, useSimulateClosePosition, useSimulateDeployNewPool, useSimulateDeposit, useSimulateDispatch, useSimulateForceExercise, useSimulateLiquidate, useSimulateOpenPosition, useSimulateSFPMBurn, useSimulateSFPMMint, useSimulateSettle, useSimulateSettlePremiumBatch, useSimulateSettlePremiumFrom, useSimulateSettleSequence, useSimulateSwapExactIn, useSimulateSwapExactOut, useSimulateWithdraw, useSmartRepay as useSmartRepayHook, useStreamiaHistory, useSubmitCowOrder, useSupply as useSupplyHook, useSwapExactIn, useSwapExactInViaRouter, useSwapExactOut, useSwapExactOutViaRouter, useSyncPositions, useSyncStatus, useTrackedPositionIds, useTradeHistory, useTxEventConfirmation, useUniswapFeeHistory, useUniswapV3PoolInfo, useUniswapV3PoolLiquidities, useUniswapV4PoolBasicState, useUniswapV4PoolInfo, useUniswapV4PoolLiquidities, useUnsupply as useUnsupplyHook, useUnwrapWeth, useUnwrapXstock, useUtilization, useValidateBuilderCode, useWatchEvents, useWithdraw as useWithdrawHook, useWithdrawWithPositions as useWithdrawWithPositionsHook, useWrapEth, useWrapXstock, utilizationBpsToWad, utilizationPctToWad, validateBatch, validateBuilderCode, validatePoolId, verifyBlockContinuity, watchEvents, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi };
38199
+ export { AccountInsolventError, AlreadyInitializedError, BORROW_INDEX_BITS, BPS_DENOMINATOR, BPS_SCALE, BatchValidationError, BelowMinimumRedemptionError, CastingError, ChunkHasZeroLiquidityError, ChunkLimitError, CrossPoolError, DEFAULT_MAX_SPREAD, DEFAULT_MINT_BUFFER, DEFAULT_MIN_SWAP_RATIO_BPS, DEFAULT_RECONNECT_CONFIG, DEFAULT_VEGOID, DepositTooLargeError, DuplicateTokenIdError, EffectiveLiquidityAboveThresholdError, ExceedsMaximumRedemptionError, InputListFailError, InsufficientCreditLiquidityError, InvalidBuilderCodeError, InvalidHistoryRangeError, InvalidTickBoundError, InvalidTickError, InvalidTokenIdParameterError, InvalidUniswapCallbackError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LengthMismatchError, LiquidityTooHighError, LoanSlotExhaustedError, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, MARKET_INDICATOR_PERIODS, MAX_TICK, MAX_TRACKED_CHUNKS, MINT_BUFFER, MINT_BUFFER_DENOMINATOR, MIN_TICK, MaxRetriesExceededError, MissingPositionIdsError, NO_LOWER_LIQUIDATION_TICK, NO_UPPER_LIQUIDATION_TICK, NetLiquidityZeroError, NetworkMismatchError, NoLegsExercisableError, NotALongLegError, NotBuilderError, NotEnoughLiquidityInChunkError, NotEnoughTokensError, NotGuardianError, NotMarginCalledError, NotPanopticPoolError, ORACLE_EPOCH_SECONDS, OracleRateLimitedError, PanopticError, PanopticHelperNotDeployedError, PanopticProvider, PanopticValidationError, PoolNotInitializedError, PositionCountNotZeroError, PositionNotOwnedError, PositionSnapshotNotFoundError, PositionTooLargeError, PriceBoundFailError, PriceImpactTooLargeError, ProviderLagError, RATE_AT_TARGET_BITS, REORG_DEPTH, REQUIRED_BASE_ERROR_SENTINEL, ReentrancyError, RpcError, RpcResponseError, SCHEMA_VERSION, SECONDS_PER_YEAR, STANDARD_TICK_WIDTHS, STORAGE_PREFIX, STRIKE_LADDER_TARGET_STRIKES, SafeModeError, StaleDataError, StaleOracleError, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, TokenIdHasZeroLegsError, TooManyLegsOpenError, TransferFailedError, UNREALIZED_INTEREST_BITS, UTILIZATION_DENOMINATOR, UnauthorizedUniswapCallbackError, UnderOverFlowError, UnhealthyPoolError, UnsafePremiumSettlementError, VARIANCE_RATIO_LAG, WAD, WrongPoolIdError, WrongUniswapPoolError, ZERO_COLLATERAL, ZERO_VALUATION, ZeroAddressError, ZeroCollateralRequirementError, addLegToTokenId, addPendingPosition, addTrackedChunks, annualizePerSecondRateWad, applyMintBuffer, applyMintBufferPerToken, apportion, approve, approveAndWait, approvePool, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertLpPositionFunded, assertTradeable, borrow, borrowAndWait, buildBatchDispatchArgs, buildCreditSwapCall, buildCreditWrappedDispatch, buildOpenPositionCalldata, buildProtectedSettleDispatch, buildProtectedSettlePlan, buildSettleSequenceCalls, buildSfpmSwapCalldata, buildSfpmSwapPlan, buildTemporaryLoanRecoveryDispatch, buildTokenShortfallRecoveryDispatch, buildUniqueCredit, buildUniqueLoan, buildUniqueWidthZeroLeg, calculateAccountGreeksPure, calculateMarketIndicator, calculatePortfolioDelta, calculatePortfolioGamma, calculatePortfolioGreeks, calculatePortfolioValue, calculatePositionDelta, calculatePositionDeltaDebtOnly, calculatePositionDeltaWithSwap, calculatePositionGamma, calculatePositionGreeks, calculatePositionValue, calculatePositionValues, calculateResyncBlock, calculateSpreadWad, calculateVarianceProfile, cancelTransaction, checkApproval, checkCollateralAcrossTicks, classifyStrategyGroups, classifyStrike, cleanupStalePendingPositions, clearCheckpoint, clearPendingPositions, clearTrackedChunks, clearTrackedPositions, clearTradeHistory, closePosition, closePositionAndWait, collateralCurveTicks, collateralRuleKindFor, collateralTrackerV2Abi, computeV4PoolId, confirmPendingPosition, convertToAssets, convertToShares, countLegs, createEventPoller, createEventSubscription, createFileStorage, createFlowNeutralTokenId, createMemoryStorage, createNonceManager, createPoolFormatters, createTokenIdBuilder, decodeAllDispatchCalldata, decodeAllLegs, decodeDispatchCalldata, decodeLeftRightSigned, decodeLeftRightUnsigned, decodeLeg, decodeOraclePack, decodeOracleRiskParameters, decodeOracleTiming, decodePanopticTokenURI, decodePoolId, decodeTickSpacing, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, deriveSupplyRatePerSecWad, deriveUniqueTokenId, detectReorg, diagnoseOracleSafeMode, dispatch, dispatchAndWait, emptyLiquidateParams, encodeLeg, encodePoolId, encodePoolKeyBytes, encodeV3PoolKeyBytes, encodeV4PoolId, ensureSfpmV3PoolInitialized, estimateBlockNumbers, estimateCollateralBreakdown, estimateCollateralRequired, executeBatchDispatch, executeBatchDispatchAndWait, executeSettleSequence, executeSettleSequenceAndWait, failPendingPosition, feeGrowthInsideX128, feesFromFeeGrowthDelta, fetchPoolId, fetchSfpmV3PoolId, fetchUniswapFeeData, forceExercise, forceExerciseAndWait, formatBlockNumber, formatBps, formatCompact, formatDatetime, formatDuration, formatDurationSeconds, formatFeeTier, formatGas, formatGwei, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatPoolIdHex, formatPriceRange, formatRateWad, formatRatioPercent, formatTick, formatTickRange, formatTimestamp, formatTimestampLocale, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatTokenIdHex, formatTokenIdShort, formatTxHash, formatUtilization, formatWad, formatWadPercent, formatWadSigned, formatWei, generateOverlappingTokenIds, getAccountBuyingPower, getAccountCollateral, getAccountGreeks, getAccountHistory, getAccountPremia, getAccountSummaryBasic, getAccountSummaryRisk, getAssetIndex, getBlockMeta, getChainDeployment, getChunkLiquidities, getChunkSpreads, getClosedPositions, getClosedPositionsKey, getCollateralAddresses, getCollateralCurve, getCollateralCurveInputs, getCollateralData, getCollateralRequiredBase, getCollateralSharePrices, getCollateralTotalAssetsBatch, getCurrentRates, getDeltaHedgeParams, getEnforcedTickLimits, getExecutableLpMaxSize, getFactoryConstructMetadata, getFactoryOwnerOf, getFactoryTokenURI, getForfeitablePremium, getGuardianUnlockState, getHedgeLimits, getInterestState, getIrmCurrent, getIrmCurve, getItmAmounts, getLegDelta, getLegDeltaInVaultFrame, getLegGamma, getLegNetValueWidth0, getLegValue, getLiquidationPrices, getMarginBuffer, getMaxPositionSize, getMaxRedeem, getMaxWithdrawable, getNativeTokenPrice, getNetLiquidationValue, getNetLiquidationValues, getNotEnoughTokensError, getOpenPositionIds, getOpenPositionPreview, getOracleRiskParameters, getOracleState, getPanopticPoolAddress, getPanopticPoolFromPoolId, getPendingPositions, getPendingPositionsKey, getPool, getPoolCurrentTick, getPoolDeploymentBlock, getPoolDisplayId, getPoolLiquidities, getPoolMetaKey, getPoolMetadata, getPoolPrefix, getPortfolioValue, getPosition, getPositionChunkData, getPositionDeltaMetrics, getPositionEnrichmentData, getPositionGreeks, getPositionMetaKey, getPositionValueCurve, getPositions, getPositionsKey, getPositionsWithPremia, getPriceHistory, getPricesAtTick, getRealizedPnL, getRequiredCreditForITM, getRiskParameters, getSafeMode, getSchemaVersionKey, getSimpleLoanTokenIndex, getStreamiaHistory, getSyncCheckpointKey, getSyncStatus, getTickSpacing, getTokenListId, getTrackedChunks, getTrackedChunksKey, getTrackedPositionIds, getTradeHistory, getUniswapFeeHistory, getUniswapV3LpPositionState, getUniswapV3PoolFromId, getUniswapV3PoolInfo, getUniswapV3PoolLiquidities, getUniswapV4LpPositionState, getUniswapV4PoolBasicState, getUniswapV4PoolInfo, getUniswapV4PoolKeyFromId, getUniswapV4PoolLiquidities, getUtilization, hasLoanOrCredit, hasLongLeg, interpolateBlocks, isCall, isCowSupportedChain, isCredit, isCreditLeg, isDefinedRisk, isGasError, isInputListFailError, isLiquidatable, isLoan, isLoanLeg, isNonceError, isPanopticErrorType, isPositionTracked, isRetryableRpcError, isShortOnly, isSpread, isSupportedChain, isolateGroupTokenId, jsonSerializer, ladderStrikeSequence, liquidate, liquidateAndWait, loadCheckpoint, logReturns, marketPnlInQuote, marketRiskFromValues, marketScenario, minePoolAddress, mint, mintAndWait, mintableAfterBuffer, multicallRead, mutationEffects, netLiquidationValueInQuote, openPosition, openPositionAndWait, optimizeTokenIdRiskPartners, oracleEpochAt, orderListForSettle, packMarketState, panopticLiquidatorAbi, panopticPoolV2Abi, panopticQueryAbi, parseBps, parseCollateralLog, parsePanopticError, parsePoolLog, parseTokenAmount, parseTokenListId, parseWad, planDeriveStrategy, pokeOracle, pokeOracleAndWait, positionValueKey, positionValueTicks, prepareIndicatorCandles, preparePositionValue, preparePositionValueCurve, previewBorrow, previewDeposit, previewMint, previewRedeem, previewRepay, previewUnwrap, previewWithdraw, previewWrap, priceToTick, publicBroadcaster, queryKeys, quoteLiquidation, quoteOneTokenFlow, quoteSfpmSwap, quoteTemporaryLoanRecovery, quoteTokenShortfallRecovery, quoteV3ExactIn, ratePerSecWadToAprPct, realizedBeta, reconstructFromEvents, recoverSnapshot, recoverSnapshotFromTx, redeem, redeemAndWait, removeTrackedChunks, repay, repayAndWait, requireChainDeployment, resolveBlockNumbers, resolveLadderStrike, resolvePanopticPoolFromPoolId, resolveTokenIndex, resolveUniswapV4PoolKey, riskEngineAbi, rollPosition, rollPositionAndWait, roundToTickSpacing, saveCheckpoint, saveClosedPosition, scaleCollateralRequired, scanChunks, screenAccountExact, selectDispatchForAccount, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, settlePremiumFrom, settlePremiumFromAndWait, simulateBatchDispatch, simulateClosePosition, simulateDeployNewPool, simulateDeposit, simulateDispatch, simulateForceExercise, simulateLiquidate, simulateOpenPosition, simulateSFPMBurn, simulateSFPMMint, simulateSettle, simulateSettlePremiumBatch, simulateSettlePremiumFrom, simulateSettleSequence, simulateSwapExactIn, simulateSwapExactOut, simulateWithTokenFlow, simulateWithdraw, slippageBpsToTickDistance, smartRepay, smartRepayAndWait, speedUpTransaction, splitTokenIdByTimescale, sqrtPriceX96ToPriceDecimalScaled, sqrtPriceX96ToTick, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, tickLimits, tickToPrice, tickToPriceDecimalScaled, tickToSqrtPriceX96, toVaultFrameAtTick, truncateAddress, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, useAccountCollateral, useAccountGreeks, useAccountPremia, useAccountSummaryBasic, useAccountSummaryRisk, useAddPendingPosition, useApprove, useApproveErc20ForCow, useApproveErc20ForPermit2, useApprovePool, useApproveRouterViaPermit2, useBatchDispatch as useBatchDispatchHook, useBorrow as useBorrowHook, useCancelCowOrder, useCheckCowApproval, useCheckRouterApproval, useChunkSpreads, useClearTrackedPositions, useClosePosition as useClosePositionHook, useClosedPositions, useCollateralBreakdown, useCollateralData, useConfirmPendingPosition, useCowOrderStatus, useCurrentRates, useDeployNewPool as useDeployNewPoolHook, useDeposit as useDepositHook, useDispatch as useDispatchHook, useEstimateCollateralRequired, useEventPoller, useEventSubscription, useExecuteSettleSequence, useFactoryConstructMetadata, useFactoryOwnerOf, useFactoryTokenURI, useFailPendingPosition, useFlowNeutralTokenId, useForceExercise as useForceExerciseHook, useForfeitablePremium, useGuardianUnlockState, useInterestState, useIsLiquidatable, useLiquidate as useLiquidateHook, useLiquidationPrices, useMarginBuffer, useMaxPositionSize, useMaxRedeem, useMaxWithdrawable, useMinePoolAddress as useMinePoolAddressHook, useMintShares, useNativeTokenPrice, useNetLiquidationValue, useNetLiquidationValues, useOpenPosition as useOpenPositionHook, useOpenPositionPreview, useOptimizeRiskPartners, useOracleState, usePanopticContext, usePanopticPoolAddress, usePokeOracle as usePokeOracleHook, usePool, usePoolLiquidities, usePoolVersion, usePosition, usePositionGreeks, usePositions, usePositionsWithPremia, usePreviewBorrow, usePreviewDeposit, usePreviewMint, usePreviewRedeem, usePreviewWithdraw, usePriceHistory, useQuoteCowSwap, useQuoteSwapExactInViaRouter, useQuoteSwapExactOutViaRouter, useRealizedPnL, useRedeem as useRedeemHook, useRepay as useRepayHook, useResolveUniswapV4PoolKey, useRiskParameters, useRollPosition as useRollPositionHook, useSafeMode, useSettleAccumulatedPremia as useSettleAccumulatedPremiaHook, useSettlePremiumFrom as useSettlePremiumFromHook, useSimulateBatchDispatch, useSimulateClosePosition, useSimulateDeployNewPool, useSimulateDeposit, useSimulateDispatch, useSimulateForceExercise, useSimulateLiquidate, useSimulateOpenPosition, useSimulateSFPMBurn, useSimulateSFPMMint, useSimulateSettle, useSimulateSettlePremiumBatch, useSimulateSettlePremiumFrom, useSimulateSettleSequence, useSimulateSwapExactIn, useSimulateSwapExactOut, useSimulateWithdraw, useSmartRepay as useSmartRepayHook, useStreamiaHistory, useSubmitCowOrder, useSupply as useSupplyHook, useSwapExactIn, useSwapExactInViaRouter, useSwapExactOut, useSwapExactOutViaRouter, useSyncPositions, useSyncStatus, useTrackedPositionIds, useTradeHistory, useTxEventConfirmation, useUniswapFeeHistory, useUniswapV3PoolInfo, useUniswapV3PoolLiquidities, useUniswapV4PoolBasicState, useUniswapV4PoolInfo, useUniswapV4PoolLiquidities, useUnsupply as useUnsupplyHook, useUnwrapWeth, useUnwrapXstock, useUtilization, useValidateBuilderCode, useWatchEvents, useWithdraw as useWithdrawHook, useWithdrawWithPositions as useWithdrawWithPositionsHook, useWrapEth, useWrapXstock, utilizationBpsToWad, utilizationPctToWad, validateBatch, validateBuilderCode, validatePoolId, verifyBlockContinuity, watchEvents, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi };
37995
38200
  //# sourceMappingURL=react-public.js.map