@panoptic-eng/sdk 1.0.63 → 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-BsSaoahK.js → cow-BIzmQHon.js} +1 -1
- package/dist/index.d.ts.map +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 +135 -135
- package/dist/panoptic/v2/index.js +50 -50
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.d.ts +142 -142
- package/dist/panoptic/v2/react-public.d.ts.map +1 -1
- package/dist/panoptic/v2/react-public.js +53 -53
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/{rates-BwZnK0tG.js → rates-O6Sn-xqL.js} +3 -3
- package/dist/{router-Dejb6MWu.js → router-BuAvFpbu.js} +3 -3
- package/dist/{router-pm9PDlyH.js → router-DHn0rNd7.js} +2 -2
- package/dist/uniswap/index.d.ts +1 -1
- package/dist/uniswap/index.js +1 -1
- package/dist/uniswap/index.js.map +1 -1
- package/dist/{v2-ccGPXWvq.js → v2-D2Bg1SeN.js} +15 -15
- package/dist/{writes--fM_8ggw.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 +1 -1
|
@@ -859,7 +859,7 @@ var NoLegsExercisableError = class extends PanopticError {
|
|
|
859
859
|
var NotALongLegError = class extends PanopticError {
|
|
860
860
|
name = "NotALongLegError";
|
|
861
861
|
constructor(cause) {
|
|
862
|
-
super("Cannot settle
|
|
862
|
+
super("Cannot settle streamia for non-long leg", cause);
|
|
863
863
|
}
|
|
864
864
|
};
|
|
865
865
|
/**
|
|
@@ -1328,7 +1328,7 @@ var UnsafePremiumSettlementError = class extends PanopticError {
|
|
|
1328
1328
|
name = "UnsafePremiumSettlementError";
|
|
1329
1329
|
constructor(remainingForfeit, failedBuyerCount, cause) {
|
|
1330
1330
|
const [token0, token1] = remainingForfeit;
|
|
1331
|
-
super(failedBuyerCount > 0 ? `
|
|
1331
|
+
super(failedBuyerCount > 0 ? `Streamia settlement blocked: ${failedBuyerCount} buyer settlement${failedBuyerCount === 1 ? "" : "s"} would fail` : `Streamia settlement blocked: uncollectable streamia remains (${token0}, ${token1})`, cause);
|
|
1332
1332
|
this.remainingForfeit = remainingForfeit;
|
|
1333
1333
|
this.failedBuyerCount = failedBuyerCount;
|
|
1334
1334
|
}
|
|
@@ -10568,7 +10568,7 @@ function formatPerSecondRateWadAsAprPct(ratePerSecondWad, precision) {
|
|
|
10568
10568
|
* // Now use without passing decimals each time
|
|
10569
10569
|
* const priceStr = fmt.tickToPriceScaled(position.currentTick, 4n)
|
|
10570
10570
|
* const amount0Str = fmt.formatAmount0(collateral.assets, 4n)
|
|
10571
|
-
* const amount1Str = fmt.formatAmount1(
|
|
10571
|
+
* const amount1Str = fmt.formatAmount1(streamia.token1, 2n)
|
|
10572
10572
|
*
|
|
10573
10573
|
* // Parse user input
|
|
10574
10574
|
* const rawAmount0 = fmt.parseAmount0("1.5")
|
|
@@ -16696,7 +16696,7 @@ async function fetchAndStorePoolMeta(client, poolAddress, poolMetaKey, storage)
|
|
|
16696
16696
|
* Reorder a position ID list so `tokenId` is the last element.
|
|
16697
16697
|
*
|
|
16698
16698
|
* The position list fingerprint is an XOR hash, so ordering is free to change.
|
|
16699
|
-
* The contract settles
|
|
16699
|
+
* The contract settles streamia on the last element of `positionIdListTo`.
|
|
16700
16700
|
*
|
|
16701
16701
|
* @throws PanopticError if `tokenId` is not in the list
|
|
16702
16702
|
*/
|
|
@@ -16705,15 +16705,15 @@ function orderListForSettle(positionIdList, tokenId) {
|
|
|
16705
16705
|
return [...positionIdList.filter((id) => id !== tokenId), tokenId];
|
|
16706
16706
|
}
|
|
16707
16707
|
/**
|
|
16708
|
-
* Settle another account's accumulated long
|
|
16708
|
+
* Settle another account's accumulated long streamia.
|
|
16709
16709
|
*
|
|
16710
16710
|
* Calls `dispatchFrom` with the target's position list passed as both
|
|
16711
16711
|
* `positionIdListTo` and `positionIdListToFinal` (equal lengths select the
|
|
16712
|
-
* settle-
|
|
16713
|
-
* target account to be solvent; the settled
|
|
16712
|
+
* settle-streamia mode and cannot force-exercise or liquidate). Requires the
|
|
16713
|
+
* target account to be solvent; the settled streamia is credited to the
|
|
16714
16714
|
* sellers of the corresponding chunks.
|
|
16715
16715
|
*
|
|
16716
|
-
* @param params - Settle
|
|
16716
|
+
* @param params - Settle streamia parameters
|
|
16717
16717
|
* @returns TxResult
|
|
16718
16718
|
*
|
|
16719
16719
|
* @example
|
|
@@ -16751,7 +16751,7 @@ async function settlePremiumFrom(params) {
|
|
|
16751
16751
|
});
|
|
16752
16752
|
}
|
|
16753
16753
|
/**
|
|
16754
|
-
* Settle another account's
|
|
16754
|
+
* Settle another account's streamia and wait for confirmation.
|
|
16755
16755
|
*
|
|
16756
16756
|
* When `storage` and `chainId` are provided, automatically syncs the
|
|
16757
16757
|
* caller's positions after the transaction confirms.
|
|
@@ -16841,7 +16841,7 @@ function buildSettleSequenceCalls(params) {
|
|
|
16841
16841
|
return calls;
|
|
16842
16842
|
}
|
|
16843
16843
|
/**
|
|
16844
|
-
* Execute a settle sequence: settle each target buyer's owed long
|
|
16844
|
+
* Execute a settle sequence: settle each target buyer's owed long streamia,
|
|
16845
16845
|
* then optionally close the caller's own position, in one multicall.
|
|
16846
16846
|
*
|
|
16847
16847
|
* @param params - Settle sequence parameters
|
|
@@ -19534,18 +19534,18 @@ async function minePoolAddressLocalAsync(params) {
|
|
|
19534
19534
|
//#endregion
|
|
19535
19535
|
//#region src/panoptic/v2/reads/premia.ts
|
|
19536
19536
|
/**
|
|
19537
|
-
* Get
|
|
19537
|
+
* Get streamia totals for an account.
|
|
19538
19538
|
*
|
|
19539
|
-
* Returns the total short and long
|
|
19540
|
-
* Short
|
|
19541
|
-
* Long
|
|
19539
|
+
* Returns the total short and long streamia across all positions.
|
|
19540
|
+
* Short streamia is owed TO the account (earned from selling options).
|
|
19541
|
+
* Long streamia is owed BY the account (paid for buying options).
|
|
19542
19542
|
*
|
|
19543
19543
|
* @param params - The parameters
|
|
19544
|
-
* @returns
|
|
19544
|
+
* @returns Streamia totals with block metadata
|
|
19545
19545
|
*
|
|
19546
19546
|
* @example
|
|
19547
19547
|
* ```typescript
|
|
19548
|
-
* const
|
|
19548
|
+
* const streamia = await getAccountPremia({
|
|
19549
19549
|
* client,
|
|
19550
19550
|
* poolAddress,
|
|
19551
19551
|
* account,
|
|
@@ -19553,8 +19553,8 @@ async function minePoolAddressLocalAsync(params) {
|
|
|
19553
19553
|
* includePendingPremium: true,
|
|
19554
19554
|
* })
|
|
19555
19555
|
*
|
|
19556
|
-
* console.log('Short
|
|
19557
|
-
* console.log('Long
|
|
19556
|
+
* console.log('Short streamia earned:', streamia.shortPremium0, streamia.shortPremium1)
|
|
19557
|
+
* console.log('Long streamia owed:', streamia.longPremium0, streamia.longPremium1)
|
|
19558
19558
|
* ```
|
|
19559
19559
|
*/
|
|
19560
19560
|
async function getAccountPremia(params) {
|
|
@@ -19600,13 +19600,13 @@ async function getAccountPremia(params) {
|
|
|
19600
19600
|
};
|
|
19601
19601
|
}
|
|
19602
19602
|
/**
|
|
19603
|
-
* Get positions with per-position
|
|
19603
|
+
* Get positions with per-position streamia data.
|
|
19604
19604
|
*
|
|
19605
19605
|
* Uses multicall to batch individual getFullPositionsData calls
|
|
19606
|
-
* for each position, giving us per-position
|
|
19606
|
+
* for each position, giving us per-position streamia in a single RPC request.
|
|
19607
19607
|
*
|
|
19608
19608
|
* @param params - The parameters
|
|
19609
|
-
* @returns Positions with
|
|
19609
|
+
* @returns Positions with streamia and totals with block metadata
|
|
19610
19610
|
*
|
|
19611
19611
|
* @example
|
|
19612
19612
|
* ```typescript
|
|
@@ -19619,9 +19619,9 @@ async function getAccountPremia(params) {
|
|
|
19619
19619
|
*
|
|
19620
19620
|
* for (const position of result.positions) {
|
|
19621
19621
|
* console.log('Position:', position.tokenId)
|
|
19622
|
-
* console.log('
|
|
19622
|
+
* console.log('Streamia:', position.premiaOwed0, position.premiaOwed1)
|
|
19623
19623
|
* }
|
|
19624
|
-
* console.log('Total short
|
|
19624
|
+
* console.log('Total short streamia:', result.shortPremium0, result.shortPremium1)
|
|
19625
19625
|
* ```
|
|
19626
19626
|
*/
|
|
19627
19627
|
async function getPositionsWithPremia(params) {
|
|
@@ -19738,17 +19738,17 @@ async function getPositionsWithPremia(params) {
|
|
|
19738
19738
|
};
|
|
19739
19739
|
}
|
|
19740
19740
|
/**
|
|
19741
|
-
* Get the unsettled short
|
|
19741
|
+
* Get the unsettled short streamia an account would forfeit by closing now.
|
|
19742
19742
|
*
|
|
19743
19743
|
* Calls `getFullPositionsData` twice in one multicall — once with
|
|
19744
19744
|
* `includePendingPremium = true` (everything owed to the short legs) and once
|
|
19745
19745
|
* with `false` (only what is available to collect). The difference is the
|
|
19746
|
-
*
|
|
19746
|
+
* streamia still owed by buyers that has not been settled; closing before it
|
|
19747
19747
|
* settles forfeits it. Settling buyers first (see `settlePremiumFrom`) moves
|
|
19748
|
-
* that
|
|
19748
|
+
* that streamia into the available bucket.
|
|
19749
19749
|
*
|
|
19750
19750
|
* @param params - The parameters
|
|
19751
|
-
* @returns Owed, available, and forfeitable
|
|
19751
|
+
* @returns Owed, available, and forfeitable streamia with block metadata
|
|
19752
19752
|
*/
|
|
19753
19753
|
async function getForfeitablePremium(params) {
|
|
19754
19754
|
const { client, poolAddress, account, tokenIds, blockNumber } = params;
|
|
@@ -20238,7 +20238,7 @@ async function getAccountSummaryRisk(params) {
|
|
|
20238
20238
|
* ## Same-Block Guarantee
|
|
20239
20239
|
* Tick and NLV are queried at the same target block.
|
|
20240
20240
|
*
|
|
20241
|
-
* Requires PanopticQuery for accurate value and
|
|
20241
|
+
* Requires PanopticQuery for accurate value and streamia accounting.
|
|
20242
20242
|
*
|
|
20243
20243
|
* @param params - The parameters
|
|
20244
20244
|
* @returns Net liquidation value with block metadata
|
|
@@ -22205,10 +22205,10 @@ async function getSafeMode(params) {
|
|
|
22205
22205
|
//#endregion
|
|
22206
22206
|
//#region src/panoptic/v2/reads/queryUtils.ts
|
|
22207
22207
|
/**
|
|
22208
|
-
* Get portfolio value (NAV) without
|
|
22208
|
+
* Get portfolio value (NAV) without streamia.
|
|
22209
22209
|
*
|
|
22210
22210
|
* This calculates the net asset value of the portfolio based on Uniswap liquidity
|
|
22211
|
-
* at a given tick, excluding accumulated
|
|
22211
|
+
* at a given tick, excluding accumulated streamia. Useful for PnL tracking separate
|
|
22212
22212
|
* from liquidation value.
|
|
22213
22213
|
*
|
|
22214
22214
|
* ## Same-Block Guarantee
|
|
@@ -23662,7 +23662,7 @@ const MASK_128 = (1n << 128n) - 1n;
|
|
|
23662
23662
|
* Get historical streamia data for a position across multiple blocks.
|
|
23663
23663
|
*
|
|
23664
23664
|
* @param params - The parameters
|
|
23665
|
-
* @returns Snapshots of Panoptic
|
|
23665
|
+
* @returns Snapshots of Panoptic streamia and Uniswap fee deltas at each block
|
|
23666
23666
|
*/
|
|
23667
23667
|
async function getStreamiaHistory(params) {
|
|
23668
23668
|
const { client, panopticPoolAddress, account, tokenId, blockNumbers, legs, poolConfig, includeUniswapFees = true, settledEvents } = params;
|
|
@@ -24825,17 +24825,17 @@ var EnrichmentCallError = class extends PanopticError {
|
|
|
24825
24825
|
}
|
|
24826
24826
|
};
|
|
24827
24827
|
/**
|
|
24828
|
-
* Fetch enrichment data (
|
|
24828
|
+
* Fetch enrichment data (streamia, portfolio values, collateral requirements) for a set of positions.
|
|
24829
24829
|
*
|
|
24830
24830
|
* Batches all needed contract reads into efficient multicalls:
|
|
24831
24831
|
* - **Open positions**: 3 calls per position in a single multicall at current block:
|
|
24832
|
-
* 1. `getFullPositionsData` →
|
|
24832
|
+
* 1. `getFullPositionsData` → streamia + collateral requirements
|
|
24833
24833
|
* 2. `getPortfolioValue` at currentTick → current portfolio value
|
|
24834
24834
|
* 3. `getPortfolioValue` at mintTick → portfolio value at mint
|
|
24835
24835
|
* - **Closed positions**: 2 calls per position at `burnBlockNumber - 1`:
|
|
24836
24836
|
* 1. `getPortfolioValue` at burnTick → portfolio value at close
|
|
24837
24837
|
* 2. `getPortfolioValue` at mintTick → portfolio value at mint
|
|
24838
|
-
* (
|
|
24838
|
+
* (streamia come from subgraph `burnPremium0/1`)
|
|
24839
24839
|
*
|
|
24840
24840
|
* ## Same-Block Guarantee
|
|
24841
24841
|
* Open position data is fetched at a single block number.
|
|
@@ -27035,11 +27035,11 @@ function buildProtectedSettleDispatch(params) {
|
|
|
27035
27035
|
|
|
27036
27036
|
//#endregion
|
|
27037
27037
|
//#region src/panoptic/v2/simulations/simulateSettlePremiumFrom.ts
|
|
27038
|
-
/** Soft-failure revert markers for settle
|
|
27038
|
+
/** Soft-failure revert markers for settle streamia (target-state issues, not caller errors). */
|
|
27039
27039
|
const SOFT_FAILURES = [
|
|
27040
27040
|
{
|
|
27041
27041
|
marker: "AccountInsolvent",
|
|
27042
|
-
reason: "Target account is insolvent;
|
|
27042
|
+
reason: "Target account is insolvent; streamia cannot be settled"
|
|
27043
27043
|
},
|
|
27044
27044
|
{
|
|
27045
27045
|
marker: "PositionNotOwned",
|
|
@@ -27055,14 +27055,14 @@ const SOFT_FAILURES = [
|
|
|
27055
27055
|
}
|
|
27056
27056
|
];
|
|
27057
27057
|
/**
|
|
27058
|
-
* Simulate settling another account's accumulated long
|
|
27058
|
+
* Simulate settling another account's accumulated long streamia via `dispatchFrom`
|
|
27059
27059
|
* (equal-length `positionIdListTo`/`positionIdListToFinal` selects the settle mode).
|
|
27060
27060
|
*
|
|
27061
|
-
* The measured token flow is the CALLER's collateral delta — i.e. the
|
|
27061
|
+
* The measured token flow is the CALLER's collateral delta — i.e. the streamia
|
|
27062
27062
|
* the caller receives from the settlement (for chunks they sold).
|
|
27063
27063
|
*
|
|
27064
27064
|
* @param params - Simulation parameters
|
|
27065
|
-
* @returns Simulation result with settled
|
|
27065
|
+
* @returns Simulation result with settled streamia data or error
|
|
27066
27066
|
*/
|
|
27067
27067
|
async function simulateSettlePremiumFrom(params) {
|
|
27068
27068
|
const { client, poolAddress, account, user, positionIdListFrom, positionIdList, tokenId, blockNumber } = params;
|
|
@@ -27220,14 +27220,14 @@ async function simulateSettlePremiumFrom(params) {
|
|
|
27220
27220
|
//#endregion
|
|
27221
27221
|
//#region src/panoptic/v2/simulations/simulateSettlePremiumBatch.ts
|
|
27222
27222
|
/**
|
|
27223
|
-
* Simulate settling each target buyer's owed long
|
|
27223
|
+
* Simulate settling each target buyer's owed long streamia, all at one block.
|
|
27224
27224
|
*
|
|
27225
27225
|
* Individual failures (insolvent buyer, stale list, …) are soft: the target
|
|
27226
27226
|
* lands in the unsettleable partition instead of failing the batch. Only
|
|
27227
27227
|
* unexpected errors reject.
|
|
27228
27228
|
*
|
|
27229
27229
|
* @param params - Simulation parameters
|
|
27230
|
-
* @returns Partitioned targets with per-target
|
|
27230
|
+
* @returns Partitioned targets with per-target streamia and totals
|
|
27231
27231
|
*/
|
|
27232
27232
|
async function simulateSettlePremiumBatch(params) {
|
|
27233
27233
|
const { client, poolAddress, account, positionIdListFrom, targets, blockNumber } = params;
|
|
@@ -27518,9 +27518,9 @@ async function simulateSettle(params) {
|
|
|
27518
27518
|
//#endregion
|
|
27519
27519
|
//#region src/panoptic/v2/writes/settle.ts
|
|
27520
27520
|
/**
|
|
27521
|
-
* Settle accumulated
|
|
27521
|
+
* Settle accumulated streamia on existing positions.
|
|
27522
27522
|
*
|
|
27523
|
-
* This function triggers
|
|
27523
|
+
* This function triggers streamia collection without changing position size.
|
|
27524
27524
|
* It calls dispatch with unchanged position lists.
|
|
27525
27525
|
*
|
|
27526
27526
|
* @param params - Settlement parameters
|
|
@@ -27603,7 +27603,7 @@ async function settleAccumulatedPremia(params) {
|
|
|
27603
27603
|
});
|
|
27604
27604
|
}
|
|
27605
27605
|
/**
|
|
27606
|
-
* Settle
|
|
27606
|
+
* Settle streamia and wait for confirmation.
|
|
27607
27607
|
*/
|
|
27608
27608
|
async function settleAccumulatedPremiaAndWait(params) {
|
|
27609
27609
|
const result = await settleAccumulatedPremia(params);
|
|
@@ -32529,7 +32529,7 @@ function netLiquidationValueInQuote(value0, value1, tick, isAssetToken0) {
|
|
|
32529
32529
|
const price = new Decimal("1.0001").pow(tick.toString());
|
|
32530
32530
|
return isAssetToken0 ? new Decimal(value1.toString()).plus(new Decimal(value0.toString()).mul(price)) : new Decimal(value0.toString()).plus(new Decimal(value1.toString()).div(price));
|
|
32531
32531
|
}
|
|
32532
|
-
/** Apply the accrued-
|
|
32532
|
+
/** Apply the accrued-streamia offset and optional asset collateral to a relative NLV curve. */
|
|
32533
32533
|
function marketPnlInQuote({ relativeValue, premium, assetBalance = 0n, price, baselinePrice }) {
|
|
32534
32534
|
return new Decimal(relativeValue).plus(premium).plus(new Decimal(assetBalance.toString()).mul(new Decimal(price).minus(baselinePrice)));
|
|
32535
32535
|
}
|
|
@@ -32566,7 +32566,7 @@ function marketRiskFromValues({ lower, current, upper }) {
|
|
|
32566
32566
|
const Precision = Decimal.clone({ precision: 80 });
|
|
32567
32567
|
const Q96 = 1n << 96n;
|
|
32568
32568
|
const YEAR_SECONDS = new Precision(31536e3);
|
|
32569
|
-
/** The
|
|
32569
|
+
/** The streamia-free position curve, expressed in one quote token's human units. */
|
|
32570
32570
|
function preparePositionGamma({ tokenId, positionSize, quoteIsToken0, quoteDecimals }) {
|
|
32571
32571
|
if (positionSize <= 0n || positionSize >= 1n << 128n) throw new RangeError("Invalid position size");
|
|
32572
32572
|
if (!Number.isInteger(quoteDecimals) || quoteDecimals < 0 || quoteDecimals > 255) throw new RangeError("Invalid quote decimals");
|
|
@@ -32804,7 +32804,7 @@ async function getCollateralCurve({ client, poolAddress, account, queryAddress,
|
|
|
32804
32804
|
//#endregion
|
|
32805
32805
|
//#region src/panoptic/v2/reads/positionValueCurve.ts
|
|
32806
32806
|
const abi = parseAbi(["function computeNetLiquidationValue(uint256[] positionIdList, uint256 shortPremium, uint256 longPremium, uint256[] positionBalanceArray, int24[] atTicks) pure returns (int256[] value0, int256[] value1)"]);
|
|
32807
|
-
/** Stable identity for a position-dependent curve;
|
|
32807
|
+
/** Stable identity for a position-dependent curve; streamia and spot are separate inputs. */
|
|
32808
32808
|
function positionValueKey(positions) {
|
|
32809
32809
|
return [...positions].sort((a, b) => a.tokenId < b.tokenId ? -1 : a.tokenId > b.tokenId ? 1 : 0).map(({ tokenId, positionSize }) => `${tokenId}:${positionSize}`).join(",");
|
|
32810
32810
|
}
|
|
@@ -32990,7 +32990,7 @@ async function getPositionVolatilityHistory({ client, poolAddress, account, toke
|
|
|
32990
32990
|
logs: receipt.logs.filter((log) => log.address.toLowerCase() === poolAddress.toLowerCase()),
|
|
32991
32991
|
eventName: "AccountLiquidated"
|
|
32992
32992
|
});
|
|
32993
|
-
if (liquidations.some((event) => event.args.liquidatee.toLowerCase() === account.toLowerCase())) throw new Error("Liquidation
|
|
32993
|
+
if (liquidations.some((event) => event.args.liquidatee.toLowerCase() === account.toLowerCase())) throw new Error("Liquidation streamia requires haircut reconciliation");
|
|
32994
32994
|
for (const packed of close.args.premiaByLeg) {
|
|
32995
32995
|
const amounts = unpack(packed);
|
|
32996
32996
|
settled.push({
|
|
@@ -33035,7 +33035,7 @@ async function getPositionVolatilityHistory({ client, poolAddress, account, toke
|
|
|
33035
33035
|
})
|
|
33036
33036
|
});
|
|
33037
33037
|
const openingAccrual = premium[0];
|
|
33038
|
-
if (!openingAccrual || openingAccrual.timestamp !== start.blockTimestamp) throw new Error("Opening
|
|
33038
|
+
if (!openingAccrual || openingAccrual.timestamp !== start.blockTimestamp) throw new Error("Opening streamia snapshot missing");
|
|
33039
33039
|
premium = premium.map((snapshot) => ({
|
|
33040
33040
|
timestamp: snapshot.timestamp,
|
|
33041
33041
|
token0: snapshot.token0 - openingAccrual.token0,
|
|
@@ -33043,7 +33043,7 @@ async function getPositionVolatilityHistory({ client, poolAddress, account, toke
|
|
|
33043
33043
|
}));
|
|
33044
33044
|
} catch (error) {
|
|
33045
33045
|
premium = null;
|
|
33046
|
-
premiumError = error instanceof Error ? error.message : "
|
|
33046
|
+
premiumError = error instanceof Error ? error.message : "Streamia history unavailable";
|
|
33047
33047
|
}
|
|
33048
33048
|
if (includeBaseFees) try {
|
|
33049
33049
|
const feeBlocks = close ? blockNumbers.filter((block) => block < finalBlock) : blockNumbers;
|
|
@@ -34015,7 +34015,7 @@ function useAccountPremia(poolAddress, tokenIds, account, options) {
|
|
|
34015
34015
|
});
|
|
34016
34016
|
}
|
|
34017
34017
|
/**
|
|
34018
|
-
* Unsettled short
|
|
34018
|
+
* Unsettled short streamia the account would forfeit by closing `tokenIds` now
|
|
34019
34019
|
* (owed-including-pending minus available-to-collect).
|
|
34020
34020
|
*/
|
|
34021
34021
|
function useForfeitablePremium(poolAddress, tokenIds, account, options) {
|
|
@@ -36377,9 +36377,9 @@ function useSimulateForceExercise(poolAddress, params) {
|
|
|
36377
36377
|
});
|
|
36378
36378
|
}
|
|
36379
36379
|
/**
|
|
36380
|
-
* Simulate settling several buyers' owed
|
|
36380
|
+
* Simulate settling several buyers' owed streamia at one block, partitioning
|
|
36381
36381
|
* them into settleable vs unsettleable and summing the caller's unlocked
|
|
36382
|
-
*
|
|
36382
|
+
* streamia. Refetches on every call (staleTime 0) so the partition reflects
|
|
36383
36383
|
* current chain state.
|
|
36384
36384
|
*/
|
|
36385
36385
|
function useSimulateSettlePremiumBatch(poolAddress, params) {
|