@panoptic-eng/sdk 1.0.38 → 1.0.40

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.
Files changed (81) hide show
  1. package/dist/cow/index.d.ts +804 -5
  2. package/dist/cow/index.d.ts.map +1 -0
  3. package/dist/cow/index.js +5268 -5
  4. package/dist/cow/index.js.map +1 -0
  5. package/dist/{cow-DB8siv6M.js → cow-tRUtAUZy.js} +2 -3
  6. package/dist/{getTrackedPositionIds-zYPIs5dt.js → getTrackedPositionIds-ms3W9dYB.js} +1 -2
  7. package/dist/greeks-GysWXct-.js +1 -2
  8. package/dist/index.d.ts +5752 -4
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +11952 -2130
  11. package/dist/index.js.map +1 -1
  12. package/dist/{irm-ChkvYphK.js → irm-SPC2KxLA.js} +321 -3
  13. package/dist/panoptic/v2/greeks/index.d.ts +277 -4
  14. package/dist/panoptic/v2/greeks/index.d.ts.map +1 -0
  15. package/dist/panoptic/v2/greeks/index.js +620 -2
  16. package/dist/panoptic/v2/greeks/index.js.map +1 -0
  17. package/dist/panoptic/v2/index.d.ts +14633 -7
  18. package/dist/panoptic/v2/index.d.ts.map +1 -0
  19. package/dist/panoptic/v2/index.js +27875 -9
  20. package/dist/panoptic/v2/index.js.map +1 -0
  21. package/dist/panoptic/v2/react-public.d.ts +14779 -15
  22. package/dist/panoptic/v2/react-public.d.ts.map +1 -1
  23. package/dist/panoptic/v2/react-public.js +29463 -89
  24. package/dist/panoptic/v2/react-public.js.map +1 -1
  25. package/dist/{router-tCRa0ekE.js → router-BTfbaRfg.js} +2 -3
  26. package/dist/{router-BCUJkY8j.js → router-mLWy0MD9.js} +3 -4
  27. package/dist/test/index.d.ts +3 -3
  28. package/dist/test/index.d.ts.map +1 -1
  29. package/dist/test/index.js +2 -2
  30. package/dist/{transactionFees-CVi2TrJh.js → transactionFees-C_Qx07mx.js} +1 -2
  31. package/dist/uniswap/index.d.ts +813 -78
  32. package/dist/uniswap/index.d.ts.map +1 -1
  33. package/dist/uniswap/index.js +5884 -13
  34. package/dist/uniswap/index.js.map +1 -1
  35. package/dist/{v2-BxtzpUnV.js → v2-DG7qG6di.js} +4 -5
  36. package/dist/vault-transaction-fees.d.ts +63 -2
  37. package/dist/vault-transaction-fees.d.ts.map +1 -0
  38. package/dist/vault-transaction-fees.js +174 -2
  39. package/dist/vault-transaction-fees.js.map +1 -0
  40. package/dist/{writes-D3bj1wth.js → writes-Xp9Wa8GQ.js} +2 -3
  41. package/dist/zodiac/index.d.ts.map +1 -1
  42. package/package.json +4 -3
  43. package/dist/cow/types.d.ts +0 -4
  44. package/dist/cow/types.js +0 -0
  45. package/dist/cow-DB8siv6M.js.map +0 -1
  46. package/dist/getTrackedPositionIds-zYPIs5dt.js.map +0 -1
  47. package/dist/greeks-GysWXct-.js.map +0 -1
  48. package/dist/hypoVault/vaultDisplayNames.d.ts +0 -2
  49. package/dist/hypoVault/vaultDisplayNames.js +0 -4
  50. package/dist/index-BhEBx83X.d.ts +0 -9760
  51. package/dist/index-BhEBx83X.d.ts.map +0 -1
  52. package/dist/index-Bo9tHtD7.d.ts +0 -1901
  53. package/dist/index-Bo9tHtD7.d.ts.map +0 -1
  54. package/dist/index-CttjEZ-S.d.ts +0 -275
  55. package/dist/index-CttjEZ-S.d.ts.map +0 -1
  56. package/dist/index-DktZq9Kb.d.ts +0 -261
  57. package/dist/index-DktZq9Kb.d.ts.map +0 -1
  58. package/dist/irm-ChkvYphK.js.map +0 -1
  59. package/dist/irm-D2WTHtuo.d.ts +0 -5667
  60. package/dist/irm-D2WTHtuo.d.ts.map +0 -1
  61. package/dist/irm-D5plRhpB.d.ts +0 -32
  62. package/dist/irm-D5plRhpB.d.ts.map +0 -1
  63. package/dist/panoptic/v2/types/index.d.ts +0 -3
  64. package/dist/panoptic/v2/types/index.js +0 -0
  65. package/dist/quote-DeHNUR0Z.d.ts +0 -52
  66. package/dist/quote-DeHNUR0Z.d.ts.map +0 -1
  67. package/dist/router-BCUJkY8j.js.map +0 -1
  68. package/dist/router-tCRa0ekE.js.map +0 -1
  69. package/dist/src-CRAtPwWk.js +0 -321
  70. package/dist/src-CRAtPwWk.js.map +0 -1
  71. package/dist/transactionFees-CVi2TrJh.js.map +0 -1
  72. package/dist/transactionFees-DzDyt50k.d.ts +0 -63
  73. package/dist/transactionFees-DzDyt50k.d.ts.map +0 -1
  74. package/dist/types-Cad5m4Td.d.ts +0 -246
  75. package/dist/types-Cad5m4Td.d.ts.map +0 -1
  76. package/dist/types-DM0nxlZr.d.ts +0 -128
  77. package/dist/types-DM0nxlZr.d.ts.map +0 -1
  78. package/dist/v2-BxtzpUnV.js.map +0 -1
  79. package/dist/vaultDisplayNames-CKpz51Hu.js +0 -0
  80. package/dist/vaultDisplayNames-Q6htUcch.d.ts +0 -2
  81. package/dist/writes-D3bj1wth.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Bo9tHtD7.d.ts","names":["BlockMeta","MintBufferRatio","tickToSqrtPriceX96","tickToPrice","tickToPriceDecimalScaled","sqrtPriceX96ToPriceDecimalScaled","priceToTick","sqrtPriceX96ToTick","formatTick","getPricesAtTick","formatTickRange","formatPriceRange","getTickSpacing","roundToTickSpacing","TickLimitsResult","tickLimits","OracleState","OracleEmaPeriods","OracleRiskParameters","OracleSafeModeCause","OracleSafeModeDiagnosis","DiagnosticOracleState","Pick","decodeOracleRiskParameters","diagnoseOracleSafeMode","Address","PublicClient","tickToSqrtPriceX96","BlockMeta","OracleState","Pool","RiskParameters","Utilization","OracleRiskParameters","PoolMetadata","GetPoolMetadataParams","getPoolMetadata","Promise","GetPoolParams","getPool","GetUtilizationParams","getUtilization","GetOracleStateParams","getOracleState","GetOracleRiskParametersParams","OracleRiskParametersState","getOracleRiskParameters","GetRiskParametersParams","getRiskParameters","validateBuilderCode","FetchPoolIdParams","FetchPoolIdResult","fetchPoolId","Address","PoolMetadata","BlockMeta","PoolHealthStatus","CollateralTracker","RiskEngine","PoolKey","Pool","Utilization","Address","BlockMeta","TokenIdLeg","Position","LegGreeksParams","PositionGreeks","ClosedPosition","RealizedPnL","StoredPositionData","StoredPoolMeta","Address","BlockMeta","Pool","PoolHealthStatus","Position","PositionGreeks","TokenCollateral","AccountCollateral","AccountSummaryBasic","AccountSummaryRisk","LiquidationPrices","NetLiquidationValue","NetLiquidationValues","CollateralEstimate","BlockMeta","MintBufferRatio","SafeMode","OracleState","SafeModeState","RiskParameters","CurrentRates","Address","Hash","PanopticEventType","BaseEvent","OptionMintedEvent","OptionBurntEvent","AccountLiquidatedEvent","ForcedExercisedEvent","PremiumSettledEvent","DepositEvent","WithdrawEvent","BorrowRateUpdatedEvent","LiquidityChunkUpdatedEvent","ProtocolLossRealizedEvent","ModifyLiquidityEvent","SwapEvent","DonateEvent","PanopticEvent","LegUpdate","EventSubscription","SyncEvent","Address","Hash","PanopticEvent","TxResult","TxReceipt","Promise","TxResultWithReceipt","TxBroadcaster","TxOverrides","NonceManager","DispatchCall","PanopticError","Error","PanopticError","BlockMeta","Position","PositionGreeks","TokenFlow","SimulationResult","T","OpenPositionSimulation","ClosePositionSimulation","ForceExerciseSimulation","LiquidateSimulation","SettleSimulation","DepositSimulation","WithdrawSimulation","DispatchSimulation","Address","Hash","ChunkSpread","ChunkKey","ChunkData","ChunkMetadata","ChunkStats","Address","V3PoolConfig","V4PoolConfig","PoolVersionConfig","Address","Hash","SyncStatus","SyncState","SyncCheckpoint","SyncOptions","SyncResult","ReorgDetection"],"sources":["../src/panoptic/v2/types/meta.d.ts","../src/panoptic/v2/types/mintBuffer.d.ts","../src/panoptic/v2/formatters/tick.d.ts","../src/panoptic/v2/utils/oracleSafeMode.d.ts","../src/panoptic/v2/reads/pool.d.ts","../src/panoptic/v2/types/pool.d.ts","../src/panoptic/v2/types/position.d.ts","../src/panoptic/v2/types/account.d.ts","../src/panoptic/v2/types/oracle.d.ts","../src/panoptic/v2/types/events.d.ts","../src/panoptic/v2/types/tx.d.ts","../src/panoptic/v2/errors/base.d.ts","../src/panoptic/v2/types/simulation.d.ts","../src/panoptic/v2/types/chunks.d.ts","../src/panoptic/v2/types/poolConfig.d.ts","../src/panoptic/v2/types/sync.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;;;;;;;;;;UAQiBgI,SAAAA;;;EAAAA;;;;;;;;;;;;;;;UCDAzC,eAAAA;;;;EDCAyC,WAAAA,EAAS,MAAA;;;;;;;;;;;;iBEDFrG,kBAAAA;;;;AFCxB;;;;;;;;;;;ACDA;;;;iBCmBwBxB,WAAAA;;;;;;;AAnBxB;;;;;;;;;;;;;;;;iBA0CwBC,wBAAAA;;;AAvBxB;;;;;;;;;;;;;;iBAwCwBC,gCAAAA;;;;;;;;;AAjBxB;;;;;;;;;iBAmCwBC,WAAAA;;;;;;;;AAlBxB;;;;iBA8BwBC,kBAAAA;;;;;;;;;;;;;iBAaAC,UAAAA;AAzBxB;;;;;;;;;;;;AAYA;;;;iBA8BwBC,eAAAA;;;;;;;;;AAjBxB;;;;;;;iBAiCwBC,eAAAA;;;;;;;;;;AAhBxB;;;;;;iBAgCwBC,gBAAAA;;;;;;;AAhBxB;;;;;;;;iBA+BwBC,cAAAA;;;;;;;;AAfxB;;;;;;;iBA8BwBC,kBAAAA;;;;UAIPC,gBAAAA;;;;EAnBOF,IAAAA,EAAAA,MAAAA;;;;;;;;;;;;;;;AAexB;;;;AAIA;;;;;;;;iBA+BwBG,UAAAA,6CAAuDD;;;;UC9N9DG,gBAAAA;;;;;;UAMAgB,oBAAAA;cACDhB;;;EHAC+G,aAAS,EAAA,MAAA;;KGKd7G,mBAAAA;UACKC,uBAAAA;;;;;;mBAMID;;EFbJoE,yBAAe,EAAA,MAAA;;;;;;;KEsB3BlE,qBAAAA,GAAwBC,KAAKmE;;iBAEVlE,0BAAAA,oEAA8FU;;ADxB9FN,iBC0BAH,sBAAAA,CD1BkB,KAAA,EC0BYH,qBD1BZ,EAAA,UAAA,EC0B+CY,oBD1B/C,EAAA,YA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;UW2BiBP,aAAAA;;OAERF;;;;;;;;;;;UAWQG,UAAAA;;;;;;;;;EXjBOhJ;;;;;;;UY3CPkJ,YAAAA;;;eAGAG;;AdDjB;UcIiBF,YAAAA;;;oBAGKE;;;;;KAKVD,iBAAAA,GAAoBF,eAAeC;;;;;;;KCZnCI,UAAAA;;;AfAZ;UeIiBC,SAAAA;;UAELD;;;;uBAIaD;;;;EdXRnE,cAAAA,EAAAA,MAAe;;;;;;;;;;;ACAhC;;Ua4BiBsE,cAAAA;;;;eAIAJ;;WAEJA;;;;iBAIMC;;;;;;;AbnBnB;;Ua4BiBI,WAAAA;;;;;;;;;;uBAUQF;;;;;UAKRG,UAAAA;;;;SAINH;;EbxBaxJ,WAAAA,EAAAA,MAAAA,EAAAA;;;;;;;;;UamCP4J,cAAAA;;;;;;iBAMEN;;EbxBKrJ,UAAAA,CAAAA,Ea0BPqJ,Ib1BOrJ"}
