@panoptic-eng/sdk 1.0.62 → 1.0.64
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/README.md +1 -1
- package/dist/cow/index.d.ts +1 -1
- package/dist/cow/index.d.ts.map +1 -1
- package/dist/cow/index.js +1 -1
- package/dist/cow/index.js.map +1 -1
- package/dist/{cow-DTi3GjQz.js → cow-BIzmQHon.js} +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{irm-BDlcUNgJ.js → irm-BGog_tSR.js} +3 -3
- package/dist/panoptic/v2/index.d.ts +137 -135
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +52 -51
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.d.ts +144 -142
- package/dist/panoptic/v2/react-public.d.ts.map +1 -1
- package/dist/panoptic/v2/react-public.js +55 -54
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/providers-1WdiaRbY.js +54 -0
- package/dist/{rates-BwZnK0tG.js → rates-O6Sn-xqL.js} +3 -3
- package/dist/{router-Y1OxL9Nt.js → router-BuAvFpbu.js} +137 -10
- package/dist/{router-jMP7fVno.js → router-DHn0rNd7.js} +2 -2
- package/dist/rpc/index.d.ts +112 -0
- package/dist/rpc/index.d.ts.map +1 -0
- package/dist/rpc/index.js +242 -0
- package/dist/rpc/index.js.map +1 -0
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +1 -14
- package/dist/test/index.js.map +1 -1
- package/dist/uniswap/index.d.ts +311 -216
- package/dist/uniswap/index.d.ts.map +1 -1
- package/dist/uniswap/index.js +254 -21
- package/dist/uniswap/index.js.map +1 -1
- package/dist/{v2-B27ILZl4.js → v2-D2Bg1SeN.js} +19 -144
- package/dist/{writes-B8NGXzUG.js → writes-jz-N6C_4.js} +37 -37
- package/dist/zodiac/index.d.ts +3 -3
- package/dist/zodiac/index.d.ts.map +1 -1
- package/dist/zodiac/index.js +3 -3
- package/dist/zodiac/index.js.map +1 -1
- package/package.json +5 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { StateViewAbi, getAccountCollateral, panopticQueryAbi
|
|
2
|
-
import { AccountInsolventError, ChunkLimitError, DEFAULT_VEGOID, InvalidHistoryRangeError, MulticallResultMissingError, NotEnoughTokensError, PanopticError, PanopticValidationError, SafeModeError, StaleDataError, StorageDataNotFoundError, UnhealthyPoolError, WrongUniswapPoolError, applyMintBufferPerToken, availableToBorrow, collateralTrackerV2Abi, decodeLeftRightSigned, decodeLeftRightUnsigned, decodePositionBalance, getBlockMeta, getClosedPositionsKey, getPendingPositionsKey, getPool, getPoolMetaKey, getPoolMetadata, getPositionMetaKey, getPositionsKey, getTrackedChunksKey, getTrackedPositionIds, isPanopticErrorType, jsonSerializer, mintableAfterBuffer, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticGuardianAbi, panopticLiquidatorAbi, panopticPoolV2Abi, panopticQueryAbi
|
|
1
|
+
import { StateViewAbi, getAccountCollateral, panopticQueryAbi, readBlockAndAggregate, requireReturnData } from "./irm-BGog_tSR.js";
|
|
2
|
+
import { AccountInsolventError, ChunkLimitError, DEFAULT_VEGOID, InvalidHistoryRangeError, MulticallResultMissingError, NotEnoughTokensError, PanopticError, PanopticValidationError, SafeModeError, StaleDataError, StorageDataNotFoundError, UnhealthyPoolError, WrongUniswapPoolError, applyMintBufferPerToken, availableToBorrow, collateralTrackerV2Abi, decodeLeftRightSigned, decodeLeftRightUnsigned, decodePositionBalance, getBlockMeta, getClosedPositionsKey, getPendingPositionsKey, getPool, getPoolMetaKey, getPoolMetadata, getPositionMetaKey, getPositionsKey, getTrackedChunksKey, getTrackedPositionIds, isPanopticErrorType, jsonSerializer, mintableAfterBuffer, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticGuardianAbi, panopticLiquidatorAbi, panopticPoolV2Abi, panopticQueryAbi$1, parsePanopticError, riskEngineAbi, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi, stateViewAbi, uniswapV3PoolAbi } from "./rates-O6Sn-xqL.js";
|
|
3
3
|
import { MAX_TICK, MAX_TRACKED_CHUNKS, MIN_TICK, NO_LOWER_LIQUIDATION_TICK, NO_UPPER_LIQUIDATION_TICK, WAD, calculatePositionDelta, calculatePositionDeltaDebtOnly, calculatePositionGamma, calculatePositionValue, priceToTick, sqrtPriceX96ToTick, tickLimits, tickToPriceDecimalScaled, tickToSqrtPriceX96, toVaultFrameAtTick } from "./greeks-CNi1-cnp.js";
|
|
4
|
-
import { addLegToTokenId, buildBatchDispatchArgs, buildUniqueCredit, buildUniqueLoan, countLegs, createTokenIdBuilder, decodeAllLegs, decodeTokenId, getPoolTokensForSimulation, loadCheckpoint, resolveTokenIndex, simulateDispatch, simulateOpenPosition, simulateWithTokenFlow } from "./writes-
|
|
5
|
-
import { getLpPositionFunding, getMaxLpPositionSize } from "./router-
|
|
4
|
+
import { addLegToTokenId, buildBatchDispatchArgs, buildUniqueCredit, buildUniqueLoan, countLegs, createTokenIdBuilder, decodeAllLegs, decodeTokenId, getPoolTokensForSimulation, loadCheckpoint, resolveTokenIndex, simulateDispatch, simulateOpenPosition, simulateWithTokenFlow } from "./writes-jz-N6C_4.js";
|
|
5
|
+
import { getLpPositionFunding, getMaxLpPositionSize, preparePositionGamma } from "./router-BuAvFpbu.js";
|
|
6
6
|
import { BaseError, ContractFunctionExecutionError, ContractFunctionRevertedError, ExecutionRevertedError, decodeFunctionResult, encodeAbiParameters, encodeFunctionData, getAddress, hexToString, keccak256, parseAbi, parseEventLogs, toHex, trim, zeroAddress } from "viem";
|
|
7
7
|
import { multicall } from "viem/actions";
|
|
8
8
|
import Decimal from "decimal.js";
|
|
@@ -3264,10 +3264,10 @@ async function getSafeMode(params) {
|
|
|
3264
3264
|
//#endregion
|
|
3265
3265
|
//#region src/panoptic/v2/reads/queryUtils.ts
|
|
3266
3266
|
/**
|
|
3267
|
-
* Get portfolio value (NAV) without
|
|
3267
|
+
* Get portfolio value (NAV) without streamia.
|
|
3268
3268
|
*
|
|
3269
3269
|
* This calculates the net asset value of the portfolio based on Uniswap liquidity
|
|
3270
|
-
* at a given tick, excluding accumulated
|
|
3270
|
+
* at a given tick, excluding accumulated streamia. Useful for PnL tracking separate
|
|
3271
3271
|
* from liquidation value.
|
|
3272
3272
|
*
|
|
3273
3273
|
* ## Same-Block Guarantee
|
|
@@ -4534,7 +4534,7 @@ const MASK_128 = (1n << 128n) - 1n;
|
|
|
4534
4534
|
* Get historical streamia data for a position across multiple blocks.
|
|
4535
4535
|
*
|
|
4536
4536
|
* @param params - The parameters
|
|
4537
|
-
* @returns Snapshots of Panoptic
|
|
4537
|
+
* @returns Snapshots of Panoptic streamia and Uniswap fee deltas at each block
|
|
4538
4538
|
*/
|
|
4539
4539
|
async function getStreamiaHistory(params) {
|
|
4540
4540
|
const { client, panopticPoolAddress, account, tokenId, blockNumbers, legs, poolConfig, includeUniswapFees = true, settledEvents } = params;
|
|
@@ -4691,9 +4691,9 @@ async function readTokenText(client, blockNumber, calls) {
|
|
|
4691
4691
|
});
|
|
4692
4692
|
return asString.map((result, index) => {
|
|
4693
4693
|
if (result.status === "success") return result.result;
|
|
4694
|
-
const fallback = asBytes32[index];
|
|
4695
|
-
if (fallback.status !== "success") throw fallback.error;
|
|
4696
|
-
return hexToString(trim(fallback.result, { dir: "right" }));
|
|
4694
|
+
const fallback$1 = asBytes32[index];
|
|
4695
|
+
if (fallback$1.status !== "success") throw fallback$1.error;
|
|
4696
|
+
return hexToString(trim(fallback$1.result, { dir: "right" }));
|
|
4697
4697
|
});
|
|
4698
4698
|
}
|
|
4699
4699
|
/**
|
|
@@ -5350,17 +5350,17 @@ var EnrichmentCallError = class extends PanopticError {
|
|
|
5350
5350
|
}
|
|
5351
5351
|
};
|
|
5352
5352
|
/**
|
|
5353
|
-
* Fetch enrichment data (
|
|
5353
|
+
* Fetch enrichment data (streamia, portfolio values, collateral requirements) for a set of positions.
|
|
5354
5354
|
*
|
|
5355
5355
|
* Batches all needed contract reads into efficient multicalls:
|
|
5356
5356
|
* - **Open positions**: 3 calls per position in a single multicall at current block:
|
|
5357
|
-
* 1. `getFullPositionsData` →
|
|
5357
|
+
* 1. `getFullPositionsData` → streamia + collateral requirements
|
|
5358
5358
|
* 2. `getPortfolioValue` at currentTick → current portfolio value
|
|
5359
5359
|
* 3. `getPortfolioValue` at mintTick → portfolio value at mint
|
|
5360
5360
|
* - **Closed positions**: 2 calls per position at `burnBlockNumber - 1`:
|
|
5361
5361
|
* 1. `getPortfolioValue` at burnTick → portfolio value at close
|
|
5362
5362
|
* 2. `getPortfolioValue` at mintTick → portfolio value at mint
|
|
5363
|
-
* (
|
|
5363
|
+
* (streamia come from subgraph `burnPremium0/1`)
|
|
5364
5364
|
*
|
|
5365
5365
|
* ## Same-Block Guarantee
|
|
5366
5366
|
* Open position data is fetched at a single block number.
|
|
@@ -9871,7 +9871,7 @@ function netLiquidationValueInQuote(value0, value1, tick, isAssetToken0) {
|
|
|
9871
9871
|
const price = new Decimal("1.0001").pow(tick.toString());
|
|
9872
9872
|
return isAssetToken0 ? new Decimal(value1.toString()).plus(new Decimal(value0.toString()).mul(price)) : new Decimal(value0.toString()).plus(new Decimal(value1.toString()).div(price));
|
|
9873
9873
|
}
|
|
9874
|
-
/** Apply the accrued-
|
|
9874
|
+
/** Apply the accrued-streamia offset and optional asset collateral to a relative NLV curve. */
|
|
9875
9875
|
function marketPnlInQuote({ relativeValue, premium, assetBalance = 0n, price, baselinePrice }) {
|
|
9876
9876
|
return new Decimal(relativeValue).plus(premium).plus(new Decimal(assetBalance.toString()).mul(new Decimal(price).minus(baselinePrice)));
|
|
9877
9877
|
}
|
|
@@ -9903,131 +9903,6 @@ function marketRiskFromValues({ lower, current, upper }) {
|
|
|
9903
9903
|
};
|
|
9904
9904
|
}
|
|
9905
9905
|
|
|
9906
|
-
//#endregion
|
|
9907
|
-
//#region src/panoptic/v2/greeks/positionVolatility.ts
|
|
9908
|
-
const Precision = Decimal.clone({ precision: 80 });
|
|
9909
|
-
const Q96 = 1n << 96n;
|
|
9910
|
-
const YEAR_SECONDS = new Precision(31536e3);
|
|
9911
|
-
/** The premium-free position curve, expressed in one quote token's human units. */
|
|
9912
|
-
function preparePositionGamma({ tokenId, positionSize, quoteIsToken0, quoteDecimals }) {
|
|
9913
|
-
if (positionSize <= 0n || positionSize >= 1n << 128n) throw new RangeError("Invalid position size");
|
|
9914
|
-
if (!Number.isInteger(quoteDecimals) || quoteDecimals < 0 || quoteDecimals > 255) throw new RangeError("Invalid quote decimals");
|
|
9915
|
-
const decoded = decodeTokenId(tokenId);
|
|
9916
|
-
const chunks = decoded.legs.flatMap((leg) => {
|
|
9917
|
-
if (leg.width === 0n) return [];
|
|
9918
|
-
const width = leg.width * decoded.tickSpacing;
|
|
9919
|
-
const lowerTick = leg.strike - width / 2n;
|
|
9920
|
-
const upperTick = leg.strike + (width + 1n) / 2n;
|
|
9921
|
-
if (lowerTick < -887272n || upperTick > 887272n || lowerTick >= upperTick) throw new RangeError("Invalid position range");
|
|
9922
|
-
const lower = tickToSqrtPriceX96(lowerTick);
|
|
9923
|
-
const upper = tickToSqrtPriceX96(upperTick);
|
|
9924
|
-
const amount = positionSize * leg.optionRatio;
|
|
9925
|
-
const liquidity = leg.asset === 0n ? amount * (lower * upper / Q96) / (upper - lower) : amount * Q96 / (upper - lower);
|
|
9926
|
-
if (liquidity >= 1n << 128n) throw new RangeError("Liquidity exceeds uint128");
|
|
9927
|
-
return [{
|
|
9928
|
-
lowerTick: Number(lowerTick),
|
|
9929
|
-
upperTick: Number(upperTick),
|
|
9930
|
-
liquidity,
|
|
9931
|
-
isLong: leg.isLong
|
|
9932
|
-
}];
|
|
9933
|
-
});
|
|
9934
|
-
const scale = new Precision(10).pow(quoteDecimals);
|
|
9935
|
-
const atTick = (tick) => {
|
|
9936
|
-
const netLiquidity = chunks.reduce((sum$1, chunk) => tick >= BigInt(chunk.lowerTick) && tick < BigInt(chunk.upperTick) ? sum$1 + (chunk.isLong ? -chunk.liquidity : chunk.liquidity) : sum$1, 0n);
|
|
9937
|
-
const sqrt = new Precision(tickToSqrtPriceX96(tick).toString()).div(Q96.toString());
|
|
9938
|
-
const gamma = new Precision(netLiquidity.toString()).neg().div(2).div(scale);
|
|
9939
|
-
return quoteIsToken0 ? gamma.div(sqrt) : gamma.mul(sqrt);
|
|
9940
|
-
};
|
|
9941
|
-
const inRange = (low, high) => {
|
|
9942
|
-
if (low > high) throw new RangeError("Invalid candle range");
|
|
9943
|
-
const ticks = new Set([low, high]);
|
|
9944
|
-
for (const chunk of chunks) for (const boundary of [BigInt(chunk.lowerTick), BigInt(chunk.upperTick)]) {
|
|
9945
|
-
if (boundary >= low && boundary <= high) ticks.add(boundary);
|
|
9946
|
-
if (boundary - 1n >= low && boundary - 1n <= high) ticks.add(boundary - 1n);
|
|
9947
|
-
}
|
|
9948
|
-
return [...ticks].map(atTick);
|
|
9949
|
-
};
|
|
9950
|
-
return {
|
|
9951
|
-
chunks,
|
|
9952
|
-
atTick,
|
|
9953
|
-
inRange
|
|
9954
|
-
};
|
|
9955
|
-
}
|
|
9956
|
-
/** Historical whole-position diagnostics, with signs retained independently of eligibility. */
|
|
9957
|
-
function calculatePositionVolatilityMetrics({ observations, netPremium, baseFees, quoteDecimals }) {
|
|
9958
|
-
if (observations.length < 2) throw new RangeError("At least two price observations are required");
|
|
9959
|
-
if (!Number.isInteger(quoteDecimals) || quoteDecimals < 0 || quoteDecimals > 255) throw new RangeError("Invalid quote decimals");
|
|
9960
|
-
const points = observations.map((point) => ({
|
|
9961
|
-
...point,
|
|
9962
|
-
price: new Precision(point.price),
|
|
9963
|
-
gamma: new Precision(point.gamma),
|
|
9964
|
-
rangeGammas: (point.rangeGammas ?? []).map((gamma) => new Precision(gamma))
|
|
9965
|
-
}));
|
|
9966
|
-
for (const point of points) if (!point.price.isFinite() || point.price.lte(0) || !point.gamma.isFinite() || point.rangeGammas.some((gamma) => !gamma.isFinite())) throw new RangeError("Invalid price or gamma observation");
|
|
9967
|
-
const quantum = new Precision(10).pow(-quoteDecimals);
|
|
9968
|
-
const gammas = points.flatMap((point) => [point.gamma, ...point.rangeGammas]);
|
|
9969
|
-
const peak = gammas.reduce((max, gamma) => Precision.max(max, gamma.abs()), new Precision(0));
|
|
9970
|
-
const tolerance = Precision.max(quantum, peak.mul("1e-12"));
|
|
9971
|
-
const positive = gammas.some((gamma) => gamma.gt(tolerance));
|
|
9972
|
-
const negative = gammas.some((gamma) => gamma.lt(tolerance.neg()));
|
|
9973
|
-
const gammaSign = positive && negative ? "changing" : positive ? "positive" : negative ? "negative" : "zero";
|
|
9974
|
-
let exposure = new Precision(0);
|
|
9975
|
-
let signedConvexity = new Precision(0);
|
|
9976
|
-
let absoluteConvexity = new Precision(0);
|
|
9977
|
-
let years = new Precision(0);
|
|
9978
|
-
for (let i = 1; i < points.length; i++) {
|
|
9979
|
-
const previous = points[i - 1];
|
|
9980
|
-
const point = points[i];
|
|
9981
|
-
const seconds = point.timestamp - previous.timestamp;
|
|
9982
|
-
if (seconds <= 0n) throw new RangeError("Observations must have increasing timestamps");
|
|
9983
|
-
const elapsed = new Precision(seconds.toString()).div(YEAR_SECONDS);
|
|
9984
|
-
const squaredReturn = point.price.div(previous.price).ln().pow(2);
|
|
9985
|
-
exposure = exposure.plus(previous.gamma.abs().mul(elapsed));
|
|
9986
|
-
signedConvexity = signedConvexity.plus(previous.gamma.mul(squaredReturn).div(2));
|
|
9987
|
-
absoluteConvexity = absoluteConvexity.plus(previous.gamma.abs().mul(squaredReturn).div(2));
|
|
9988
|
-
years = years.plus(elapsed);
|
|
9989
|
-
}
|
|
9990
|
-
const sufficientExposure = exposure.gt(tolerance.mul(years).mul(100));
|
|
9991
|
-
const premium = netPremium === null ? null : new Precision(netPremium);
|
|
9992
|
-
const fees = baseFees == null ? null : new Precision(baseFees);
|
|
9993
|
-
if (premium !== null && !premium.isFinite() || fees !== null && !fees.isFinite()) throw new RangeError("Invalid accounting amount");
|
|
9994
|
-
const consistent = (amount) => gammaSign === "positive" ? amount.lte(quantum) : gammaSign === "negative" && amount.gte(quantum.neg());
|
|
9995
|
-
const reason = !sufficientExposure ? "insufficient-exposure" : gammaSign === "changing" ? "changing-sign" : premium === null ? "premium-unavailable" : !consistent(premium) ? "inconsistent-premium-direction" : null;
|
|
9996
|
-
const equivalent = (amount) => amount.abs().mul(2).div(exposure).sqrt().toString();
|
|
9997
|
-
const coverage = (amount) => absoluteConvexity.gt(quantum) ? amount.abs().div(absoluteConvexity).toString() : null;
|
|
9998
|
-
const eligibleFees = sufficientExposure && fees !== null && consistent(fees);
|
|
9999
|
-
return {
|
|
10000
|
-
gammaSign,
|
|
10001
|
-
exposure: exposure.toString(),
|
|
10002
|
-
signedConvexity: signedConvexity.toString(),
|
|
10003
|
-
absoluteConvexity: absoluteConvexity.toString(),
|
|
10004
|
-
netPremium: premium?.toString() ?? null,
|
|
10005
|
-
estimatedHedgedResult: premium?.plus(signedConvexity).toString() ?? null,
|
|
10006
|
-
weightedRealizedVolatility: sufficientExposure ? equivalent(absoluteConvexity) : null,
|
|
10007
|
-
premiumEquivalentVolatility: reason === null && premium !== null ? equivalent(premium) : null,
|
|
10008
|
-
premiumToConvexity: reason === null && premium !== null ? coverage(premium) : null,
|
|
10009
|
-
baseFees: fees?.toString() ?? null,
|
|
10010
|
-
feeEquivalentVolatility: eligibleFees ? equivalent(fees) : null,
|
|
10011
|
-
feeToConvexity: eligibleFees ? coverage(fees) : null,
|
|
10012
|
-
comparisonReason: reason
|
|
10013
|
-
};
|
|
10014
|
-
}
|
|
10015
|
-
/** Quote-value signed cumulative token increments, excluding revaluation of previous accrual. */
|
|
10016
|
-
function valuePositionAccrual({ snapshots, quoteIsToken0, quoteDecimals }) {
|
|
10017
|
-
let previous0 = 0n;
|
|
10018
|
-
let previous1 = 0n;
|
|
10019
|
-
let total = new Precision(0);
|
|
10020
|
-
for (const snapshot of snapshots) {
|
|
10021
|
-
const amount0 = new Precision((snapshot.token0 - previous0).toString());
|
|
10022
|
-
const amount1 = new Precision((snapshot.token1 - previous1).toString());
|
|
10023
|
-
const price = new Precision("1.0001").pow(snapshot.tick.toString());
|
|
10024
|
-
total = total.plus(quoteIsToken0 ? amount0.plus(amount1.div(price)) : amount1.plus(amount0.mul(price)));
|
|
10025
|
-
previous0 = snapshot.token0;
|
|
10026
|
-
previous1 = snapshot.token1;
|
|
10027
|
-
}
|
|
10028
|
-
return total.div(new Precision(10).pow(quoteDecimals));
|
|
10029
|
-
}
|
|
10030
|
-
|
|
10031
9906
|
//#endregion
|
|
10032
9907
|
//#region src/panoptic/v2/reads/collateralCurve.ts
|
|
10033
9908
|
/** Native-token margin inputs, independent of the tick used to display the curve. */
|
|
@@ -10145,7 +10020,7 @@ async function getCollateralCurve({ client, poolAddress, account, queryAddress,
|
|
|
10145
10020
|
//#endregion
|
|
10146
10021
|
//#region src/panoptic/v2/reads/positionValueCurve.ts
|
|
10147
10022
|
const abi = parseAbi(["function computeNetLiquidationValue(uint256[] positionIdList, uint256 shortPremium, uint256 longPremium, uint256[] positionBalanceArray, int24[] atTicks) pure returns (int256[] value0, int256[] value1)"]);
|
|
10148
|
-
/** Stable identity for a position-dependent curve;
|
|
10023
|
+
/** Stable identity for a position-dependent curve; streamia and spot are separate inputs. */
|
|
10149
10024
|
function positionValueKey(positions) {
|
|
10150
10025
|
return [...positions].sort((a, b) => a.tokenId < b.tokenId ? -1 : a.tokenId > b.tokenId ? 1 : 0).map(({ tokenId, positionSize }) => `${tokenId}:${positionSize}`).join(",");
|
|
10151
10026
|
}
|
|
@@ -10331,7 +10206,7 @@ async function getPositionVolatilityHistory({ client, poolAddress, account, toke
|
|
|
10331
10206
|
logs: receipt.logs.filter((log) => log.address.toLowerCase() === poolAddress.toLowerCase()),
|
|
10332
10207
|
eventName: "AccountLiquidated"
|
|
10333
10208
|
});
|
|
10334
|
-
if (liquidations.some((event) => event.args.liquidatee.toLowerCase() === account.toLowerCase())) throw new Error("Liquidation
|
|
10209
|
+
if (liquidations.some((event) => event.args.liquidatee.toLowerCase() === account.toLowerCase())) throw new Error("Liquidation streamia requires haircut reconciliation");
|
|
10335
10210
|
for (const packed of close.args.premiaByLeg) {
|
|
10336
10211
|
const amounts = unpack(packed);
|
|
10337
10212
|
settled.push({
|
|
@@ -10376,7 +10251,7 @@ async function getPositionVolatilityHistory({ client, poolAddress, account, toke
|
|
|
10376
10251
|
})
|
|
10377
10252
|
});
|
|
10378
10253
|
const openingAccrual = premium[0];
|
|
10379
|
-
if (!openingAccrual || openingAccrual.timestamp !== start.blockTimestamp) throw new Error("Opening
|
|
10254
|
+
if (!openingAccrual || openingAccrual.timestamp !== start.blockTimestamp) throw new Error("Opening streamia snapshot missing");
|
|
10380
10255
|
premium = premium.map((snapshot) => ({
|
|
10381
10256
|
timestamp: snapshot.timestamp,
|
|
10382
10257
|
token0: snapshot.token0 - openingAccrual.token0,
|
|
@@ -10384,7 +10259,7 @@ async function getPositionVolatilityHistory({ client, poolAddress, account, toke
|
|
|
10384
10259
|
}));
|
|
10385
10260
|
} catch (error) {
|
|
10386
10261
|
premium = null;
|
|
10387
|
-
premiumError = error instanceof Error ? error.message : "
|
|
10262
|
+
premiumError = error instanceof Error ? error.message : "Streamia history unavailable";
|
|
10388
10263
|
}
|
|
10389
10264
|
if (includeBaseFees) try {
|
|
10390
10265
|
const feeBlocks = close ? blockNumbers.filter((block) => block < finalBlock) : blockNumbers;
|
|
@@ -10436,4 +10311,4 @@ async function getPositionVolatilityHistory({ client, poolAddress, account, toke
|
|
|
10436
10311
|
}
|
|
10437
10312
|
|
|
10438
10313
|
//#endregion
|
|
10439
|
-
export { DEFAULT_MIN_SWAP_RATIO_BPS, DEFAULT_RECONNECT_CONFIG, MARKET_INDICATOR_PERIODS, REQUIRED_BASE_ERROR_SENTINEL, STRIKE_LADDER_TARGET_STRIKES, VARIANCE_RATIO_LAG, addPendingPosition, addTrackedChunks, apportion, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertLpPositionFunded, assertTradeable, buildCreditWrappedDispatch, buildSfpmSwapCalldata, buildSfpmSwapPlan, buildTemporaryLoanRecoveryDispatch, buildTokenShortfallRecoveryDispatch, calculateAccountGreeksPure, calculateMarketIndicator,
|
|
10314
|
+
export { DEFAULT_MIN_SWAP_RATIO_BPS, DEFAULT_RECONNECT_CONFIG, MARKET_INDICATOR_PERIODS, REQUIRED_BASE_ERROR_SENTINEL, STRIKE_LADDER_TARGET_STRIKES, VARIANCE_RATIO_LAG, addPendingPosition, addTrackedChunks, apportion, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertLpPositionFunded, assertTradeable, buildCreditWrappedDispatch, buildSfpmSwapCalldata, buildSfpmSwapPlan, buildTemporaryLoanRecoveryDispatch, buildTokenShortfallRecoveryDispatch, calculateAccountGreeksPure, calculateMarketIndicator, calculateSpreadWad, calculateVarianceProfile, checkCollateralAcrossTicks, classifyStrategyGroups, classifyStrike, cleanupStalePendingPositions, clearPendingPositions, clearTrackedChunks, clearTradeHistory, collateralCurveTicks, collateralRuleKindFor, computeV4PoolId, confirmPendingPosition, convertToAssets, convertToShares, createEventPoller, createEventSubscription, createFlowNeutralTokenId, decodePanopticTokenURI, emptyLiquidateParams, encodePoolKeyBytes, encodeV3PoolKeyBytes, ensureSfpmV3PoolInitialized, estimateBlockNumbers, estimateCollateralBreakdown, estimateCollateralRequired, failPendingPosition, feeGrowthInsideX128, feesFromFeeGrowthDelta, fetchSfpmV3PoolId, fetchUniswapFeeData, getAccountBuyingPower, getAccountGreeks, getAccountHistory, getChunkLiquidities, getChunkSpreads, getClosedPositions, getCollateralCurve, getCollateralCurveInputs, getCollateralRequiredBase, getCollateralSharePrices, getCollateralTotalAssetsBatch, getDeltaHedgeParams, getEnforcedTickLimits, getExecutableLpMaxSize, getFactoryConstructMetadata, getFactoryOwnerOf, getFactoryTokenURI, getGuardianUnlockState, getHedgeLimits, getItmAmounts, getMarginBuffer, getMaxPositionSize, getMaxRedeem, getMaxWithdrawable, getNativeTokenPrice, getNotEnoughTokensError, getOpenPositionPreview, getPanopticPoolAddress, getPanopticPoolFromPoolId, getPendingPositions, getPoolCollateralAddresses, getPoolLiquidities, getPortfolioValue, getPositionChunkData, getPositionEnrichmentData, getPositionValueCurve, getPositionVolatilityHistory, getPriceHistory, getRealizedPnL, getRequiredCreditForITM, getSafeMode, getStreamiaHistory, getSyncStatus, getTrackedChunks, getTradeHistory, getUniswapFeeHistory, getUniswapV3LpPositionState, getUniswapV3PoolFromId, getUniswapV3PoolInfo, getUniswapV3PoolLiquidities, getUniswapV4LpPositionState, getUniswapV4PoolBasicState, getUniswapV4PoolInfo, getUniswapV4PoolKeyFromId, getUniswapV4PoolLiquidities, interpolateBlocks, isGasError, isNonceError, isRetryableRpcError, isolateGroupTokenId, ladderStrikeSequence, logReturns, marketPnlInQuote, marketRiskFromValues, marketScenario, minePoolAddress, minePoolAddressLocalAsync, multicallRead, netLiquidationValueInQuote, optimizeTokenIdRiskPartners, parseCollateralLog, parsePoolLog, positionValueKey, positionValueTicks, prepareIndicatorCandles, preparePositionValueCurve, previewDeposit, previewMint, previewRedeem, previewWithdraw, quoteLiquidation, quoteOneTokenFlow, quoteSfpmSwap, quoteTemporaryLoanRecovery, quoteTokenShortfallRecovery, realizedBeta, removeTrackedChunks, resolveBlockNumbers, resolveLadderStrike, resolvePanopticPoolFromPoolId, resolveUniswapV4PoolKey, saveClosedPosition, scaleCollateralRequired, scanChunks, screenAccountExact, simulateBatchDispatch, simulateClosePosition, simulateDeployNewPool, simulateDeposit, simulateForceExercise, simulateLiquidate, simulateSFPMBurn, simulateSFPMMint, simulateSwapExactIn, simulateSwapExactOut, simulateWithdraw, slippageBpsToTickDistance, watchEvents };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchValidationError, DEFAULT_VEGOID, InputListFailError, InvalidTickLimitsError, InvalidTokenIdParameterError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LoanSlotExhaustedError, MaxRetriesExceededError, MissingPositionIdsError, NoLoanPositionsError, OracleRateLimitedError, PanopticError, PanopticValidationError, PositionSnapshotNotFoundError, ProviderLagError, STANDARD_TICK_WIDTHS, STRIKE_CONVERSION_FACTOR, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, UnsafePremiumSettlementError, collateralTrackerV2Abi, createTxResult, decodeLeftRightUnsigned, decodeOracleTiming, decodePosition, decodeTickSpacing
|
|
1
|
+
import { BatchValidationError, DEFAULT_VEGOID, InputListFailError, InvalidTickLimitsError, InvalidTokenIdParameterError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LoanSlotExhaustedError, MaxRetriesExceededError, MissingPositionIdsError, NoLoanPositionsError, OracleRateLimitedError, PanopticError, PanopticValidationError, PositionSnapshotNotFoundError, ProviderLagError, STANDARD_TICK_WIDTHS, STRIKE_CONVERSION_FACTOR, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, UnsafePremiumSettlementError, collateralTrackerV2Abi, createTxResult, decodeLeftRightUnsigned, decodeOracleTiming, decodePosition, decodeTickSpacing, formatTokenAmount, getBlockMeta, getOpenPositionIds, getPool, getPoolMetaKey, getPoolMetadata, getPositionMetaKey, getPositions, getPositionsKey, getSyncCheckpointKey, getTrackedPositionIds, jsonSerializer, oracleEpochAt, panopticErrorsAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticPoolV2Abi, parsePanopticError, parseTokenAmount, submitWrite } from "./rates-O6Sn-xqL.js";
|
|
2
2
|
import { MAX_TICK, MIN_TICK, REORG_DEPTH, calculatePositionGreeks, priceToTick, roundToTickSpacing, sqrtPriceX96ToTick, tickLimits, tickToPrice, tickToPriceDecimalScaled, tickToSqrtPriceX96 } from "./greeks-CNi1-cnp.js";
|
|
3
3
|
import { decodeFunctionResult, encodeFunctionData, erc20Abi, getAbiItem } from "viem";
|
|
4
4
|
|
|
@@ -1386,7 +1386,7 @@ async function forceExerciseAndWait(params) {
|
|
|
1386
1386
|
* Reorder a position ID list so `tokenId` is the last element.
|
|
1387
1387
|
*
|
|
1388
1388
|
* The position list fingerprint is an XOR hash, so ordering is free to change.
|
|
1389
|
-
* The contract settles
|
|
1389
|
+
* The contract settles streamia on the last element of `positionIdListTo`.
|
|
1390
1390
|
*
|
|
1391
1391
|
* @throws PanopticError if `tokenId` is not in the list
|
|
1392
1392
|
*/
|
|
@@ -1395,15 +1395,15 @@ function orderListForSettle(positionIdList, tokenId) {
|
|
|
1395
1395
|
return [...positionIdList.filter((id) => id !== tokenId), tokenId];
|
|
1396
1396
|
}
|
|
1397
1397
|
/**
|
|
1398
|
-
* Settle another account's accumulated long
|
|
1398
|
+
* Settle another account's accumulated long streamia.
|
|
1399
1399
|
*
|
|
1400
1400
|
* Calls `dispatchFrom` with the target's position list passed as both
|
|
1401
1401
|
* `positionIdListTo` and `positionIdListToFinal` (equal lengths select the
|
|
1402
|
-
* settle-
|
|
1403
|
-
* target account to be solvent; the settled
|
|
1402
|
+
* settle-streamia mode and cannot force-exercise or liquidate). Requires the
|
|
1403
|
+
* target account to be solvent; the settled streamia is credited to the
|
|
1404
1404
|
* sellers of the corresponding chunks.
|
|
1405
1405
|
*
|
|
1406
|
-
* @param params - Settle
|
|
1406
|
+
* @param params - Settle streamia parameters
|
|
1407
1407
|
* @returns TxResult
|
|
1408
1408
|
*
|
|
1409
1409
|
* @example
|
|
@@ -1441,7 +1441,7 @@ async function settlePremiumFrom(params) {
|
|
|
1441
1441
|
});
|
|
1442
1442
|
}
|
|
1443
1443
|
/**
|
|
1444
|
-
* Settle another account's
|
|
1444
|
+
* Settle another account's streamia and wait for confirmation.
|
|
1445
1445
|
*
|
|
1446
1446
|
* When `storage` and `chainId` are provided, automatically syncs the
|
|
1447
1447
|
* caller's positions after the transaction confirms.
|
|
@@ -1531,7 +1531,7 @@ function buildSettleSequenceCalls(params) {
|
|
|
1531
1531
|
return calls;
|
|
1532
1532
|
}
|
|
1533
1533
|
/**
|
|
1534
|
-
* Execute a settle sequence: settle each target buyer's owed long
|
|
1534
|
+
* Execute a settle sequence: settle each target buyer's owed long streamia,
|
|
1535
1535
|
* then optionally close the caller's own position, in one multicall.
|
|
1536
1536
|
*
|
|
1537
1537
|
* @param params - Settle sequence parameters
|
|
@@ -1711,7 +1711,7 @@ function formatRatioPercent(numerator, denominator, precision) {
|
|
|
1711
1711
|
* // Now use without passing decimals each time
|
|
1712
1712
|
* const priceStr = fmt.tickToPriceScaled(position.currentTick, 4n)
|
|
1713
1713
|
* const amount0Str = fmt.formatAmount0(collateral.assets, 4n)
|
|
1714
|
-
* const amount1Str = fmt.formatAmount1(
|
|
1714
|
+
* const amount1Str = fmt.formatAmount1(streamia.token1, 2n)
|
|
1715
1715
|
*
|
|
1716
1716
|
* // Parse user input
|
|
1717
1717
|
* const rawAmount0 = fmt.parseAmount0("1.5")
|
|
@@ -3218,18 +3218,18 @@ async function getCurrentPositionSizes(params) {
|
|
|
3218
3218
|
//#endregion
|
|
3219
3219
|
//#region src/panoptic/v2/reads/premia.ts
|
|
3220
3220
|
/**
|
|
3221
|
-
* Get
|
|
3221
|
+
* Get streamia totals for an account.
|
|
3222
3222
|
*
|
|
3223
|
-
* Returns the total short and long
|
|
3224
|
-
* Short
|
|
3225
|
-
* Long
|
|
3223
|
+
* Returns the total short and long streamia across all positions.
|
|
3224
|
+
* Short streamia is owed TO the account (earned from selling options).
|
|
3225
|
+
* Long streamia is owed BY the account (paid for buying options).
|
|
3226
3226
|
*
|
|
3227
3227
|
* @param params - The parameters
|
|
3228
|
-
* @returns
|
|
3228
|
+
* @returns Streamia totals with block metadata
|
|
3229
3229
|
*
|
|
3230
3230
|
* @example
|
|
3231
3231
|
* ```typescript
|
|
3232
|
-
* const
|
|
3232
|
+
* const streamia = await getAccountPremia({
|
|
3233
3233
|
* client,
|
|
3234
3234
|
* poolAddress,
|
|
3235
3235
|
* account,
|
|
@@ -3237,8 +3237,8 @@ async function getCurrentPositionSizes(params) {
|
|
|
3237
3237
|
* includePendingPremium: true,
|
|
3238
3238
|
* })
|
|
3239
3239
|
*
|
|
3240
|
-
* console.log('Short
|
|
3241
|
-
* console.log('Long
|
|
3240
|
+
* console.log('Short streamia earned:', streamia.shortPremium0, streamia.shortPremium1)
|
|
3241
|
+
* console.log('Long streamia owed:', streamia.longPremium0, streamia.longPremium1)
|
|
3242
3242
|
* ```
|
|
3243
3243
|
*/
|
|
3244
3244
|
async function getAccountPremia(params) {
|
|
@@ -3284,13 +3284,13 @@ async function getAccountPremia(params) {
|
|
|
3284
3284
|
};
|
|
3285
3285
|
}
|
|
3286
3286
|
/**
|
|
3287
|
-
* Get positions with per-position
|
|
3287
|
+
* Get positions with per-position streamia data.
|
|
3288
3288
|
*
|
|
3289
3289
|
* Uses multicall to batch individual getFullPositionsData calls
|
|
3290
|
-
* for each position, giving us per-position
|
|
3290
|
+
* for each position, giving us per-position streamia in a single RPC request.
|
|
3291
3291
|
*
|
|
3292
3292
|
* @param params - The parameters
|
|
3293
|
-
* @returns Positions with
|
|
3293
|
+
* @returns Positions with streamia and totals with block metadata
|
|
3294
3294
|
*
|
|
3295
3295
|
* @example
|
|
3296
3296
|
* ```typescript
|
|
@@ -3303,9 +3303,9 @@ async function getAccountPremia(params) {
|
|
|
3303
3303
|
*
|
|
3304
3304
|
* for (const position of result.positions) {
|
|
3305
3305
|
* console.log('Position:', position.tokenId)
|
|
3306
|
-
* console.log('
|
|
3306
|
+
* console.log('Streamia:', position.premiaOwed0, position.premiaOwed1)
|
|
3307
3307
|
* }
|
|
3308
|
-
* console.log('Total short
|
|
3308
|
+
* console.log('Total short streamia:', result.shortPremium0, result.shortPremium1)
|
|
3309
3309
|
* ```
|
|
3310
3310
|
*/
|
|
3311
3311
|
async function getPositionsWithPremia(params) {
|
|
@@ -3422,17 +3422,17 @@ async function getPositionsWithPremia(params) {
|
|
|
3422
3422
|
};
|
|
3423
3423
|
}
|
|
3424
3424
|
/**
|
|
3425
|
-
* Get the unsettled short
|
|
3425
|
+
* Get the unsettled short streamia an account would forfeit by closing now.
|
|
3426
3426
|
*
|
|
3427
3427
|
* Calls `getFullPositionsData` twice in one multicall — once with
|
|
3428
3428
|
* `includePendingPremium = true` (everything owed to the short legs) and once
|
|
3429
3429
|
* with `false` (only what is available to collect). The difference is the
|
|
3430
|
-
*
|
|
3430
|
+
* streamia still owed by buyers that has not been settled; closing before it
|
|
3431
3431
|
* settles forfeits it. Settling buyers first (see `settlePremiumFrom`) moves
|
|
3432
|
-
* that
|
|
3432
|
+
* that streamia into the available bucket.
|
|
3433
3433
|
*
|
|
3434
3434
|
* @param params - The parameters
|
|
3435
|
-
* @returns Owed, available, and forfeitable
|
|
3435
|
+
* @returns Owed, available, and forfeitable streamia with block metadata
|
|
3436
3436
|
*/
|
|
3437
3437
|
async function getForfeitablePremium(params) {
|
|
3438
3438
|
const { client, poolAddress, account, tokenIds, blockNumber } = params;
|
|
@@ -3706,11 +3706,11 @@ async function getPoolTokensForSimulation(params) {
|
|
|
3706
3706
|
|
|
3707
3707
|
//#endregion
|
|
3708
3708
|
//#region src/panoptic/v2/simulations/simulateSettlePremiumFrom.ts
|
|
3709
|
-
/** Soft-failure revert markers for settle
|
|
3709
|
+
/** Soft-failure revert markers for settle streamia (target-state issues, not caller errors). */
|
|
3710
3710
|
const SOFT_FAILURES = [
|
|
3711
3711
|
{
|
|
3712
3712
|
marker: "AccountInsolvent",
|
|
3713
|
-
reason: "Target account is insolvent;
|
|
3713
|
+
reason: "Target account is insolvent; streamia cannot be settled"
|
|
3714
3714
|
},
|
|
3715
3715
|
{
|
|
3716
3716
|
marker: "PositionNotOwned",
|
|
@@ -3726,14 +3726,14 @@ const SOFT_FAILURES = [
|
|
|
3726
3726
|
}
|
|
3727
3727
|
];
|
|
3728
3728
|
/**
|
|
3729
|
-
* Simulate settling another account's accumulated long
|
|
3729
|
+
* Simulate settling another account's accumulated long streamia via `dispatchFrom`
|
|
3730
3730
|
* (equal-length `positionIdListTo`/`positionIdListToFinal` selects the settle mode).
|
|
3731
3731
|
*
|
|
3732
|
-
* The measured token flow is the CALLER's collateral delta — i.e. the
|
|
3732
|
+
* The measured token flow is the CALLER's collateral delta — i.e. the streamia
|
|
3733
3733
|
* the caller receives from the settlement (for chunks they sold).
|
|
3734
3734
|
*
|
|
3735
3735
|
* @param params - Simulation parameters
|
|
3736
|
-
* @returns Simulation result with settled
|
|
3736
|
+
* @returns Simulation result with settled streamia data or error
|
|
3737
3737
|
*/
|
|
3738
3738
|
async function simulateSettlePremiumFrom(params) {
|
|
3739
3739
|
const { client, poolAddress, account, user, positionIdListFrom, positionIdList, tokenId, blockNumber } = params;
|
|
@@ -3891,14 +3891,14 @@ async function simulateSettlePremiumFrom(params) {
|
|
|
3891
3891
|
//#endregion
|
|
3892
3892
|
//#region src/panoptic/v2/simulations/simulateSettlePremiumBatch.ts
|
|
3893
3893
|
/**
|
|
3894
|
-
* Simulate settling each target buyer's owed long
|
|
3894
|
+
* Simulate settling each target buyer's owed long streamia, all at one block.
|
|
3895
3895
|
*
|
|
3896
3896
|
* Individual failures (insolvent buyer, stale list, …) are soft: the target
|
|
3897
3897
|
* lands in the unsettleable partition instead of failing the batch. Only
|
|
3898
3898
|
* unexpected errors reject.
|
|
3899
3899
|
*
|
|
3900
3900
|
* @param params - Simulation parameters
|
|
3901
|
-
* @returns Partitioned targets with per-target
|
|
3901
|
+
* @returns Partitioned targets with per-target streamia and totals
|
|
3902
3902
|
*/
|
|
3903
3903
|
async function simulateSettlePremiumBatch(params) {
|
|
3904
3904
|
const { client, poolAddress, account, positionIdListFrom, targets, blockNumber } = params;
|
|
@@ -4189,9 +4189,9 @@ async function simulateSettle(params) {
|
|
|
4189
4189
|
//#endregion
|
|
4190
4190
|
//#region src/panoptic/v2/writes/settle.ts
|
|
4191
4191
|
/**
|
|
4192
|
-
* Settle accumulated
|
|
4192
|
+
* Settle accumulated streamia on existing positions.
|
|
4193
4193
|
*
|
|
4194
|
-
* This function triggers
|
|
4194
|
+
* This function triggers streamia collection without changing position size.
|
|
4195
4195
|
* It calls dispatch with unchanged position lists.
|
|
4196
4196
|
*
|
|
4197
4197
|
* @param params - Settlement parameters
|
|
@@ -4274,7 +4274,7 @@ async function settleAccumulatedPremia(params) {
|
|
|
4274
4274
|
});
|
|
4275
4275
|
}
|
|
4276
4276
|
/**
|
|
4277
|
-
* Settle
|
|
4277
|
+
* Settle streamia and wait for confirmation.
|
|
4278
4278
|
*/
|
|
4279
4279
|
async function settleAccumulatedPremiaAndWait(params) {
|
|
4280
4280
|
const result = await settleAccumulatedPremia(params);
|
|
@@ -5937,4 +5937,4 @@ async function smartRepayAndWait(params) {
|
|
|
5937
5937
|
}
|
|
5938
5938
|
|
|
5939
5939
|
//#endregion
|
|
5940
|
-
export { addLegToTokenId, approve, approveAndWait, approvePool, borrow, borrowAndWait, buildBatchDispatchArgs, buildCreditSwapCall, buildOpenPositionCalldata, buildProtectedSettleDispatch, buildProtectedSettlePlan, buildSettleSequenceCalls, buildUniqueCredit, buildUniqueLoan, buildUniqueWidthZeroLeg, calculateResyncBlock, cancelTransaction, checkApproval, clearCheckpoint, closePosition, closePositionAndWait, countLegs, createNonceManager, createPoolFormatters, createTokenIdBuilder, decodeAllLegs, decodeLeg, decodePoolId, decodeTickSpacing$1
|
|
5940
|
+
export { addLegToTokenId, approve, approveAndWait, approvePool, borrow, borrowAndWait, buildBatchDispatchArgs, buildCreditSwapCall, buildOpenPositionCalldata, buildProtectedSettleDispatch, buildProtectedSettlePlan, buildSettleSequenceCalls, buildUniqueCredit, buildUniqueLoan, buildUniqueWidthZeroLeg, calculateResyncBlock, cancelTransaction, checkApproval, clearCheckpoint, closePosition, closePositionAndWait, countLegs, createNonceManager, createPoolFormatters, createTokenIdBuilder, decodeAllLegs, decodeLeg, decodePoolId, decodeTickSpacing$1, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, deriveUniqueTokenId, detectReorg, dispatch, dispatchAndWait, encodeLeg, encodePoolId, encodeV4PoolId, executeBatchDispatch, executeBatchDispatchAndWait, executeSettleSequence, executeSettleSequenceAndWait, forceExercise, forceExerciseAndWait, formatBlockNumber, formatBps, formatCompact, formatDatetime, formatDuration, formatDurationSeconds, formatFeeTier, formatGas, formatGwei, formatPoolIdHex, formatRatioPercent, formatTimestamp, formatTimestampLocale, formatTokenIdHex, formatTokenIdShort, formatTxHash, formatUtilization, formatWei, generateOverlappingTokenIds, getAccountPremia, getAssetIndex, getForfeitablePremium, getPoolDeploymentBlock, getPoolDisplayId, getPoolTokensForSimulation, getPositionsWithPremia, getSimpleLoanTokenIndex, getTokenListId, hasLoanOrCredit, hasLongLeg, isCredit, isCreditLeg, isInputListFailError, isLoan, isLoanLeg, isShortOnly, isSpread, liquidate, liquidateAndWait, loadCheckpoint, mint, mintAndWait, openPosition, openPositionAndWait, orderListForSettle, parseBps, parseTokenListId, planDeriveStrategy, pokeOracle, pokeOracleAndWait, previewBorrow, previewRepay, previewUnwrap, previewWrap, publicBroadcaster, reconstructFromEvents, redeem, redeemAndWait, repay, repayAndWait, resolveTokenIndex, rollPosition, rollPositionAndWait, saveCheckpoint, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, settlePremiumFrom, settlePremiumFromAndWait, simulateDispatch, simulateOpenPosition, simulateSettle, simulateSettlePremiumBatch, simulateSettlePremiumFrom, simulateSettleSequence, simulateWithTokenFlow, smartRepay, smartRepayAndWait, speedUpTransaction, splitTokenIdByTimescale, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, truncateAddress, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, validateBatch, validatePoolId, verifyBlockContinuity, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi };
|
package/dist/zodiac/index.d.ts
CHANGED
|
@@ -247,7 +247,7 @@ declare const ExecutionOptions: {
|
|
|
247
247
|
* (option legs trip `ChunkHasZeroLiquidity` in the SFPM; pure-loan tokenIds
|
|
248
248
|
* die in the end-of-dispatch solvency pass / positions-hash validation).
|
|
249
249
|
*
|
|
250
|
-
* Trade-off vs an oracle-based check: the key cannot settle
|
|
250
|
+
* Trade-off vs an oracle-based check: the key cannot settle streamia (settle
|
|
251
251
|
* requires `sizes[i] == storedSize`, unknowable pre-execution). Strictly a
|
|
252
252
|
* risk-reduction key: safe for a watchdog keeper or dead-man's-switch.
|
|
253
253
|
*/
|
|
@@ -297,7 +297,7 @@ declare function buildDispatchCustomRoleSteps(params: {
|
|
|
297
297
|
* hand-encoded tree in zodiac-modules/test/LiquidatorRolesFork.t.sol, which is
|
|
298
298
|
* the golden spec for this builder):
|
|
299
299
|
* - THIS TREE pins the static fields: pool ∈ allowlist, account ∉ {safe,
|
|
300
|
-
* helper}, swap targets ∈ {router, 0},
|
|
300
|
+
* helper}, swap targets ∈ {router, 0}, streamia flags = 0, and — via
|
|
301
301
|
* ExecutionOptions.None — zero outer msg.value (attached value is excluded
|
|
302
302
|
* from the helper's minDelta floors, so it must never flow through the
|
|
303
303
|
* role; native shortfalls are funded via nativeFundingAmount instead).
|
|
@@ -389,7 +389,7 @@ declare function buildDepositConditions(safe: `0x${string}`): ConditionFlat[];
|
|
|
389
389
|
//#endregion
|
|
390
390
|
//#region src/zodiac/roles/maintenance.d.ts
|
|
391
391
|
/**
|
|
392
|
-
* Maintenance role: full `dispatchFrom` access — settle
|
|
392
|
+
* Maintenance role: full `dispatchFrom` access — settle streamia on, force-
|
|
393
393
|
* exercise, and liquidate third-party accounts using the Safe's capital.
|
|
394
394
|
* No adapter needed; the pool itself hash-validates the position lists.
|
|
395
395
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["rolesV2Abi","ContractFunctionArgs","ContractFunctionName","rolesV2Abi","ScopeFunctionName","ScopeStep","Name","ScopeStepsPublicClient","Promise","ScopeStepsWalletClient","applyScopeSteps","Hex","ConditionFlat","addressEqualCompValue","customCompValue","sizeCapExtra","ParameterType","Operator","CANONICAL_ADAPTERS","ExecutionOptions","Hex","ScopeStep","ConditionFlat","DELEVERAGER_ROLE_KEY","buildDeleveragerDispatchConditions","buildDeleveragerRoleSteps","Hex","ScopeStep","ConditionFlat","DISPATCH_SELECTOR","roleKey","buildDispatchCustomConditions","buildDispatchCustomRoleSteps","Address","Hex","ScopeStep","ConditionFlat","LIQUIDATE_SELECTOR","LiquidatorConditionsParams","buildLiquidatorConditions","buildLiquidatorRoleSteps","Hex","ConditionFlat","LOAN_BITMASK_WINDOW_SHIFTS","loanBitmaskCompValueAt","buildLoanOnlyDispatchConditions","WITHDRAW_SELECTOR","DEPOSIT_SELECTOR","EXECUTE_SELECTOR","buildWithdrawConditions","buildDepositConditions","Hex","ScopeStep","ConditionFlat","MAINTENANCE_ROLE_KEY","DISPATCH_FROM_SELECTOR","buildDispatchFromConditions","buildMaintenanceRoleSteps","Hex","ScopeStep","ROLLER_ROLE_KEY","buildRollerRoleSteps","Hex","ScopeStep","ConditionFlat","MULTICALL_SELECTOR","MULTISEND_SELECTOR","WETH_DEPOSIT_SELECTOR","WETH_WITHDRAW_SELECTOR","WITHDRAW_WITH_POSITIONS_SELECTOR","buildWithdrawWithPositionsConditions","sfpmPoolIdPinExtra","buildSfpmSwapConditions","buildSfpmSwapVenueSteps","Hex","ScopeStep","SIZE_ADJUSTER_ROLE_KEY","buildSizeAdjusterRoleSteps","legFieldMask","loanWidthFieldsMask","strikeFieldsMask","optionRatioFieldsMask","isPureLoanTokenId","loanBitmaskCondition"],"sources":["../../src/zodiac/rolesAbi.d.ts","../../src/zodiac/applySteps.d.ts","../../src/zodiac/conditions.d.ts","../../src/zodiac/constants.d.ts","../../src/zodiac/roles/deleverager.d.ts","../../src/zodiac/roles/dispatchCustomRole.d.ts","../../src/zodiac/roles/liquidator.d.ts","../../src/zodiac/roles/loanHedger.d.ts","../../src/zodiac/roles/maintenance.d.ts","../../src/zodiac/roles/roller.d.ts","../../src/zodiac/roles/sfpmSwap.d.ts","../../src/zodiac/roles/sizeAdjuster.d.ts","../../src/zodiac/tokenIdMask.d.ts"],"sourcesContent":null,"mappings":";;;;;cACqBG;;;EAAAA,SAAAA,eA8FnB,EAAA,YAAA;;;;EC7FGC,CAAAA,EAAAA;IAAiB,SAAA,IAAA,EAAA,UAAA;IAA+BD,SAAAA,IAAAA,EAAAA,WAAAA;EAAU,CAAA,EAAtCD;IAAoB,SAAA,IAAA,EAAA,UAAA;;EAEjCyE,CAAAA,CAAAA;EAAS,SAAA,OAAA,EAAA,SAAA,EAAA;CAAA,EAAA;EACS,SAERrE,IAAAA,EAAAA,UAAAA;EAAI,SACgBH,IAAAA,EAAAA,aAAAA;EAAU,SAAgBG,eAAAA,EAAAA,YAAAA;EAAI,SAA1DL,MAAAA,EAAAA,SAAAA,CAAAA;IAEZG,SAAAA,IAAAA,EAAAA,SAAAA;IAAiB,SAAA,IAAA,EAAA,SAAA;;;;;;;EAOFG,SAAAA,IAAAA,EAAAA,UAAsB;EAQtBE,SAAAA,IAAAA,EAAAA,eAAsB;EAAA,SAAA,eAAA,EAAA,YAAA;EAAA,SAGnBN,MAAAA,EAAAA,SAAAA,CAAAA;IACEwE,SAAAA,IAAAA,EAAAA,SAAAA;IAIdnE,SAAAA,IAAAA,EAAAA,SAAAA;EAAO,CAAA,EAAA;;;;;;EAOSE,CAAAA,EAAAA;IAAe,SAAA,IAAA,EAAA,YAAA;IACrBH,SAAAA,IAAAA,EAAAA,SAAAA;IACAE,SAAAA,UAAAA,EAAAA,SAAAA,CAAAA;MAEPkE,SAAAA,IAAAA,EAAAA,QAAAA;MAaPnE,SAAAA,IAAAA,EAAAA,OAAAA;IAAO,CAAA,EAAA;;;;;MCvDMwD,SAAa,IAAA,EAAA,OAIZ;;MAGMnD,SAAAA,IAAAA,EAAAA,WAAqB;;;;;IAKrBC,SAAAA,IAAAA,EAAe,OAAA;EAAA,CAAA,CAAA;EAAA,SAAiC4D,OAAAA,EAAAA,SAAAA,EAAAA;CAAG,EAAA;EAAM,SAAA,IAAA,EAAA,UAAA;;;;;;EAMzD3D,CAAAA,EAAAA;;;;;;;;;;;;ECZHC,SAAAA,IAAAA,EAAAA,UAQpB;EACoBC,SAAAA,IAoBpB,EAAA,yBAAA;;;;;;;;;;IAUoBC,SAAAA,IAAAA,EAAAA,SAIpB;EACoBC,CAAAA,CAAAA;;;;KFlDhBf,iBAAAA,GAAoBF,4BAA4BC;;ADDhCA,KCGTwE,SAAAA,GD2FV,WC1FWvE;;gBAESE;EALjBF,IAAAA,EAMSH,oBANQ,CAAA,OAMoBE,UANpB,EAAA,YAAA,EAM8CG,IAN9C,CAAA;AAAA,CAAA,EAAA,CAQpBF,iBARmDD,CAAAA;;AAAR;;AAE7C;;;AAGsBG,UAULC,sBAAAA,CAVKD;EAAI,yBACgBH,CAAAA,IAAAA,EAAAA;IAA0BG,IAAAA,EAAAA,KAAAA,MAAAA,EAAAA;IAAtDL,OAAAA,CAAAA,EAAAA,MAAAA;EAAoB,CAAA,CAAA,EAa1BO,OAXNJ,CAAAA;IAAiB,MAAA,EAAA,MAAA;;;UAeFK,sBAAAA;;;gBAGGN;IAXHI,YAAAA,EAYKoE,SAZiB,CAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["rolesV2Abi","ContractFunctionArgs","ContractFunctionName","rolesV2Abi","ScopeFunctionName","ScopeStep","Name","ScopeStepsPublicClient","Promise","ScopeStepsWalletClient","applyScopeSteps","Hex","ConditionFlat","addressEqualCompValue","customCompValue","sizeCapExtra","ParameterType","Operator","CANONICAL_ADAPTERS","ExecutionOptions","Hex","ScopeStep","ConditionFlat","DELEVERAGER_ROLE_KEY","buildDeleveragerDispatchConditions","buildDeleveragerRoleSteps","Hex","ScopeStep","ConditionFlat","DISPATCH_SELECTOR","roleKey","buildDispatchCustomConditions","buildDispatchCustomRoleSteps","Address","Hex","ScopeStep","ConditionFlat","LIQUIDATE_SELECTOR","LiquidatorConditionsParams","buildLiquidatorConditions","buildLiquidatorRoleSteps","Hex","ConditionFlat","LOAN_BITMASK_WINDOW_SHIFTS","loanBitmaskCompValueAt","buildLoanOnlyDispatchConditions","WITHDRAW_SELECTOR","DEPOSIT_SELECTOR","EXECUTE_SELECTOR","buildWithdrawConditions","buildDepositConditions","Hex","ScopeStep","ConditionFlat","MAINTENANCE_ROLE_KEY","DISPATCH_FROM_SELECTOR","buildDispatchFromConditions","buildMaintenanceRoleSteps","Hex","ScopeStep","ROLLER_ROLE_KEY","buildRollerRoleSteps","Hex","ScopeStep","ConditionFlat","MULTICALL_SELECTOR","MULTISEND_SELECTOR","WETH_DEPOSIT_SELECTOR","WETH_WITHDRAW_SELECTOR","WITHDRAW_WITH_POSITIONS_SELECTOR","buildWithdrawWithPositionsConditions","sfpmPoolIdPinExtra","buildSfpmSwapConditions","buildSfpmSwapVenueSteps","Hex","ScopeStep","SIZE_ADJUSTER_ROLE_KEY","buildSizeAdjusterRoleSteps","legFieldMask","loanWidthFieldsMask","strikeFieldsMask","optionRatioFieldsMask","isPureLoanTokenId","loanBitmaskCondition"],"sources":["../../src/zodiac/rolesAbi.d.ts","../../src/zodiac/applySteps.d.ts","../../src/zodiac/conditions.d.ts","../../src/zodiac/constants.d.ts","../../src/zodiac/roles/deleverager.d.ts","../../src/zodiac/roles/dispatchCustomRole.d.ts","../../src/zodiac/roles/liquidator.d.ts","../../src/zodiac/roles/loanHedger.d.ts","../../src/zodiac/roles/maintenance.d.ts","../../src/zodiac/roles/roller.d.ts","../../src/zodiac/roles/sfpmSwap.d.ts","../../src/zodiac/roles/sizeAdjuster.d.ts","../../src/zodiac/tokenIdMask.d.ts"],"sourcesContent":null,"mappings":";;;;;cACqBG;;;EAAAA,SAAAA,eA8FnB,EAAA,YAAA;;;;EC7FGC,CAAAA,EAAAA;IAAiB,SAAA,IAAA,E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A,CAAAA,EAAAA,OAAAA;;AAElEF,iBWWsB+E,oBAAAA,CAAAA,CXXtB/E,EAAAA;EAAiB,IAAA,EAAA,KAAA,MAAA,EAAA"}
|
package/dist/zodiac/index.js
CHANGED
|
@@ -398,7 +398,7 @@ function buildDispatchCustomRoleSteps(params) {
|
|
|
398
398
|
* (option legs trip `ChunkHasZeroLiquidity` in the SFPM; pure-loan tokenIds
|
|
399
399
|
* die in the end-of-dispatch solvency pass / positions-hash validation).
|
|
400
400
|
*
|
|
401
|
-
* Trade-off vs an oracle-based check: the key cannot settle
|
|
401
|
+
* Trade-off vs an oracle-based check: the key cannot settle streamia (settle
|
|
402
402
|
* requires `sizes[i] == storedSize`, unknowable pre-execution). Strictly a
|
|
403
403
|
* risk-reduction key: safe for a watchdog keeper or dead-man's-switch.
|
|
404
404
|
*/
|
|
@@ -534,7 +534,7 @@ function buildDeleveragerRoleSteps(params) {
|
|
|
534
534
|
* hand-encoded tree in zodiac-modules/test/LiquidatorRolesFork.t.sol, which is
|
|
535
535
|
* the golden spec for this builder):
|
|
536
536
|
* - THIS TREE pins the static fields: pool ∈ allowlist, account ∉ {safe,
|
|
537
|
-
* helper}, swap targets ∈ {router, 0},
|
|
537
|
+
* helper}, swap targets ∈ {router, 0}, streamia flags = 0, and — via
|
|
538
538
|
* ExecutionOptions.None — zero outer msg.value (attached value is excluded
|
|
539
539
|
* from the helper's minDelta floors, so it must never flow through the
|
|
540
540
|
* role; native shortfalls are funded via nativeFundingAmount instead).
|
|
@@ -937,7 +937,7 @@ function buildDepositConditions(safe) {
|
|
|
937
937
|
//#endregion
|
|
938
938
|
//#region src/zodiac/roles/maintenance.ts
|
|
939
939
|
/**
|
|
940
|
-
* Maintenance role: full `dispatchFrom` access — settle
|
|
940
|
+
* Maintenance role: full `dispatchFrom` access — settle streamia on, force-
|
|
941
941
|
* exercise, and liquidate third-party accounts using the Safe's capital.
|
|
942
942
|
* No adapter needed; the pool itself hash-validates the position lists.
|
|
943
943
|
*
|