@panoptic-eng/sdk 1.0.55 → 1.0.57
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/chainDeployments-D_bvyWEm.js +408 -0
- package/dist/{cow-BahYFov0.js → cow-45nsAaEr.js} +1 -1
- package/dist/deployments.js +2 -2
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +83 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +323 -78
- package/dist/index.js.map +1 -1
- package/dist/{irm-BsRdsXMS.js → irm-DsM35dGO.js} +2 -409
- package/dist/panoptic/v2/index.d.ts +147 -1
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +266 -22
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.d.ts +147 -1
- package/dist/panoptic/v2/react-public.d.ts.map +1 -1
- package/dist/panoptic/v2/react-public.js +266 -22
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/{rates-B0uPUed1.js → rates-CEJz8fjw.js} +1 -1
- package/dist/{router-BhJqStSJ.js → router-DOUAKfn6.js} +2 -2
- package/dist/{router-kAllFA4i.js → router-DUOHNdYZ.js} +21 -12
- package/dist/{transactionFees-DE-Whxab.js → transactionFees-qweht4Rd.js} +54 -28
- package/dist/uniswap/index.d.ts +6 -1
- package/dist/uniswap/index.d.ts.map +1 -1
- package/dist/uniswap/index.js +19 -10
- package/dist/uniswap/index.js.map +1 -1
- package/dist/{v2-bpvC_P3W.js → v2-B3MqHVHt.js} +247 -12
- package/dist/vault-transaction-fees.d.ts +5 -3
- package/dist/vault-transaction-fees.d.ts.map +1 -1
- package/dist/vault-transaction-fees.js +443 -28
- package/dist/vault-transaction-fees.js.map +1 -1
- package/dist/{writes-B4nGIi6h.js → writes-CQrevcCu.js} +2 -2
- package/dist/zodiac/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -11288,13 +11288,10 @@ function getLpDepositBreakdown(ranges, sqrtPriceX96) {
|
|
|
11288
11288
|
}
|
|
11289
11289
|
};
|
|
11290
11290
|
}
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
const legs = decodeAllLegs(tokenId);
|
|
11296
|
-
if (legs.length === 0 || legs.some((leg) => leg.isLong || leg.width === 0n)) throw new Error("AMM Liquidity requires short liquidity legs without loans or credits");
|
|
11297
|
-
const ranges = legs.map((leg) => {
|
|
11291
|
+
function getUnhedgedLpRanges({ tokenId, positionSize, tickSpacing }) {
|
|
11292
|
+
if (positionSize < 0n || tickSpacing <= 0n) throw new Error("Invalid LP range input");
|
|
11293
|
+
return decodeAllLegs(tokenId).flatMap((leg) => {
|
|
11294
|
+
if (leg.isLong || leg.width === 0n) return [];
|
|
11298
11295
|
const width = leg.width * tickSpacing;
|
|
11299
11296
|
const tickLower = leg.strike - width / 2n;
|
|
11300
11297
|
const tickUpper = leg.strike + (width + 1n) / 2n;
|
|
@@ -11302,11 +11299,23 @@ function getLpPositionFunding(params) {
|
|
|
11302
11299
|
const upper = tickToSqrtPriceX96(tickUpper);
|
|
11303
11300
|
const amount = positionSize * leg.optionRatio;
|
|
11304
11301
|
const liquidity = leg.asset === 0n ? amount * (lower * upper / Q96$2) / (upper - lower) : amount * Q96$2 / (upper - lower);
|
|
11305
|
-
return {
|
|
11302
|
+
return liquidity <= 0n ? [] : [{
|
|
11306
11303
|
tickLower: Number(tickLower),
|
|
11307
11304
|
tickUpper: Number(tickUpper),
|
|
11308
11305
|
liquidity
|
|
11309
|
-
};
|
|
11306
|
+
}];
|
|
11307
|
+
});
|
|
11308
|
+
}
|
|
11309
|
+
/** Full deployed liquidity value; never a leveraged protocol margin estimate. */
|
|
11310
|
+
function getLpPositionFunding(params) {
|
|
11311
|
+
const { tokenId, positionSize, tickSpacing, sqrtPriceX96, valuationSqrtPriceX96, quoteTokenIndex } = params;
|
|
11312
|
+
if (positionSize < 0n || tickSpacing <= 0n || valuationSqrtPriceX96 <= 0n) throw new Error("Invalid LP funding input");
|
|
11313
|
+
const legs = decodeAllLegs(tokenId);
|
|
11314
|
+
if (legs.length === 0 || legs.some((leg) => leg.isLong || leg.width === 0n)) throw new Error("AMM Liquidity requires short liquidity legs without loans or credits");
|
|
11315
|
+
const ranges = getUnhedgedLpRanges({
|
|
11316
|
+
tokenId,
|
|
11317
|
+
positionSize,
|
|
11318
|
+
tickSpacing
|
|
11310
11319
|
});
|
|
11311
11320
|
const breakdown = getLpDepositBreakdown(ranges, sqrtPriceX96);
|
|
11312
11321
|
const priceSquared = valuationSqrtPriceX96 * valuationSqrtPriceX96;
|
|
@@ -12716,11 +12725,11 @@ function createTxResult(client, hash) {
|
|
|
12716
12725
|
* @returns TxResult
|
|
12717
12726
|
*/
|
|
12718
12727
|
async function submitWrite(params) {
|
|
12719
|
-
const { client, walletClient, account, address, abi, functionName, args, value, txOverrides } = params;
|
|
12728
|
+
const { client, walletClient, account, address, abi: abi$1, functionName, args, value, txOverrides } = params;
|
|
12720
12729
|
const broadcaster = txOverrides?.broadcaster;
|
|
12721
12730
|
if (broadcaster) {
|
|
12722
12731
|
const data = encodeFunctionData({
|
|
12723
|
-
abi,
|
|
12732
|
+
abi: abi$1,
|
|
12724
12733
|
functionName,
|
|
12725
12734
|
args
|
|
12726
12735
|
});
|
|
@@ -12752,7 +12761,7 @@ async function submitWrite(params) {
|
|
|
12752
12761
|
else {
|
|
12753
12762
|
const estimated = await client.estimateContractGas({
|
|
12754
12763
|
address,
|
|
12755
|
-
abi,
|
|
12764
|
+
abi: abi$1,
|
|
12756
12765
|
functionName,
|
|
12757
12766
|
args,
|
|
12758
12767
|
account: resolvedAccount,
|
|
@@ -12762,7 +12771,7 @@ async function submitWrite(params) {
|
|
|
12762
12771
|
}
|
|
12763
12772
|
const hash = await walletClient.writeContract({
|
|
12764
12773
|
address,
|
|
12765
|
-
abi,
|
|
12774
|
+
abi: abi$1,
|
|
12766
12775
|
functionName,
|
|
12767
12776
|
args,
|
|
12768
12777
|
account: resolvedAccount,
|
|
@@ -19055,10 +19064,10 @@ async function getChunkLiquidities(params) {
|
|
|
19055
19064
|
*/
|
|
19056
19065
|
async function getFactoryTokenURI(params) {
|
|
19057
19066
|
const { client, factoryAddress, version, tokenId } = params;
|
|
19058
|
-
const abi = version === "v3" ? panopticFactoryV3Abi : panopticFactoryV4Abi;
|
|
19067
|
+
const abi$1 = version === "v3" ? panopticFactoryV3Abi : panopticFactoryV4Abi;
|
|
19059
19068
|
return client.readContract({
|
|
19060
19069
|
address: factoryAddress,
|
|
19061
|
-
abi,
|
|
19070
|
+
abi: abi$1,
|
|
19062
19071
|
functionName: "tokenURI",
|
|
19063
19072
|
args: [tokenId]
|
|
19064
19073
|
});
|
|
@@ -19068,10 +19077,10 @@ async function getFactoryTokenURI(params) {
|
|
|
19068
19077
|
*/
|
|
19069
19078
|
async function getFactoryOwnerOf(params) {
|
|
19070
19079
|
const { client, factoryAddress, version, tokenId } = params;
|
|
19071
|
-
const abi = version === "v3" ? panopticFactoryV3Abi : panopticFactoryV4Abi;
|
|
19080
|
+
const abi$1 = version === "v3" ? panopticFactoryV3Abi : panopticFactoryV4Abi;
|
|
19072
19081
|
return client.readContract({
|
|
19073
19082
|
address: factoryAddress,
|
|
19074
|
-
abi,
|
|
19083
|
+
abi: abi$1,
|
|
19075
19084
|
functionName: "ownerOf",
|
|
19076
19085
|
args: [tokenId]
|
|
19077
19086
|
});
|
|
@@ -19081,10 +19090,10 @@ async function getFactoryOwnerOf(params) {
|
|
|
19081
19090
|
*/
|
|
19082
19091
|
async function getFactoryConstructMetadata(params) {
|
|
19083
19092
|
const { client, factoryAddress, version, panopticPoolAddress, symbol0, symbol1, fee } = params;
|
|
19084
|
-
const abi = version === "v3" ? panopticFactoryV3Abi : panopticFactoryV4Abi;
|
|
19093
|
+
const abi$1 = version === "v3" ? panopticFactoryV3Abi : panopticFactoryV4Abi;
|
|
19085
19094
|
return client.readContract({
|
|
19086
19095
|
address: factoryAddress,
|
|
19087
|
-
abi,
|
|
19096
|
+
abi: abi$1,
|
|
19088
19097
|
functionName: "constructMetadata",
|
|
19089
19098
|
args: [
|
|
19090
19099
|
panopticPoolAddress,
|
|
@@ -23355,6 +23364,8 @@ async function getUniswapFeeHistory(params) {
|
|
|
23355
23364
|
return {
|
|
23356
23365
|
blockNumber: blockMetadata[i].blockNumber,
|
|
23357
23366
|
blockTimestamp: blockMetadata[i].blockTimestamp,
|
|
23367
|
+
currentTick: bd.currentTick,
|
|
23368
|
+
sqrtPriceX96: bd.sqrtPriceX96,
|
|
23358
23369
|
fees: {
|
|
23359
23370
|
token0: total0 - initialFees0,
|
|
23360
23371
|
token1: total1 - initialFees1
|
|
@@ -23454,6 +23465,7 @@ async function fetchV3BlockSnapshot(client, poolAddress, blockNumber, uniqueTick
|
|
|
23454
23465
|
}
|
|
23455
23466
|
return {
|
|
23456
23467
|
currentTick: slot0Result[1],
|
|
23468
|
+
sqrtPriceX96: slot0Result[0],
|
|
23457
23469
|
feeGrowthGlobal0,
|
|
23458
23470
|
feeGrowthGlobal1,
|
|
23459
23471
|
tickData
|
|
@@ -23497,6 +23509,7 @@ async function fetchV4BlockSnapshot(client, stateViewAddress, poolId, blockNumbe
|
|
|
23497
23509
|
}
|
|
23498
23510
|
return {
|
|
23499
23511
|
currentTick: slot0Result[1],
|
|
23512
|
+
sqrtPriceX96: slot0Result[0],
|
|
23500
23513
|
feeGrowthGlobal0: feeGrowthResult[0],
|
|
23501
23514
|
feeGrowthGlobal1: feeGrowthResult[1],
|
|
23502
23515
|
tickData
|
|
@@ -32221,7 +32234,7 @@ const VAULT_DISPLAY_NAMES_PER_CHAIN = {
|
|
|
32221
32234
|
[sepoliaVaults.wethPlpVault.toLowerCase()]: "PLP Vault",
|
|
32222
32235
|
[sepoliaVaults.usdcPlpVault.toLowerCase()]: "Unicorn Vault"
|
|
32223
32236
|
},
|
|
32224
|
-
[ROBINHOOD_CHAIN_ID]: { [robinhoodUsdgVault.toLowerCase()]: "
|
|
32237
|
+
[ROBINHOOD_CHAIN_ID]: { [robinhoodUsdgVault.toLowerCase()]: "0DTE +67∆ Vault" }
|
|
32225
32238
|
};
|
|
32226
32239
|
const VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN = {
|
|
32227
32240
|
[MAINNET_CHAIN_ID]: {
|
|
@@ -32238,9 +32251,240 @@ const VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN = {
|
|
|
32238
32251
|
[sepoliaVaults.wethPlpVault.toLowerCase()]: () => "PLP Vault",
|
|
32239
32252
|
[sepoliaVaults.usdcPlpVault.toLowerCase()]: () => "Unicorn Vault"
|
|
32240
32253
|
},
|
|
32241
|
-
[ROBINHOOD_CHAIN_ID]: { [robinhoodUsdgVault.toLowerCase()]: () => "
|
|
32254
|
+
[ROBINHOOD_CHAIN_ID]: { [robinhoodUsdgVault.toLowerCase()]: () => "0DTE +67∆ Vault" }
|
|
32242
32255
|
};
|
|
32243
32256
|
|
|
32257
|
+
//#endregion
|
|
32258
|
+
//#region src/panoptic/v2/greeks/marketPnl.ts
|
|
32259
|
+
/** Values and prices use raw token units, matching the net-liquidation-value read. */
|
|
32260
|
+
function netLiquidationValueInQuote(value0, value1, tick, isAssetToken0) {
|
|
32261
|
+
const price = new Decimal("1.0001").pow(tick.toString());
|
|
32262
|
+
return isAssetToken0 ? new Decimal(value1.toString()).plus(new Decimal(value0.toString()).mul(price)) : new Decimal(value0.toString()).plus(new Decimal(value1.toString()).div(price));
|
|
32263
|
+
}
|
|
32264
|
+
/** Apply the accrued-premium offset and optional asset collateral to a relative NLV curve. */
|
|
32265
|
+
function marketPnlInQuote({ relativeValue, premium, assetBalance = 0n, price, baselinePrice }) {
|
|
32266
|
+
return new Decimal(relativeValue).plus(premium).plus(new Decimal(assetBalance.toString()).mul(new Decimal(price).minus(baselinePrice)));
|
|
32267
|
+
}
|
|
32268
|
+
/** Map a common reference-asset shock into a pool tick and quote-token USD multiplier. */
|
|
32269
|
+
function marketScenario({ currentTick, isAssetToken0, assetBeta, quoteBeta, shock }) {
|
|
32270
|
+
const assetFactor = new Decimal(assetBeta).mul(shock).plus(1);
|
|
32271
|
+
const quoteFactor = new Decimal(quoteBeta).mul(shock).plus(1);
|
|
32272
|
+
if (!assetFactor.isFinite() || !quoteFactor.isFinite() || assetFactor.lte(0) || quoteFactor.lte(0)) return null;
|
|
32273
|
+
const shift = assetFactor.div(quoteFactor).ln().div(new Decimal("1.0001").ln());
|
|
32274
|
+
const tick = currentTick + BigInt(shift.mul(isAssetToken0 ? 1 : -1).round().toFixed(0));
|
|
32275
|
+
return tick < -887272n || tick > 887272n ? null : {
|
|
32276
|
+
tick,
|
|
32277
|
+
quoteFactor
|
|
32278
|
+
};
|
|
32279
|
+
}
|
|
32280
|
+
/** Finite-difference risk in raw asset/quote units from three ordered quote prices. */
|
|
32281
|
+
function marketRiskFromValues({ lower, current, upper }) {
|
|
32282
|
+
const left = new Decimal(current.price).minus(lower.price);
|
|
32283
|
+
const right = new Decimal(upper.price).minus(current.price);
|
|
32284
|
+
if (left.lte(0) || right.lte(0)) return null;
|
|
32285
|
+
const leftSlope = new Decimal(current.value).minus(lower.value).div(left);
|
|
32286
|
+
const rightSlope = new Decimal(upper.value).minus(current.value).div(right);
|
|
32287
|
+
const delta = leftSlope.mul(right).plus(rightSlope.mul(left)).div(left.plus(right));
|
|
32288
|
+
const gamma = rightSlope.minus(leftSlope).mul(2).div(left.plus(right)).mul(new Decimal(current.price).pow(2));
|
|
32289
|
+
return {
|
|
32290
|
+
asset: delta,
|
|
32291
|
+
quote: new Decimal(current.value).minus(delta.mul(current.price)),
|
|
32292
|
+
gamma
|
|
32293
|
+
};
|
|
32294
|
+
}
|
|
32295
|
+
|
|
32296
|
+
//#endregion
|
|
32297
|
+
//#region src/panoptic/v2/reads/collateralCurve.ts
|
|
32298
|
+
/** Native-token margin inputs, independent of the tick used to display the curve. */
|
|
32299
|
+
async function getCollateralCurveInputs({ client, poolAddress, account, tokenIds, collateral0, collateral1, blockNumber }) {
|
|
32300
|
+
const ids = [...tokenIds].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
32301
|
+
const [tracker0, tracker1] = await Promise.all([collateral0 ?? client.readContract({
|
|
32302
|
+
address: poolAddress,
|
|
32303
|
+
abi: panopticPoolV2Abi,
|
|
32304
|
+
functionName: "collateralToken0",
|
|
32305
|
+
blockNumber
|
|
32306
|
+
}), collateral1 ?? client.readContract({
|
|
32307
|
+
address: poolAddress,
|
|
32308
|
+
abi: panopticPoolV2Abi,
|
|
32309
|
+
functionName: "collateralToken1",
|
|
32310
|
+
blockNumber
|
|
32311
|
+
})]);
|
|
32312
|
+
const [positions, balances0, balances1] = await Promise.all([
|
|
32313
|
+
client.readContract({
|
|
32314
|
+
address: poolAddress,
|
|
32315
|
+
abi: panopticPoolV2Abi,
|
|
32316
|
+
functionName: "getFullPositionsData",
|
|
32317
|
+
args: [
|
|
32318
|
+
account,
|
|
32319
|
+
false,
|
|
32320
|
+
ids
|
|
32321
|
+
],
|
|
32322
|
+
blockNumber
|
|
32323
|
+
}),
|
|
32324
|
+
client.readContract({
|
|
32325
|
+
address: tracker0,
|
|
32326
|
+
abi: collateralTrackerV2Abi,
|
|
32327
|
+
functionName: "assetsAndInterest",
|
|
32328
|
+
args: [account],
|
|
32329
|
+
blockNumber
|
|
32330
|
+
}),
|
|
32331
|
+
client.readContract({
|
|
32332
|
+
address: tracker1,
|
|
32333
|
+
abi: collateralTrackerV2Abi,
|
|
32334
|
+
functionName: "assetsAndInterest",
|
|
32335
|
+
args: [account],
|
|
32336
|
+
blockNumber
|
|
32337
|
+
})
|
|
32338
|
+
]);
|
|
32339
|
+
return [
|
|
32340
|
+
positions[0],
|
|
32341
|
+
positions[1],
|
|
32342
|
+
...positions[2],
|
|
32343
|
+
...balances0,
|
|
32344
|
+
...balances1
|
|
32345
|
+
];
|
|
32346
|
+
}
|
|
32347
|
+
/** A spot-independent sampling grid, including exact liquidation boundaries and their neighbours. */
|
|
32348
|
+
function collateralCurveTicks(tokenIds, liquidationTicks) {
|
|
32349
|
+
const strikes = tokenIds.flatMap((id) => decodeTokenId(id).legs.map((leg) => leg.strike));
|
|
32350
|
+
const center = strikes.length === 0 ? 0n : strikes.reduce((a, b) => a + b, 0n) / BigInt(strikes.length);
|
|
32351
|
+
const ticks = new Set([-887272n, 887272n]);
|
|
32352
|
+
for (let i = 0n; i < 250n; i++) {
|
|
32353
|
+
ticks.add(center - 25000n + 50000n * i / 249n);
|
|
32354
|
+
ticks.add(-887272n + 1774544n * i / 249n);
|
|
32355
|
+
}
|
|
32356
|
+
for (const tick of liquidationTicks) {
|
|
32357
|
+
ticks.add(tick - 1n);
|
|
32358
|
+
ticks.add(tick);
|
|
32359
|
+
ticks.add(tick + 1n);
|
|
32360
|
+
}
|
|
32361
|
+
return [...ticks].filter((tick) => tick >= -887272n && tick <= 887272n).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
32362
|
+
}
|
|
32363
|
+
/** Collateral requirements and liquidation boundaries evaluated at one block. */
|
|
32364
|
+
async function getCollateralCurve({ client, poolAddress, account, queryAddress, tokenIds, blockNumber: requestedBlockNumber }) {
|
|
32365
|
+
const blockNumber = requestedBlockNumber ?? await client.getBlockNumber();
|
|
32366
|
+
const boundaries = await client.readContract({
|
|
32367
|
+
address: queryAddress,
|
|
32368
|
+
abi: panopticQueryAbi$1,
|
|
32369
|
+
functionName: "getLiquidationPrices",
|
|
32370
|
+
args: [
|
|
32371
|
+
poolAddress,
|
|
32372
|
+
account,
|
|
32373
|
+
tokenIds
|
|
32374
|
+
],
|
|
32375
|
+
blockNumber
|
|
32376
|
+
});
|
|
32377
|
+
const liquidationTicks = boundaries.map(BigInt).filter((tick) => tick >= -887272n && tick <= 887272n);
|
|
32378
|
+
const ticks = collateralCurveTicks(tokenIds, liquidationTicks);
|
|
32379
|
+
const contracts = ticks.map((tick) => ({
|
|
32380
|
+
address: queryAddress,
|
|
32381
|
+
abi: panopticQueryAbi$1,
|
|
32382
|
+
functionName: "checkCollateral",
|
|
32383
|
+
args: [
|
|
32384
|
+
poolAddress,
|
|
32385
|
+
account,
|
|
32386
|
+
tokenIds,
|
|
32387
|
+
Number(tick)
|
|
32388
|
+
]
|
|
32389
|
+
}));
|
|
32390
|
+
const chunks = [];
|
|
32391
|
+
for (let i = 0; i < contracts.length; i += 100) chunks.push(contracts.slice(i, i + 100));
|
|
32392
|
+
const results = (await Promise.all(chunks.map((batch) => multicall(client, {
|
|
32393
|
+
contracts: batch,
|
|
32394
|
+
blockNumber,
|
|
32395
|
+
allowFailure: false
|
|
32396
|
+
})))).flat();
|
|
32397
|
+
return {
|
|
32398
|
+
blockNumber,
|
|
32399
|
+
liquidationTicks,
|
|
32400
|
+
points: results.map(([collateral0, required0, collateral1, required1], i) => ({
|
|
32401
|
+
tick: ticks[i],
|
|
32402
|
+
collateral0,
|
|
32403
|
+
required0,
|
|
32404
|
+
collateral1,
|
|
32405
|
+
required1
|
|
32406
|
+
}))
|
|
32407
|
+
};
|
|
32408
|
+
}
|
|
32409
|
+
|
|
32410
|
+
//#endregion
|
|
32411
|
+
//#region src/panoptic/v2/reads/positionValueCurve.ts
|
|
32412
|
+
const abi = parseAbi(["function computeNetLiquidationValue(uint256[] positionIdList, uint256 shortPremium, uint256 longPremium, uint256[] positionBalanceArray, int24[] atTicks) pure returns (int256[] value0, int256[] value1)"]);
|
|
32413
|
+
/** Stable identity for a position-dependent curve; premiums and spot are separate inputs. */
|
|
32414
|
+
function positionValueKey(positions) {
|
|
32415
|
+
return [...positions].sort((a, b) => a.tokenId < b.tokenId ? -1 : a.tokenId > b.tokenId ? 1 : 0).map(({ tokenId, positionSize }) => `${tokenId}:${positionSize}`).join(",");
|
|
32416
|
+
}
|
|
32417
|
+
/** All changes in the curve's active liquidity, independent of the current market tick. */
|
|
32418
|
+
function positionValueTicks(positions) {
|
|
32419
|
+
const ticks = new Set([-887272n, 887272n]);
|
|
32420
|
+
for (const { tokenId, positionSize } of positions) {
|
|
32421
|
+
if (tokenId < 0n || tokenId >= 1n << 256n || positionSize <= 0n || positionSize >= 1n << 128n) throw new RangeError("Invalid position id or size");
|
|
32422
|
+
const { legs, tickSpacing } = decodeTokenId(tokenId);
|
|
32423
|
+
for (const leg of legs) {
|
|
32424
|
+
if (leg.width === 0n) continue;
|
|
32425
|
+
const width = leg.width * tickSpacing;
|
|
32426
|
+
const lower = leg.strike - width / 2n;
|
|
32427
|
+
const upper = leg.strike + (width + 1n) / 2n;
|
|
32428
|
+
if (lower < -887272n || upper > 887272n || lower >= upper) throw new RangeError("Invalid position range");
|
|
32429
|
+
ticks.add(lower);
|
|
32430
|
+
ticks.add(upper);
|
|
32431
|
+
}
|
|
32432
|
+
}
|
|
32433
|
+
return [...ticks].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
32434
|
+
}
|
|
32435
|
+
/** Read the immutable, premium-free part of NLV from the deployed pure calculation. */
|
|
32436
|
+
async function getPositionValueCurve({ client, queryAddress, positions }) {
|
|
32437
|
+
const ticks = positionValueTicks(positions);
|
|
32438
|
+
const [values0, values1] = await client.readContract({
|
|
32439
|
+
address: queryAddress,
|
|
32440
|
+
abi,
|
|
32441
|
+
functionName: "computeNetLiquidationValue",
|
|
32442
|
+
args: [
|
|
32443
|
+
positions.map((p) => p.tokenId),
|
|
32444
|
+
0n,
|
|
32445
|
+
0n,
|
|
32446
|
+
positions.map((p) => p.positionSize),
|
|
32447
|
+
ticks.map(Number)
|
|
32448
|
+
]
|
|
32449
|
+
});
|
|
32450
|
+
return ticks.map((tick, i) => ({
|
|
32451
|
+
tick,
|
|
32452
|
+
value0: values0[i],
|
|
32453
|
+
value1: values1[i]
|
|
32454
|
+
}));
|
|
32455
|
+
}
|
|
32456
|
+
/**
|
|
32457
|
+
* Between leg boundaries, token0 is affine in inverse sqrt price and token1 in sqrt price.
|
|
32458
|
+
* Endpoint interpolation differs from contract integer rounding by at most a few wei per leg.
|
|
32459
|
+
*/
|
|
32460
|
+
function preparePositionValueCurve(curve) {
|
|
32461
|
+
if (curve.length < 2) throw new RangeError("Incomplete position value curve");
|
|
32462
|
+
for (let i = 0; i < curve.length; i++) if (curve[i].tick < -887272n || curve[i].tick > 887272n || i > 0 && curve[i].tick <= curve[i - 1].tick) throw new RangeError("Invalid position value curve ticks");
|
|
32463
|
+
const points = curve.map((point) => ({
|
|
32464
|
+
...point,
|
|
32465
|
+
sqrt: tickToSqrtPriceX96(point.tick)
|
|
32466
|
+
}));
|
|
32467
|
+
return (tick) => {
|
|
32468
|
+
if (tick < points[0].tick || tick > points[points.length - 1].tick) throw new RangeError("Tick outside position value curve");
|
|
32469
|
+
let lo = 0;
|
|
32470
|
+
let hi = points.length - 1;
|
|
32471
|
+
while (hi - lo > 1) {
|
|
32472
|
+
const mid = Math.floor((lo + hi) / 2);
|
|
32473
|
+
if (points[mid].tick <= tick) lo = mid;
|
|
32474
|
+
else hi = mid;
|
|
32475
|
+
}
|
|
32476
|
+
const left = points[lo];
|
|
32477
|
+
const right = points[hi];
|
|
32478
|
+
const sqrt = tickToSqrtPriceX96(tick);
|
|
32479
|
+
const numerator = sqrt - left.sqrt;
|
|
32480
|
+
const denominator = right.sqrt - left.sqrt;
|
|
32481
|
+
return {
|
|
32482
|
+
value0: left.value0 + (right.value0 - left.value0) * numerator * right.sqrt / (denominator * sqrt),
|
|
32483
|
+
value1: left.value1 + (right.value1 - left.value1) * numerator / denominator
|
|
32484
|
+
};
|
|
32485
|
+
};
|
|
32486
|
+
}
|
|
32487
|
+
|
|
32244
32488
|
//#endregion
|
|
32245
32489
|
//#region src/panoptic/v2/react/cacheScopes.ts
|
|
32246
32490
|
/**
|
|
@@ -37714,5 +37958,5 @@ function useTxEventConfirmation({ txHash, poolAddress = zeroAddress, collateralT
|
|
|
37714
37958
|
}
|
|
37715
37959
|
|
|
37716
37960
|
//#endregion
|
|
37717
|
-
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, 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, 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, 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, minePoolAddress, mint, mintAndWait, mintableAfterBuffer, multicallRead, mutationEffects, openPosition, openPositionAndWait, optimizeTokenIdRiskPartners, oracleEpochAt, orderListForSettle, packMarketState, panopticLiquidatorAbi, panopticPoolV2Abi, panopticQueryAbi, parseBps, parseCollateralLog, parsePanopticError, parsePoolLog, parseTokenAmount, parseTokenListId, parseWad, planDeriveStrategy, pokeOracle, pokeOracleAndWait, prepareIndicatorCandles, preparePositionValue, 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 };
|
|
37961
|
+
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 };
|
|
37718
37962
|
//# sourceMappingURL=react-public.js.map
|