@panoptic-eng/sdk 1.0.66 → 1.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chainDeployments-Do4NaZA_.js → chainDeployments-CwnYHCg7.js} +16 -10
- package/dist/cow/index.d.ts.map +1 -1
- package/dist/cow/index.js +40 -0
- package/dist/cow/index.js.map +1 -1
- package/dist/{cow-BU9YOHkh.js → cow-CGgPXhY6.js} +1 -1
- package/dist/deployments.js +16 -10
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -10
- package/dist/index.js.map +1 -1
- package/dist/{irm-DGyKOQXz.js → irm-BDxwCFDm.js} +2 -2
- package/dist/panoptic/v2/index.d.ts +1 -1
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +91 -15
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.d.ts +1 -1
- package/dist/panoptic/v2/react-public.d.ts.map +1 -1
- package/dist/panoptic/v2/react-public.js +91 -15
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/{rates-Y0Pbv1_x.js → rates-BHS-Qiu7.js} +75 -5
- package/dist/{router-BdTeFnXO.js → router-BW6TqwOO.js} +2 -2
- package/dist/{router-BVcXE0rP.js → router-IDtCENST.js} +2 -2
- package/dist/{transactionFees-BF033Mob.js → transactionFees-B4jz-v7d.js} +1 -1
- package/dist/uniswap/index.js +71 -1
- package/dist/uniswap/index.js.map +1 -1
- package/dist/{v2-wJ4fbRYA.js → v2-Dgh6JxG_.js} +5 -5
- package/dist/vault-transaction-fees.js +16 -10
- package/dist/vault-transaction-fees.js.map +1 -1
- package/dist/{writes-CLr29ugc.js → writes-CG612Vuk.js} +1 -1
- package/dist/zodiac/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -13683,6 +13683,76 @@ function diagnoseOracleSafeMode(state, parameters, onchainLevel) {
|
|
|
13683
13683
|
};
|
|
13684
13684
|
}
|
|
13685
13685
|
|
|
13686
|
+
//#endregion
|
|
13687
|
+
//#region src/panoptic/v2/reads/riskEngineDeployment.ts
|
|
13688
|
+
const IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
|
|
13689
|
+
const PROXIES = new Set(["0x000000000000ffe5efdb5ae76b9200263c58b4c0", "0x000000000000ffada7c641e2ad6b13b51b50cc94"]);
|
|
13690
|
+
const BLUE_CHIP = {
|
|
13691
|
+
DECIMALS: 10000000n,
|
|
13692
|
+
VEGOID: 8,
|
|
13693
|
+
CROSS_BUFFER_0: 9000000n,
|
|
13694
|
+
CROSS_BUFFER_1: 9000000n,
|
|
13695
|
+
EMA_PERIODS: 4533471891108855828971580n,
|
|
13696
|
+
MAX_TICKS_DELTA: 724n,
|
|
13697
|
+
MAX_CLAMP_DELTA: 149,
|
|
13698
|
+
MAX_TWAP_DELTA_DISPATCH: 513,
|
|
13699
|
+
MAX_SPREAD: 9e4,
|
|
13700
|
+
BP_DECREASE_BUFFER: 1075e4,
|
|
13701
|
+
SELLER_COLLATERAL_RATIO: 2000000n,
|
|
13702
|
+
BUYER_COLLATERAL_RATIO: 100000n,
|
|
13703
|
+
MAINT_MARGIN_RATE: 1000000n,
|
|
13704
|
+
LOAN_MARGIN_DIVISOR: 4n,
|
|
13705
|
+
FORCE_EXERCISE_COST: 5000000n,
|
|
13706
|
+
TARGET_POOL_UTIL: 6666667n,
|
|
13707
|
+
SATURATED_POOL_UTIL: 9000000n,
|
|
13708
|
+
MAX_OPEN_LEGS: 26n,
|
|
13709
|
+
MAX_BONUS: 2000000n,
|
|
13710
|
+
NOTIONAL_FEE: 3,
|
|
13711
|
+
PREMIUM_FEE: 250,
|
|
13712
|
+
PROTOCOL_SPLIT: 5e3,
|
|
13713
|
+
BUILDER_SPLIT: 4e3,
|
|
13714
|
+
MIN_RATE_AT_TARGET: 634195839n
|
|
13715
|
+
};
|
|
13716
|
+
const IMPLEMENTATIONS = {
|
|
13717
|
+
"0x000000000000f0b287c19f606bc3a471f260c502": BLUE_CHIP,
|
|
13718
|
+
"0x000000000000f4901018445c697e1e358dab8dad": {
|
|
13719
|
+
...BLUE_CHIP,
|
|
13720
|
+
CROSS_BUFFER_0: 7500000n,
|
|
13721
|
+
CROSS_BUFFER_1: 7500000n,
|
|
13722
|
+
EMA_PERIODS: 9066943782217711657943160n,
|
|
13723
|
+
MAX_TICKS_DELTA: 953n,
|
|
13724
|
+
MAINT_MARGIN_RATE: 2500000n
|
|
13725
|
+
}
|
|
13726
|
+
};
|
|
13727
|
+
/** Resolve immutable getters from the implementation manifest and read dynamic state at the same block. */
|
|
13728
|
+
async function riskEngineMulticall(client, parameters) {
|
|
13729
|
+
const calls = parameters.contracts;
|
|
13730
|
+
const proxies = [...new Set(calls.map((call$1) => call$1.address.toLowerCase()))].filter((address) => PROXIES.has(address));
|
|
13731
|
+
if (proxies.length === 0) return client.multicall(parameters);
|
|
13732
|
+
const manifests = new Map(await Promise.all(proxies.map(async (address) => {
|
|
13733
|
+
const slot = await client.getStorageAt({
|
|
13734
|
+
address,
|
|
13735
|
+
slot: IMPLEMENTATION_SLOT,
|
|
13736
|
+
blockNumber: parameters.blockNumber
|
|
13737
|
+
});
|
|
13738
|
+
const implementation = slot?.length === 66 ? `0x${slot.slice(-40)}`.toLowerCase() : "";
|
|
13739
|
+
const manifest = IMPLEMENTATIONS[implementation];
|
|
13740
|
+
if (!manifest) throw new Error(`Unknown RiskEngine implementation ${implementation || "(missing)"} for ${address}; update the SDK deployment parameters`);
|
|
13741
|
+
return [address, manifest];
|
|
13742
|
+
})));
|
|
13743
|
+
const values = calls.map((call$1) => call$1.args?.length ? void 0 : manifests.get(call$1.address.toLowerCase())?.[call$1.functionName]);
|
|
13744
|
+
const liveCalls = calls.filter((_, index) => values[index] === void 0);
|
|
13745
|
+
const liveResults = liveCalls.length === 0 ? [] : await client.multicall({
|
|
13746
|
+
...parameters,
|
|
13747
|
+
contracts: liveCalls
|
|
13748
|
+
});
|
|
13749
|
+
let liveIndex = 0;
|
|
13750
|
+
return values.map((value) => value === void 0 ? liveResults[liveIndex++] : parameters.allowFailure === false ? value : {
|
|
13751
|
+
status: "success",
|
|
13752
|
+
result: value
|
|
13753
|
+
});
|
|
13754
|
+
}
|
|
13755
|
+
|
|
13686
13756
|
//#endregion
|
|
13687
13757
|
//#region src/panoptic/v2/reads/pool.ts
|
|
13688
13758
|
const erc20Abi$2 = [
|
|
@@ -13896,7 +13966,7 @@ async function getPool(params) {
|
|
|
13896
13966
|
abi: uniswapV3PoolAbi,
|
|
13897
13967
|
functionName: "liquidity"
|
|
13898
13968
|
} : null;
|
|
13899
|
-
const [dynamicResults, _meta] = await Promise.all([client
|
|
13969
|
+
const [dynamicResults, _meta] = await Promise.all([riskEngineMulticall(client, {
|
|
13900
13970
|
contracts: [
|
|
13901
13971
|
{
|
|
13902
13972
|
address: poolAddress,
|
|
@@ -14189,10 +14259,10 @@ async function getOracleState(params) {
|
|
|
14189
14259
|
_meta
|
|
14190
14260
|
};
|
|
14191
14261
|
}
|
|
14192
|
-
/**
|
|
14262
|
+
/** Resolve the oracle constants for a specific deployed RiskEngine at the target block. */
|
|
14193
14263
|
async function getOracleRiskParameters(params) {
|
|
14194
14264
|
const targetBlockNumber = params.blockNumber ?? await params.client.getBlockNumber();
|
|
14195
|
-
const [[emaPeriods, maxTicksDelta, maxClampDelta], _meta] = await Promise.all([params.client
|
|
14265
|
+
const [[emaPeriods, maxTicksDelta, maxClampDelta], _meta] = await Promise.all([riskEngineMulticall(params.client, {
|
|
14196
14266
|
contracts: [
|
|
14197
14267
|
{
|
|
14198
14268
|
address: params.riskEngineAddress,
|
|
@@ -14239,7 +14309,7 @@ async function getRiskParameters(params) {
|
|
|
14239
14309
|
abi: panopticPoolV2Abi,
|
|
14240
14310
|
functionName: "riskEngine"
|
|
14241
14311
|
});
|
|
14242
|
-
const [riskEngineResults, _meta] = await Promise.all([client
|
|
14312
|
+
const [riskEngineResults, _meta] = await Promise.all([riskEngineMulticall(client, {
|
|
14243
14313
|
contracts: [
|
|
14244
14314
|
{
|
|
14245
14315
|
address: riskEngineAddress,
|
|
@@ -25186,7 +25256,7 @@ async function getHedgeLimits({ client, poolAddress, account, positionIds, asset
|
|
|
25186
25256
|
});
|
|
25187
25257
|
const { collateralToken0Address: ct0, collateralToken1Address: ct1, riskEngineAddress: engine } = metadata;
|
|
25188
25258
|
if (metadata.fee >= 1000000n) throw new Error("A fixed swap fee is required for this estimate");
|
|
25189
|
-
const [full, currentTick, pool0, pool1, total0, total1, interest0, interest1, buffer, notionalFee, cross0, cross1, maxLegs, accountLegs, supply0, supply1] = await client
|
|
25259
|
+
const [full, currentTick, pool0, pool1, total0, total1, interest0, interest1, buffer, notionalFee, cross0, cross1, maxLegs, accountLegs, supply0, supply1] = await riskEngineMulticall(client, {
|
|
25190
25260
|
contracts: [
|
|
25191
25261
|
{
|
|
25192
25262
|
address: poolAddress,
|
|
@@ -32206,7 +32276,7 @@ var _1 = {
|
|
|
32206
32276
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
32207
32277
|
"semiFungiblePositionManagerV3": "0x00000000000005E4693aDc8Ec0f12D686f728198",
|
|
32208
32278
|
"builderFactory": "0x0000000000000a3D22E158417AA639D7F71b0FF7",
|
|
32209
|
-
"riskEngine": "
|
|
32279
|
+
"riskEngine": "0x000000000000ffE5eFdB5AE76b9200263C58b4c0",
|
|
32210
32280
|
"panopticPoolImplementation": "0x000000000000135429F0DaCaB61639Bf6a63EbbC",
|
|
32211
32281
|
"collateralTrackerImplementation": "0x0000000000001d9c38CA405A2e04420865A08A33",
|
|
32212
32282
|
"panopticFactoryV4": "0x0000000000000c51d0f8cf4bd9adE7191372a625",
|
|
@@ -32217,7 +32287,7 @@ var _1 = {
|
|
|
32217
32287
|
"interactionHelper": "0x00000000000041fe14Ce3c2392337CE501aE8328"
|
|
32218
32288
|
}
|
|
32219
32289
|
},
|
|
32220
|
-
"riskEngines": ["
|
|
32290
|
+
"riskEngines": ["0x000000000000ffE5eFdB5AE76b9200263C58b4c0", "0x000000000000FfADa7c641E2aD6B13b51b50Cc94"],
|
|
32221
32291
|
"markets": { "ethUsdc30bps": {
|
|
32222
32292
|
"currency0": "0x0000000000000000000000000000000000000000",
|
|
32223
32293
|
"currency1": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
@@ -32237,7 +32307,12 @@ var _1 = {
|
|
|
32237
32307
|
"fee": 500,
|
|
32238
32308
|
"weth": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
|
32239
32309
|
},
|
|
32240
|
-
"deprecatedRiskEngines": [
|
|
32310
|
+
"deprecatedRiskEngines": [
|
|
32311
|
+
"0x0000000000000e673aECBDB5f5fE5DFAf4a8e9Ac",
|
|
32312
|
+
"0x0000000000000E65545005B26207D7edFd031260",
|
|
32313
|
+
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
32314
|
+
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb"
|
|
32315
|
+
]
|
|
32241
32316
|
};
|
|
32242
32317
|
var _4663 = {
|
|
32243
32318
|
"chainId": 4663,
|
|
@@ -32295,7 +32370,7 @@ var _4663 = {
|
|
|
32295
32370
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
32296
32371
|
"semiFungiblePositionManagerV3": "0x00000000000005E4693aDc8Ec0f12D686f728198",
|
|
32297
32372
|
"builderFactory": "0x0000000000000a3D22E158417AA639D7F71b0FF7",
|
|
32298
|
-
"riskEngine": "
|
|
32373
|
+
"riskEngine": "0x000000000000FfADa7c641E2aD6B13b51b50Cc94",
|
|
32299
32374
|
"panopticPoolImplementation": "0x000000000000135429F0DaCaB61639Bf6a63EbbC",
|
|
32300
32375
|
"collateralTrackerImplementation": "0x0000000000001d9c38CA405A2e04420865A08A33",
|
|
32301
32376
|
"panopticFactoryV4": "0x0000000000000c51d0f8cf4bd9adE7191372a625",
|
|
@@ -32306,11 +32381,7 @@ var _4663 = {
|
|
|
32306
32381
|
"interactionHelper": "0x00000000000041fe14Ce3c2392337CE501aE8328"
|
|
32307
32382
|
}
|
|
32308
32383
|
},
|
|
32309
|
-
"riskEngines": [
|
|
32310
|
-
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
32311
|
-
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb",
|
|
32312
|
-
"0x0000000000000f3fb82469581A74776178E76Ca4"
|
|
32313
|
-
],
|
|
32384
|
+
"riskEngines": ["0x000000000000ffE5eFdB5AE76b9200263C58b4c0", "0x000000000000FfADa7c641E2aD6B13b51b50Cc94"],
|
|
32314
32385
|
"markets": {
|
|
32315
32386
|
"spyUsdg": {
|
|
32316
32387
|
"currency0": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
@@ -32338,7 +32409,12 @@ var _4663 = {
|
|
|
32338
32409
|
"hypovault": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/hypovault-subgraph-robinhood/prod/gn",
|
|
32339
32410
|
"panoptic": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/panoptic-subgraph-robinhood/v2_prod/gn"
|
|
32340
32411
|
},
|
|
32341
|
-
"deprecatedRiskEngines": [
|
|
32412
|
+
"deprecatedRiskEngines": [
|
|
32413
|
+
"0x0000000000000E65545005B26207D7edFd031260",
|
|
32414
|
+
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
32415
|
+
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb",
|
|
32416
|
+
"0x0000000000000f3fb82469581A74776178E76Ca4"
|
|
32417
|
+
]
|
|
32342
32418
|
};
|
|
32343
32419
|
var _8453 = {
|
|
32344
32420
|
"chainId": 8453,
|