@@ -1,275 +0,0 @@
1
- import { PanopticError, SimulationResult, TxResult } from "./index-Bo9tHtD7.js";
2
- import { ApproveErc20ForCowParams, CancelCowOrderParams, CheckCowApprovalParams, CowApprovalStatus, CowOrderResult, CowOrderState, CowQuote, GetCowOrderStatusParams, QuoteCowSwapParams, SignAndSubmitCowOrderParams } from "./types-DM0nxlZr.js";
3
- import { Address } from "viem";
4
-
5
- //#region src/cow/addresses.d.ts
6
- /** GPv2Settlement — EIP-712 verifying contract for signed orders. */
7
-
8
- /** GPv2Settlement — EIP-712 verifying contract for signed orders. */
9
- declare const COW_SETTLEMENT: Address;
10
- /** GPv2VaultRelayer — the ERC20 approval target (NOT the settlement contract). */
11
- declare const COW_VAULT_RELAYER: Address;
12
- /**
13
- * Buy-token marker for native ETH. Orders buying this sentinel settle in
14
- * native ETH (the settlement contract unwraps WETH). Only valid on the buy
15
- * side — selling native ETH requires the eth-flow contract (unsupported here).
16
- */
17
- declare const COW_NATIVE_ETH: Address;
18
- /** Order-book API base URL per chain. */
19
- declare const COW_API_URLS: Partial<Record<number, string>>;
20
- /** Whether CoW Protocol has an order book for the chain. */
21
- declare function isCowSupportedChain(chainId: bigint | number): boolean;
22
-
23
- //#endregion
24
- //#region src/cow/approval.d.ts
25
- /** Check whether the vault relayer can pull `amount` of the sell token. */
26
- declare function checkCowApproval(params: CheckCowApprovalParams): Promise<CowApprovalStatus>;
27
- /** Approve the sell token to the vault relayer (defaults to unlimited). */
28
- declare function approveErc20ForCow(params: ApproveErc20ForCowParams): Promise<TxResult>;
29
-
30
- //#endregion
31
- //#region src/cow/compare.d.ts
32
- /**
33
- * Venue selection between the Uniswap v4 router and CoW Swap.
34
- *
35
- * Pure amount comparison so it stays testable and reusable outside React.
36
- * Gas cost of the router tx is not factored in (CoW ERC20 sells are gasless);
37
- * TODO: optionally discount the Uniswap side by gasEstimate × gas price.
38
- *
39
- * @module cow/compare
40
- */
41
- /** Swap venues the UI can route through. */
42
- type SwapVenue = 'uniswap' | 'cow';
43
- /** Parameters for {@link pickBestVenue}. */
44
- interface PickBestVenueParams {
45
- /** 'sell' = exact-in (maximize output), 'buy' = exact-out (minimize input). */
46
- kind: 'sell' | 'buy';
47
- /** Uniswap quote amounts; omit when the quote failed or is unavailable. */
48
- uniswap?: {
49
- /** Quoted output (exact-in). */
50
- amountOut?: bigint;
51
- /** Quoted input (exact-out). */
52
- amountIn?: bigint;
53
- };
54
- /** CoW quote amounts; omit when the quote failed or is unavailable. */
55
- cow?: {
56
- /** Quoted net output (exact-in). */
57
- buyAmount?: bigint;
58
- /** Quoted gross input including fee (exact-out). */
59
- sellAmountTotal?: bigint;
60
- };
61
- }
62
- /** Result of {@link pickBestVenue}. */
63
- interface BestVenue {
64
- winner: SwapVenue;
65
- /** Price advantage of the winner over the loser in bps (only when both quoted). */
66
- advantageBps?: bigint;
67
- }
68
- /**
69
- * Pick the venue with the better effective price. Exact-in compares net
70
- * output (higher wins); exact-out compares gross input (lower wins). With a
71
- * single usable quote that venue wins; ties go to Uniswap (instant
72
- * settlement); with no usable quotes Uniswap wins by default.
73
- */
74
- declare function pickBestVenue(params: PickBestVenueParams): BestVenue;
75
-
76
- //#endregion
77
- //#region src/cow/eip712.d.ts
78
- /** GPv2 `Order` struct, in EIP-712 typed-data form. */
79
- declare const COW_ORDER_TYPES: {
80
- readonly Order: readonly [{
81
- readonly name: "sellToken";
82
- readonly type: "address";
83
- }, {
84
- readonly name: "buyToken";
85
- readonly type: "address";
86
- }, {
87
- readonly name: "receiver";
88
- readonly type: "address";
89
- }, {
90
- readonly name: "sellAmount";
91
- readonly type: "uint256";
92
- }, {
93
- readonly name: "buyAmount";
94
- readonly type: "uint256";
95
- }, {
96
- readonly name: "validTo";
97
- readonly type: "uint32";
98
- }, {
99
- readonly name: "appData";
100
- readonly type: "bytes32";
101
- }, {
102
- readonly name: "feeAmount";
103
- readonly type: "uint256";
104
- }, {
105
- readonly name: "kind";
106
- readonly type: "string";
107
- }, {
108
- readonly name: "partiallyFillable";
109
- readonly type: "bool";
110
- }, {
111
- readonly name: "sellTokenBalance";
112
- readonly type: "string";
113
- }, {
114
- readonly name: "buyTokenBalance";
115
- readonly type: "string";
116
- }];
117
- };
118
- /** GPv2 order-cancellation struct (batch of order UIDs). */
119
- declare const COW_CANCELLATION_TYPES: {
120
- readonly OrderCancellations: readonly [{
121
- readonly name: "orderUids";
122
- readonly type: "bytes[]";
123
- }];
124
- };
125
- /** EIP-712 domain for GPv2Settlement on the given chain. */
126
- declare function cowDomain(chainId: bigint | number): {
127
- name: string;
128
- version: string;
129
- chainId: number;
130
- verifyingContract: Address;
131
- };
132
- /**
133
- * Full appData JSON document attached to orders. The order itself carries only
134
- * its keccak256 hash; the API stores the document when it accompanies the
135
- * order POST. Must stay byte-identical to {@link APP_DATA_HASH}.
136
- */
137
- declare const APP_DATA_DOC = "{\"appCode\":\"panoptic\",\"metadata\":{},\"version\":\"1.3.0\"}";
138
- /** keccak256 of {@link APP_DATA_DOC} — the `appData` field signed in the order. */
139
- declare const APP_DATA_HASH: `0x${string}`;
140
-
141
- //#endregion
142
- //#region src/cow/errors.d.ts
143
- /** The chain has no CoW order book. */
144
- declare class CowUnsupportedChainError extends PanopticError {
145
- readonly chainId: bigint;
146
- readonly name = "CowUnsupportedChainError";
147
- constructor(chainId: bigint, cause?: Error);
148
- }
149
- /** The order-book API rejected a request (non-2xx response). */
150
- declare class CowApiError extends PanopticError {
151
- /** Machine-readable API error type, e.g. 'SellAmountDoesNotCoverFee'. */
152
- readonly errorType: string;
153
- readonly status: number;
154
- readonly name: string;
155
- constructor(/** Machine-readable API error type, e.g. 'SellAmountDoesNotCoverFee'. */
156
- errorType: string, message: string, status: number, cause?: Error);
157
- }
158
- /** The sell amount is too small to cover the protocol fee (dust order). */
159
- declare class CowOrderTooSmallError extends CowApiError {
160
- readonly name = "CowOrderTooSmallError";
161
- constructor(message: string, status: number, cause?: Error);
162
- }
163
- /** Selling native ETH requires the eth-flow contract (unsupported here); buying it is fine. */
164
- declare class CowNativeTokenError extends PanopticError {
165
- readonly name = "CowNativeTokenError";
166
- constructor(cause?: Error);
167
- }
168
-
169
- //#endregion
170
- //#region src/cow/order.d.ts
171
- /**
172
- * Build the final order from a quote, sign it (EIP-712) and POST it to the
173
- * order book. The signed `feeAmount` is 0 — the fee is already folded into the
174
- * quote's `orderSellAmount`.
175
- */
176
- declare function signAndSubmitCowOrder(params: SignAndSubmitCowOrderParams): Promise<CowOrderResult>;
177
- /**
178
- * Cancel an open order off-chain (free, signed cancellation). Cancellation is
179
- * best-effort: an order already committed to a solver batch can still settle.
180
- */
181
- declare function cancelCowOrder(params: CancelCowOrderParams): Promise<void>;
182
-
183
- //#endregion
184
- //#region src/cow/quote.d.ts
185
- /** Default order validity window (30 minutes). */
186
- declare const DEFAULT_VALID_FOR_SECONDS = 1800n;
187
- /**
188
- * Quote a swap via the CoW order book.
189
- *
190
- * For `kind: 'sell'` (exact-in) `amount` is the sell amount before fee; for
191
- * `kind: 'buy'` (exact-out) it is the exact buy amount. The returned
192
- * `orderSellAmount`/`orderBuyAmount` are ready to sign: the fee is folded into
193
- * the sell side (orders are placed with `feeAmount: 0` under the current fee
194
- * model) and `slippageBps` is applied to the non-exact side.
195
- */
196
- declare function quoteCowSwap(params: QuoteCowSwapParams): Promise<SimulationResult<CowQuote>>;
197
-
198
- //#endregion
199
- //#region src/cow/status.d.ts
200
- /**
201
- * Fetch an order's lifecycle state. Once any trade has executed, the
202
- * settlement tx hash is included (fetched from the trades endpoint).
203
- */
204
- declare function getCowOrderStatus(params: GetCowOrderStatusParams): Promise<CowOrderState>;
205
-
206
- //#endregion
207
- //#region src/cow/tokens.d.ts
208
- /** Resolved token-list entry. */
209
- interface CowTokenInfo {
210
- chainId: number;
211
- address: Address;
212
- symbol: string;
213
- name: string;
214
- decimals: number;
215
- logoURI?: string;
216
- }
217
- /** Parameters for {@link findCowToken}. */
218
- interface FindCowTokenParams {
219
- /** Chain to resolve on. */
220
- chainId: bigint;
221
- /** Token symbol, case-insensitive (e.g. 'nvdax'). */
222
- symbol: string;
223
- /** Override the token-list URLs (e.g. tests). */
224
- listUrls?: string[];
225
- }
226
- /**
227
- * Find a token by symbol on the given chain across CoW's token lists. The
228
- * first list containing a (case-insensitive) symbol match wins; within a
229
- * list the first match wins, which favors canonical entries on collisions.
230
- * Returns null when no list resolves the symbol (or all fetches fail).
231
- *
232
- * Resolution only proves the token is listed — whether solvers can actually
233
- * fill a given pair/size is answered by `quoteCowSwap`.
234
- */
235
- declare function findCowToken(params: FindCowTokenParams): Promise<CowTokenInfo | null>;
236
-
237
- //#endregion
238
- //#region src/cow/xstockWrappers.generated.d.ts
239
- declare const XSTOCK_WRAPPERS: XstockWrapperRegistry;
240
-
241
- //#endregion
242
- //#region src/cow/xstockWrappers.d.ts
243
- /** A single xStock → wrapper mapping entry. */
244
- interface XstockWrapperInfo {
245
- /** ERC4626 wrapper (the token Panoptic/Uniswap pools trade). */
246
- wrapper: Address;
247
- /** Underlying rebasing xStock (`asset()` of the wrapper; the CoW-traded token). */
248
- underlying: Address;
249
- /** Wrapper symbol, e.g. `wNVDAx`. */
250
- symbol: string;
251
- /** Wrapper name, e.g. `Wrapped NVIDIA xStock`. */
252
- name: string;
253
- /** Wrapper (and underlying) ERC20 decimals. */
254
- decimals: number;
255
- }
256
- /** Generated registry keyed by chainId. */
257
- type XstockWrapperRegistry = Partial<Record<number, XstockWrapperInfo[]>>;
258
- /**
259
- * Resolve the wrapper for an unwrapped xStock. Returns `undefined` when the
260
- * address isn't a known xStock underlying on this chain.
261
- */
262
- declare function getXstockWrapper(chainId: number, underlying: Address): XstockWrapperInfo | undefined;
263
- /**
264
- * Resolve the underlying xStock for a wrapper address. Returns `undefined` when
265
- * the address isn't a known xStock wrapper on this chain.
266
- */
267
- declare function getXstockUnderlying(chainId: number, wrapper: Address): XstockWrapperInfo | undefined;
268
- /** True if `address` is a known unwrapped xStock on this chain. */
269
- declare function isXstockUnderlying(chainId: number, address: Address): boolean;
270
- /** True if `address` is a known xStock wrapper on this chain. */
271
- declare function isXstockWrapper(chainId: number, address: Address): boolean;
272
-
273
- //#endregion
274
- export { APP_DATA_DOC as APP_DATA_DOC$1, APP_DATA_HASH as APP_DATA_HASH$1, BestVenue, COW_API_URLS as COW_API_URLS$1, COW_CANCELLATION_TYPES as COW_CANCELLATION_TYPES$1, COW_NATIVE_ETH as COW_NATIVE_ETH$1, COW_ORDER_TYPES as COW_ORDER_TYPES$1, COW_SETTLEMENT as COW_SETTLEMENT$1, COW_VAULT_RELAYER as COW_VAULT_RELAYER$1, CowApiError as CowApiError$1, CowNativeTokenError as CowNativeTokenError$1, CowOrderTooSmallError as CowOrderTooSmallError$1, CowTokenInfo, CowUnsupportedChainError as CowUnsupportedChainError$1, DEFAULT_VALID_FOR_SECONDS as DEFAULT_VALID_FOR_SECONDS$1, FindCowTokenParams, PickBestVenueParams, SwapVenue, XSTOCK_WRAPPERS as XSTOCK_WRAPPERS$1, XstockWrapperInfo, XstockWrapperRegistry, approveErc20ForCow as approveErc20ForCow$1, cancelCowOrder as cancelCowOrder$1, checkCowApproval as checkCowApproval$1, cowDomain as cowDomain$1, findCowToken as findCowToken$1, getCowOrderStatus as getCowOrderStatus$1, getXstockUnderlying as getXstockUnderlying$1, getXstockWrapper as getXstockWrapper$1, isCowSupportedChain as isCowSupportedChain$1, isXstockUnderlying as isXstockUnderlying$1, isXstockWrapper as isXstockWrapper$1, pickBestVenue as pickBestVenue$1, quoteCowSwap as quoteCowSwap$1, signAndSubmitCowOrder as signAndSubmitCowOrder$1 };
275
- //# sourceMappingURL=index-CttjEZ-S.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CttjEZ-S.d.ts","names":["Address","COW_SETTLEMENT","COW_VAULT_RELAYER","COW_NATIVE_ETH","COW_API_URLS","Record","Partial","isCowSupportedChain","TxResult","ApproveErc20ForCowParams","CheckCowApprovalParams","CowApprovalStatus","checkCowApproval","Promise","approveErc20ForCow","SwapVenue","PickBestVenueParams","BestVenue","pickBestVenue","Address","COW_ORDER_TYPES","COW_CANCELLATION_TYPES","cowDomain","APP_DATA_DOC","APP_DATA_HASH","PanopticError","CowUnsupportedChainError","Error","CowApiError","CowOrderTooSmallError","CowNativeTokenError","CancelCowOrderParams","CowOrderResult","SignAndSubmitCowOrderParams","signAndSubmitCowOrder","Promise","cancelCowOrder","SimulationResult","CowQuote","QuoteCowSwapParams","DEFAULT_VALID_FOR_SECONDS","quoteCowSwap","Promise","CowOrderState","GetCowOrderStatusParams","getCowOrderStatus","Promise","Address","CowTokenInfo","FindCowTokenParams","findCowToken","Promise","XstockWrapperRegistry","XSTOCK_WRAPPERS","Address","XSTOCK_WRAPPERS","XstockWrapperInfo","XstockWrapperRegistry","Record","Partial","getXstockWrapper","getXstockUnderlying","isXstockUnderlying","isXstockWrapper"],"sources":["../src/cow/addresses.d.ts","../src/cow/approval.d.ts","../src/cow/compare.d.ts","../src/cow/eip712.d.ts","../src/cow/errors.d.ts","../src/cow/order.d.ts","../src/cow/quote.d.ts","../src/cow/status.d.ts","../src/cow/tokens.d.ts","../src/cow/xstock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.ts
4
- /**
5
- * Calculate the NET (user-experienced) payoff value for a width=0 (loan/credit) leg.
6
- *
7
- * Unlike `getLegValueWidth0` (debt-only), this includes the collateral/holding side and
8
- * therefore depends on how the position was opened:
9
- *
10
- * - **Cover at mint** (`swapAtMint = false`): the collateral is sourced in the SAME token as
11
- * the debt/credit, so the holding side exactly offsets it → net PnL is FLAT (0 everywhere,
12
- * mint-relative), regardless of which token the leg is denominated in.
13
- * - **Zap** (`swapAtMint = true`): the collateral is sourced in the OTHER token, leaving a
14
- * ±1-delta line in the asset (ETH), anchored to 0 at the mint price:
15
- * - USDC loan → zap to ETH: +1 (long ETH)
16
- * - ETH loan → zap to USDC: −1 (short ETH)
17
- * - USDC credit ← zap from ETH: −1 (short ETH)
18
- * - ETH credit ← zap from USDC: +1 (long ETH)
19
- *
20
- * @returns Net leg value in numeraire token smallest units (mint-relative PnL).
21
- */
22
-
23
- /**
24
- * Calculate the NET (user-experienced) payoff value for a width=0 (loan/credit) leg.
25
- *
26
- * Unlike `getLegValueWidth0` (debt-only), this includes the collateral/holding side and
27
- * therefore depends on how the position was opened:
28
- *
29
- * - **Cover at mint** (`swapAtMint = false`): the collateral is sourced in the SAME token as
30
- * the debt/credit, so the holding side exactly offsets it → net PnL is FLAT (0 everywhere,
31
- * mint-relative), regardless of which token the leg is denominated in.
32
- * - **Zap** (`swapAtMint = true`): the collateral is sourced in the OTHER token, leaving a
33
- * ±1-delta line in the asset (ETH), anchored to 0 at the mint price:
34
- * - USDC loan → zap to ETH: +1 (long ETH)
35
- * - ETH loan → zap to USDC: −1 (short ETH)
36
- * - USDC credit ← zap from ETH: −1 (short ETH)
37
- * - ETH credit ← zap from USDC: +1 (long ETH)
38
- *
39
- * @returns Net leg value in numeraire token smallest units (mint-relative PnL).
40
- */
41
- declare function getLegNetValueWidth0(leg: TokenIdLeg, m: bigint, qCurrentTick: bigint, qMintTick: bigint, isAssetToken0: boolean, swapAtMint: boolean, itmOffsetNotional?: bigint): bigint;
42
- /**
43
- * Check if leg is a call option (vs put).
44
- *
45
- * A call is when the leg moves the asset token:
46
- * - If asset is token0: call when tokenType=0
47
- * - If asset is token1: call when tokenType=1
48
- */
49
- declare function isCall(tokenType: bigint, isAssetToken0: boolean): boolean;
50
- /**
51
- * Check if position has defined risk (is a spread).
52
- *
53
- * A position is defined risk if it has 2+ legs of the same tokenType
54
- * with both long and short exposure.
55
- */
56
- declare function isDefinedRisk(legs: Pick<TokenIdLeg, 'tokenType' | 'isLong'>[]): boolean;
57
- /**
58
- * Calculate the value of a single leg.
59
- *
60
- * Value represents the current P&L of the position in numeraire token units.
61
- * Combines base value (from Panoptic's piecewise formula), debt, and ITM adjustment.
62
- *
63
- * Uses sqrtPriceX96 for all calculations to maintain precision and on-chain fidelity.
64
- *
65
- * @param leg - The leg to calculate
66
- * @param currentTick - Current pool tick
67
- * @param mintTick - Tick at position mint
68
- * @param positionSize - Position size in asset token smallest units
69
- * @param poolTickSpacing - Pool tick spacing
70
- * @param definedRisk - Whether position is defined risk
71
- * @param assetIndex - Optional override for leg.asset (0n = token0 is asset, 1n = token1)
72
- * @returns Leg value in numeraire token smallest units
73
- */
74
- declare function getLegValue(leg: TokenIdLeg, currentTick: bigint, mintTick: bigint, positionSize: bigint, poolTickSpacing: bigint, definedRisk: boolean, assetIndex?: bigint, swapAtMint?: boolean): bigint;
75
- /**
76
- * Calculate the delta of a single leg.
77
- *
78
- * Delta is the rate of change of position value with respect to price.
79
- * For puts: delta = vDelta
80
- * For calls: delta = debtDelta + vDelta + itmDelta (if not defined risk)
81
- *
82
- * Uses sqrtPriceX96 for all price calculations to maintain precision.
83
- *
84
- * @param leg - The leg to calculate
85
- * @param currentTick - Current pool tick
86
- * @param positionSize - Position size in asset token smallest units
87
- * @param poolTickSpacing - Pool tick spacing
88
- * @param mintTick - Tick at mint (optional, for ITM adjustment)
89
- * @param definedRisk - Whether position is defined risk
90
- * @param assetIndex - Optional override for leg.asset (0n = token0 is asset, 1n = token1)
91
- * @returns Leg delta in asset token smallest units
92
- */
93
- declare function getLegDelta(leg: TokenIdLeg, currentTick: bigint, positionSize: bigint, poolTickSpacing: bigint, mintTick: bigint | undefined, definedRisk: boolean, assetIndex?: bigint): bigint;
94
- /** Convert a delta between token frames at the current pool tick. */
95
- declare function toVaultFrameAtTick(delta: bigint, fromAsset: bigint, vaultAssetIndex: 0n | 1n, currentTick: bigint, flipSignOnAssetInversion?: boolean): bigint;
96
- /**
97
- * Calculate one leg's wallet-aware delta in the vault asset frame.
98
- *
99
- * Width-zero loans and credits must be evaluated directly in the vault frame.
100
- * Option legs remain in their natural leg frame until converted at the mark tick.
101
- */
102
- declare function getLegDeltaInVaultFrame(leg: TokenIdLeg, currentTick: bigint, positionSize: bigint, poolTickSpacing: bigint, mintTick: bigint | undefined, definedRisk: boolean, vaultAssetIndex: 0n | 1n): bigint;
103
- /**
104
- * Calculate the gamma (dollar gamma) of a single leg.
105
- *
106
- * Formula: gamma = (m * sqrt(K * P * r)) / (2 * (r - 1))
107
- * where:
108
- * - m = positionSize * optionRatio (with sign based on long/short)
109
- * - K = strike price (numeraire/asset)
110
- * - P = current price (numeraire/asset)
111
- * - r = 1.0001^(width*tickSpacing/2) ≈ 1 (dimensionless ratio)
112
- *
113
- * Uses sqrtPriceX96 arithmetic:
114
- * - sqrt(K*P*r) = tickToSqrtPriceX96(strikeₜ + currentₜ + widthₜ/2)
115
- * - Keeps X96/X192 precision until final division
116
- *
117
- * @param leg - The leg to calculate
118
- * @param currentTick - Current pool tick
119
- * @param positionSize - Position size in asset token smallest units
120
- * @param poolTickSpacing - Pool tick spacing
121
- * @param assetIndex - Optional override for leg.asset (0n = token0 is asset, 1n = token1)
122
- * @returns Leg gamma in numeraire token smallest units
123
- */
124
- declare function getLegGamma(leg: TokenIdLeg, currentTick: bigint, positionSize: bigint, poolTickSpacing: bigint, assetIndex?: bigint): bigint;
125
- /**
126
- * Parameters for position-level greek calculations.
127
- */
128
- interface PositionGreeksInput {
129
- /** Position legs */
130
- legs: TokenIdLeg[];
131
- /** Current pool tick */
132
- currentTick: bigint;
133
- /** Tick at position mint */
134
- mintTick: bigint;
135
- /** Position size in asset token smallest units */
136
- positionSize: bigint;
137
- /** Pool tick spacing */
138
- poolTickSpacing: bigint;
139
- /** Optional override for leg.asset on all legs (0n = token0 is asset, 1n = token1) */
140
- assetIndex?: bigint;
141
- /**
142
- * How width=0 (loan/credit) legs were opened. When provided, `calculatePositionValue`
143
- * returns the NET user-experienced payoff for those legs (Zap = ±1 line, Cover = flat)
144
- * instead of the debt-only value. Leave undefined for delta/greeks aggregation, which
145
- * accounts for the held collateral separately.
146
- */
147
- swapAtMint?: boolean;
148
- }
149
- /**
150
- * Calculate total value across all legs.
151
- */
152
- declare function calculatePositionValue(input: PositionGreeksInput): bigint;
153
- /**
154
- * Calculate total delta across all legs.
155
- */
156
- declare function calculatePositionDelta(input: PositionGreeksInput): bigint;
157
- /**
158
- * Calculate debt-only position delta in a single target asset frame.
159
- *
160
- * Option legs are first valued in their natural `leg.asset` frame, then
161
- * converted into `assetIndex` using the current pool price. Width-zero legs
162
- * are evaluated directly in the target frame.
163
- *
164
- * Width=0 loan/credit legs include only their debt obligation. The held-token
165
- * side must be added separately from account collateral balances, preventing a
166
- * zap from being counted once in the position and again in collateral.
167
- */
168
- declare function calculatePositionDeltaDebtOnly(input: Omit<PositionGreeksInput, 'assetIndex' | 'swapAtMint'> & {
169
- assetIndex: 0n | 1n;
170
- }): bigint;
171
- /**
172
- * Calculate total gamma across all legs.
173
- */
174
- declare function calculatePositionGamma(input: PositionGreeksInput): bigint;
175
- /**
176
- * Position greeks result.
177
- */
178
- interface PositionGreeksResult {
179
- /** Position value in numeraire token smallest units */
180
- value: bigint;
181
- /** Position delta in asset token smallest units */
182
- delta: bigint;
183
- /** Position gamma in numeraire token smallest units */
184
- gamma: bigint;
185
- }
186
- /**
187
- * Calculate all greeks for a position.
188
- */
189
- declare function calculatePositionGreeks(input: PositionGreeksInput): PositionGreeksResult;
190
- /**
191
- * Aggregate value across multiple independent positions.
192
- *
193
- * Each entry is valued with its OWN `positionSize`, `mintTick`, and legs, then
194
- * summed. Do NOT collapse multiple positions into one synthetic `PositionGreeksInput`
195
- * with a shared `positionSize` — `m = positionSize * optionRatio` is per-position, so a
196
- * shared size double-counts (and integer `optionRatio` cannot encode fractional shares).
197
- *
198
- * @param positions - One `PositionGreeksInput` per open position
199
- * @returns Total value in numeraire token smallest units
200
- */
201
- declare function calculatePortfolioValue(positions: PositionGreeksInput[]): bigint;
202
- /**
203
- * Aggregate delta across multiple independent positions.
204
- *
205
- * See {@link calculatePortfolioValue} for why each position must keep its own
206
- * `positionSize` rather than being merged into one synthetic position.
207
- *
208
- * @param positions - One `PositionGreeksInput` per open position
209
- * @returns Total delta in asset token smallest units
210
- */
211
- declare function calculatePortfolioDelta(positions: PositionGreeksInput[]): bigint;
212
- /**
213
- * Aggregate gamma across multiple independent positions.
214
- *
215
- * See {@link calculatePortfolioValue} for why each position must keep its own
216
- * `positionSize` rather than being merged into one synthetic position.
217
- *
218
- * @param positions - One `PositionGreeksInput` per open position
219
- * @returns Total gamma in numeraire token smallest units
220
- */
221
- declare function calculatePortfolioGamma(positions: PositionGreeksInput[]): bigint;
222
- /**
223
- * Calculate all greeks aggregated across multiple independent positions.
224
- */
225
- declare function calculatePortfolioGreeks(positions: PositionGreeksInput[]): PositionGreeksResult;
226
- /**
227
- * Calculate the effective delta of a loan leg accounting for swapAtMint.
228
- *
229
- * A loan borrows one token and (optionally) swaps it for the other at mint.
230
- * The net delta depends on whether the swap occurred:
231
- *
232
- * | Scenario | Result |
233
- * |-----------------------|-------------------------------------------------|
234
- * | No swap | 0n (hold what you owe, net zero) |
235
- * | Swap + borrows asset | -m (hold numeraire, owe asset → short exposure) |
236
- * | Swap + borrows numer. | +m (hold asset, owe numeraire → long exposure) |
237
- *
238
- * Only meaningful for legs with `width === 0n`. For options, use `getLegDelta`.
239
- *
240
- * @param leg - The loan leg
241
- * @param positionSize - Position size in asset token smallest units
242
- * @param swapAtMint - Whether the borrowed tokens were swapped at mint
243
- * @param assetIndex - Optional override for leg.asset (0n = token0 is asset)
244
- * @returns Effective delta in asset token smallest units
245
- */
246
- declare function getLoanEffectiveDelta(leg: TokenIdLeg, positionSize: bigint, swapAtMint: boolean, assetIndex?: bigint): bigint;
247
- /**
248
- * Calculate total delta for a position, using swap-aware delta for loan legs.
249
- *
250
- * For legs with `width === 0n` (loans/credits), uses `getLoanEffectiveDelta`
251
- * which accounts for the swapAtMint flag. For option legs (`width > 0n`),
252
- * uses the standard `getLegDelta`.
253
- *
254
- * @param input - Position greeks input plus swapAtMint flag
255
- * @returns Total delta in asset token smallest units
256
- */
257
- declare function calculatePositionDeltaWithSwap(input: PositionGreeksInput & {
258
- swapAtMint: boolean;
259
- }): bigint; //#endregion
260
- export { PositionGreeksInput, PositionGreeksResult, calculatePortfolioDelta as calculatePortfolioDelta$1, calculatePortfolioGamma as calculatePortfolioGamma$1, calculatePortfolioGreeks as calculatePortfolioGreeks$1, calculatePortfolioValue as calculatePortfolioValue$1, calculatePositionDelta as calculatePositionDelta$1, calculatePositionDeltaDebtOnly as calculatePositionDeltaDebtOnly$1, calculatePositionDeltaWithSwap as calculatePositionDeltaWithSwap$1, calculatePositionGamma as calculatePositionGamma$1, calculatePositionGreeks as calculatePositionGreeks$1, calculatePositionValue as calculatePositionValue$1, getLegDelta as getLegDelta$1, getLegDeltaInVaultFrame as getLegDeltaInVaultFrame$1, getLegGamma as getLegGamma$1, getLegNetValueWidth0 as getLegNetValueWidth0$1, getLegValue as getLegValue$1, getLoanEffectiveDelta as getLoanEffectiveDelta$1, isCall as isCall$1, isDefinedRisk as isDefinedRisk$1, toVaultFrameAtTick as toVaultFrameAtTick$1 };
261
- //# sourceMappingURL=index-DktZq9Kb.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-DktZq9Kb.d.ts","names":["TokenIdLeg","getLegNetValueWidth0","isCall","isDefinedRisk","Pick","getLegValue","getLegDelta","toVaultFrameAtTick","getLegDeltaInVaultFrame","getLegGamma","PositionGreeksInput","calculatePositionValue","calculatePositionDelta","calculatePositionDeltaDebtOnly","Omit","calculatePositionGamma","PositionGreeksResult","calculatePositionGreeks","calculatePortfolioValue","calculatePortfolioDelta","calculatePortfolioGamma","calculatePortfolioGreeks","getLoanEffectiveDelta","calculatePositionDeltaWithSwap"],"sources":["../src/panoptic/v2/greeks/index.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;;;;;;;AAQA;;;;;;iBARwBC,oBAAAA,MAA0BD;AAelD;;;;AAAgD;;;iBAPxBE,MAAAA;;;;;;;iBAOAC,aAAAA,OAAoBC,KAAKJ;;;;;;;;AAkBjD;;;;;;;;;;iBAAwBK,WAAAA,MAAiBL;;;;;;;;;AAmBzC;;AAEA;;;;;;;AAOA;iBATwBM,WAAAA,MAAiBN;;iBAEjBO,kBAAAA;;;;;;;iBAOAC,uBAAAA,MAA6BR;;;;;;;;;;;;AAsBrD;;;;AAIA;;;;AAwBA;;iBA5BwBS,WAAAA,MAAiBT;;AAgCzC;;UA5BiBU,mBAAAA;;QAEPV;;;;;;;;EAsCca,eAAAA,EAAAA,MAAAA;EAA8B;EAAA,UAAaH,CAAAA,EAAAA,MAAAA;EAAmB;AAApB;;;;AAMlE;;;;AAIA;;iBA1BwBC,sBAAAA,QAA8BD;;AAqCtD;;AAAuDA,iBAjC/BE,sBAAAA,CAiC+BF,KAAAA,EAjCDA,mBAiCCA,CAAAA,EAAAA,MAAAA;;AAA0C;;;;;;;;;;iBArBzEG,8BAAAA,QAAsCC,KAAKJ;;AAiCnE,CAAA,CAAA,EAAwBQ,MAAAA;;;;iBA3BAH,sBAAAA,QAA8BL;;;;UAIrCM,oBAAAA;;EAiCOG,KAAAA,EAAAA,MAAAA;;;;;;;;;iBAtBAF,uBAAAA,QAA+BP,sBAAsBM;AAgC7E;;;;AAIA;;;;AAAwG;;;iBAxBhFE,uBAAAA,YAAmCR;;;;;;;;;;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