@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
|
@@ -13680,6 +13680,76 @@ function diagnoseOracleSafeMode(state, parameters, onchainLevel) {
|
|
|
13680
13680
|
};
|
|
13681
13681
|
}
|
|
13682
13682
|
|
|
13683
|
+
//#endregion
|
|
13684
|
+
//#region src/panoptic/v2/reads/riskEngineDeployment.ts
|
|
13685
|
+
const IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
|
|
13686
|
+
const PROXIES = new Set(["0x000000000000ffe5efdb5ae76b9200263c58b4c0", "0x000000000000ffada7c641e2ad6b13b51b50cc94"]);
|
|
13687
|
+
const BLUE_CHIP = {
|
|
13688
|
+
DECIMALS: 10000000n,
|
|
13689
|
+
VEGOID: 8,
|
|
13690
|
+
CROSS_BUFFER_0: 9000000n,
|
|
13691
|
+
CROSS_BUFFER_1: 9000000n,
|
|
13692
|
+
EMA_PERIODS: 4533471891108855828971580n,
|
|
13693
|
+
MAX_TICKS_DELTA: 724n,
|
|
13694
|
+
MAX_CLAMP_DELTA: 149,
|
|
13695
|
+
MAX_TWAP_DELTA_DISPATCH: 513,
|
|
13696
|
+
MAX_SPREAD: 9e4,
|
|
13697
|
+
BP_DECREASE_BUFFER: 1075e4,
|
|
13698
|
+
SELLER_COLLATERAL_RATIO: 2000000n,
|
|
13699
|
+
BUYER_COLLATERAL_RATIO: 100000n,
|
|
13700
|
+
MAINT_MARGIN_RATE: 1000000n,
|
|
13701
|
+
LOAN_MARGIN_DIVISOR: 4n,
|
|
13702
|
+
FORCE_EXERCISE_COST: 5000000n,
|
|
13703
|
+
TARGET_POOL_UTIL: 6666667n,
|
|
13704
|
+
SATURATED_POOL_UTIL: 9000000n,
|
|
13705
|
+
MAX_OPEN_LEGS: 26n,
|
|
13706
|
+
MAX_BONUS: 2000000n,
|
|
13707
|
+
NOTIONAL_FEE: 3,
|
|
13708
|
+
PREMIUM_FEE: 250,
|
|
13709
|
+
PROTOCOL_SPLIT: 5e3,
|
|
13710
|
+
BUILDER_SPLIT: 4e3,
|
|
13711
|
+
MIN_RATE_AT_TARGET: 634195839n
|
|
13712
|
+
};
|
|
13713
|
+
const IMPLEMENTATIONS = {
|
|
13714
|
+
"0x000000000000f0b287c19f606bc3a471f260c502": BLUE_CHIP,
|
|
13715
|
+
"0x000000000000f4901018445c697e1e358dab8dad": {
|
|
13716
|
+
...BLUE_CHIP,
|
|
13717
|
+
CROSS_BUFFER_0: 7500000n,
|
|
13718
|
+
CROSS_BUFFER_1: 7500000n,
|
|
13719
|
+
EMA_PERIODS: 9066943782217711657943160n,
|
|
13720
|
+
MAX_TICKS_DELTA: 953n,
|
|
13721
|
+
MAINT_MARGIN_RATE: 2500000n
|
|
13722
|
+
}
|
|
13723
|
+
};
|
|
13724
|
+
/** Resolve immutable getters from the implementation manifest and read dynamic state at the same block. */
|
|
13725
|
+
async function riskEngineMulticall(client, parameters) {
|
|
13726
|
+
const calls = parameters.contracts;
|
|
13727
|
+
const proxies = [...new Set(calls.map((call$1) => call$1.address.toLowerCase()))].filter((address) => PROXIES.has(address));
|
|
13728
|
+
if (proxies.length === 0) return client.multicall(parameters);
|
|
13729
|
+
const manifests = new Map(await Promise.all(proxies.map(async (address) => {
|
|
13730
|
+
const slot = await client.getStorageAt({
|
|
13731
|
+
address,
|
|
13732
|
+
slot: IMPLEMENTATION_SLOT,
|
|
13733
|
+
blockNumber: parameters.blockNumber
|
|
13734
|
+
});
|
|
13735
|
+
const implementation = slot?.length === 66 ? `0x${slot.slice(-40)}`.toLowerCase() : "";
|
|
13736
|
+
const manifest = IMPLEMENTATIONS[implementation];
|
|
13737
|
+
if (!manifest) throw new Error(`Unknown RiskEngine implementation ${implementation || "(missing)"} for ${address}; update the SDK deployment parameters`);
|
|
13738
|
+
return [address, manifest];
|
|
13739
|
+
})));
|
|
13740
|
+
const values = calls.map((call$1) => call$1.args?.length ? void 0 : manifests.get(call$1.address.toLowerCase())?.[call$1.functionName]);
|
|
13741
|
+
const liveCalls = calls.filter((_, index) => values[index] === void 0);
|
|
13742
|
+
const liveResults = liveCalls.length === 0 ? [] : await client.multicall({
|
|
13743
|
+
...parameters,
|
|
13744
|
+
contracts: liveCalls
|
|
13745
|
+
});
|
|
13746
|
+
let liveIndex = 0;
|
|
13747
|
+
return values.map((value) => value === void 0 ? liveResults[liveIndex++] : parameters.allowFailure === false ? value : {
|
|
13748
|
+
status: "success",
|
|
13749
|
+
result: value
|
|
13750
|
+
});
|
|
13751
|
+
}
|
|
13752
|
+
|
|
13683
13753
|
//#endregion
|
|
13684
13754
|
//#region src/panoptic/v2/reads/pool.ts
|
|
13685
13755
|
const erc20Abi$2 = [
|
|
@@ -13893,7 +13963,7 @@ async function getPool(params) {
|
|
|
13893
13963
|
abi: uniswapV3PoolAbi,
|
|
13894
13964
|
functionName: "liquidity"
|
|
13895
13965
|
} : null;
|
|
13896
|
-
const [dynamicResults, _meta] = await Promise.all([client
|
|
13966
|
+
const [dynamicResults, _meta] = await Promise.all([riskEngineMulticall(client, {
|
|
13897
13967
|
contracts: [
|
|
13898
13968
|
{
|
|
13899
13969
|
address: poolAddress,
|
|
@@ -14186,10 +14256,10 @@ async function getOracleState(params) {
|
|
|
14186
14256
|
_meta
|
|
14187
14257
|
};
|
|
14188
14258
|
}
|
|
14189
|
-
/**
|
|
14259
|
+
/** Resolve the oracle constants for a specific deployed RiskEngine at the target block. */
|
|
14190
14260
|
async function getOracleRiskParameters(params) {
|
|
14191
14261
|
const targetBlockNumber = params.blockNumber ?? await params.client.getBlockNumber();
|
|
14192
|
-
const [[emaPeriods, maxTicksDelta, maxClampDelta], _meta] = await Promise.all([params.client
|
|
14262
|
+
const [[emaPeriods, maxTicksDelta, maxClampDelta], _meta] = await Promise.all([riskEngineMulticall(params.client, {
|
|
14193
14263
|
contracts: [
|
|
14194
14264
|
{
|
|
14195
14265
|
address: params.riskEngineAddress,
|
|
@@ -14236,7 +14306,7 @@ async function getRiskParameters(params) {
|
|
|
14236
14306
|
abi: panopticPoolV2Abi,
|
|
14237
14307
|
functionName: "riskEngine"
|
|
14238
14308
|
});
|
|
14239
|
-
const [riskEngineResults, _meta] = await Promise.all([client
|
|
14309
|
+
const [riskEngineResults, _meta] = await Promise.all([riskEngineMulticall(client, {
|
|
14240
14310
|
contracts: [
|
|
14241
14311
|
{
|
|
14242
14312
|
address: riskEngineAddress,
|
|
@@ -24505,7 +24575,7 @@ async function getHedgeLimits({ client, poolAddress, account, positionIds, asset
|
|
|
24505
24575
|
});
|
|
24506
24576
|
const { collateralToken0Address: ct0, collateralToken1Address: ct1, riskEngineAddress: engine } = metadata;
|
|
24507
24577
|
if (metadata.fee >= 1000000n) throw new Error("A fixed swap fee is required for this estimate");
|
|
24508
|
-
const [full, currentTick, pool0, pool1, total0, total1, interest0, interest1, buffer, notionalFee, cross0, cross1, maxLegs, accountLegs, supply0, supply1] = await client
|
|
24578
|
+
const [full, currentTick, pool0, pool1, total0, total1, interest0, interest1, buffer, notionalFee, cross0, cross1, maxLegs, accountLegs, supply0, supply1] = await riskEngineMulticall(client, {
|
|
24509
24579
|
contracts: [
|
|
24510
24580
|
{
|
|
24511
24581
|
address: poolAddress,
|
|
@@ -31525,7 +31595,7 @@ var _1 = {
|
|
|
31525
31595
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
31526
31596
|
"semiFungiblePositionManagerV3": "0x00000000000005E4693aDc8Ec0f12D686f728198",
|
|
31527
31597
|
"builderFactory": "0x0000000000000a3D22E158417AA639D7F71b0FF7",
|
|
31528
|
-
"riskEngine": "
|
|
31598
|
+
"riskEngine": "0x000000000000ffE5eFdB5AE76b9200263C58b4c0",
|
|
31529
31599
|
"panopticPoolImplementation": "0x000000000000135429F0DaCaB61639Bf6a63EbbC",
|
|
31530
31600
|
"collateralTrackerImplementation": "0x0000000000001d9c38CA405A2e04420865A08A33",
|
|
31531
31601
|
"panopticFactoryV4": "0x0000000000000c51d0f8cf4bd9adE7191372a625",
|
|
@@ -31536,7 +31606,7 @@ var _1 = {
|
|
|
31536
31606
|
"interactionHelper": "0x00000000000041fe14Ce3c2392337CE501aE8328"
|
|
31537
31607
|
}
|
|
31538
31608
|
},
|
|
31539
|
-
"riskEngines": ["
|
|
31609
|
+
"riskEngines": ["0x000000000000ffE5eFdB5AE76b9200263C58b4c0", "0x000000000000FfADa7c641E2aD6B13b51b50Cc94"],
|
|
31540
31610
|
"markets": { "ethUsdc30bps": {
|
|
31541
31611
|
"currency0": "0x0000000000000000000000000000000000000000",
|
|
31542
31612
|
"currency1": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
@@ -31556,7 +31626,12 @@ var _1 = {
|
|
|
31556
31626
|
"fee": 500,
|
|
31557
31627
|
"weth": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
|
31558
31628
|
},
|
|
31559
|
-
"deprecatedRiskEngines": [
|
|
31629
|
+
"deprecatedRiskEngines": [
|
|
31630
|
+
"0x0000000000000e673aECBDB5f5fE5DFAf4a8e9Ac",
|
|
31631
|
+
"0x0000000000000E65545005B26207D7edFd031260",
|
|
31632
|
+
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
31633
|
+
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb"
|
|
31634
|
+
]
|
|
31560
31635
|
};
|
|
31561
31636
|
var _4663 = {
|
|
31562
31637
|
"chainId": 4663,
|
|
@@ -31614,7 +31689,7 @@ var _4663 = {
|
|
|
31614
31689
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
31615
31690
|
"semiFungiblePositionManagerV3": "0x00000000000005E4693aDc8Ec0f12D686f728198",
|
|
31616
31691
|
"builderFactory": "0x0000000000000a3D22E158417AA639D7F71b0FF7",
|
|
31617
|
-
"riskEngine": "
|
|
31692
|
+
"riskEngine": "0x000000000000FfADa7c641E2aD6B13b51b50Cc94",
|
|
31618
31693
|
"panopticPoolImplementation": "0x000000000000135429F0DaCaB61639Bf6a63EbbC",
|
|
31619
31694
|
"collateralTrackerImplementation": "0x0000000000001d9c38CA405A2e04420865A08A33",
|
|
31620
31695
|
"panopticFactoryV4": "0x0000000000000c51d0f8cf4bd9adE7191372a625",
|
|
@@ -31625,11 +31700,7 @@ var _4663 = {
|
|
|
31625
31700
|
"interactionHelper": "0x00000000000041fe14Ce3c2392337CE501aE8328"
|
|
31626
31701
|
}
|
|
31627
31702
|
},
|
|
31628
|
-
"riskEngines": [
|
|
31629
|
-
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
31630
|
-
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb",
|
|
31631
|
-
"0x0000000000000f3fb82469581A74776178E76Ca4"
|
|
31632
|
-
],
|
|
31703
|
+
"riskEngines": ["0x000000000000ffE5eFdB5AE76b9200263C58b4c0", "0x000000000000FfADa7c641E2aD6B13b51b50Cc94"],
|
|
31633
31704
|
"markets": {
|
|
31634
31705
|
"spyUsdg": {
|
|
31635
31706
|
"currency0": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
@@ -31657,7 +31728,12 @@ var _4663 = {
|
|
|
31657
31728
|
"hypovault": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/hypovault-subgraph-robinhood/prod/gn",
|
|
31658
31729
|
"panoptic": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/panoptic-subgraph-robinhood/v2_prod/gn"
|
|
31659
31730
|
},
|
|
31660
|
-
"deprecatedRiskEngines": [
|
|
31731
|
+
"deprecatedRiskEngines": [
|
|
31732
|
+
"0x0000000000000E65545005B26207D7edFd031260",
|
|
31733
|
+
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
31734
|
+
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb",
|
|
31735
|
+
"0x0000000000000f3fb82469581A74776178E76Ca4"
|
|
31736
|
+
]
|
|
31661
31737
|
};
|
|
31662
31738
|
var _8453 = {
|
|
31663
31739
|
"chainId": 8453,
|