@panoptic-eng/sdk 1.0.53 → 1.0.54
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/deployments.d.ts +8 -1
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +30 -10
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +244 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +433 -221
- package/dist/index.js.map +1 -1
- package/dist/{irm-9az4Pqsp.js → irm-BsRdsXMS.js} +30 -10
- package/dist/panoptic/v2/index.js +29 -9
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.js +29 -9
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/{v2-CUv4jWCQ.js → v2-DZ8JTfEs.js} +1 -1
- package/dist/zodiac/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24313,23 +24313,26 @@ var _4663 = {
|
|
|
24313
24313
|
},
|
|
24314
24314
|
"vaults": {
|
|
24315
24315
|
"wethPlpVault": "0x0000000000000000000000000000000000000000",
|
|
24316
|
-
"usdcPlpVault": "0x0000000000000000000000000000000000000000"
|
|
24316
|
+
"usdcPlpVault": "0x0000000000000000000000000000000000000000",
|
|
24317
|
+
"usdgPlpVault": "0x08B24123252Bd9c4DD473b6573D4cF67196FFC4B"
|
|
24317
24318
|
},
|
|
24318
24319
|
"managers": {
|
|
24319
24320
|
"wethPlpVaultManager": "0x0000000000000000000000000000000000000000",
|
|
24320
|
-
"usdcPlpVaultManager": "0x0000000000000000000000000000000000000000"
|
|
24321
|
+
"usdcPlpVaultManager": "0x0000000000000000000000000000000000000000",
|
|
24322
|
+
"usdgPlpVaultManager": "0x67Edb096585efe88a9A1ee16c5857AB74Fc8EA87"
|
|
24321
24323
|
},
|
|
24322
24324
|
"turnkeySigners": {
|
|
24323
24325
|
"wethPlpVaultManager": "0x0000000000000000000000000000000000000000",
|
|
24324
|
-
"usdcPlpVaultManager": "0x0000000000000000000000000000000000000000"
|
|
24326
|
+
"usdcPlpVaultManager": "0x0000000000000000000000000000000000000000",
|
|
24327
|
+
"usdgPlpVaultManager": "0x8FfA6DAB99f8afc64F61BeF83F0966eD6362f24F"
|
|
24325
24328
|
}
|
|
24326
24329
|
},
|
|
24327
24330
|
"panoptic": {
|
|
24328
24331
|
"pool": {
|
|
24329
24332
|
"version": "v4",
|
|
24330
|
-
"panopticPool": "
|
|
24331
|
-
"collateralTracker0": "
|
|
24332
|
-
"collateralTracker1": "
|
|
24333
|
+
"panopticPool": "0x00000000989bcb6f24af4a1Ab2A6d6a31c98A58E",
|
|
24334
|
+
"collateralTracker0": "0x49eaAC32A7CD4B8fB2209a12859a95E0b20aB0e5",
|
|
24335
|
+
"collateralTracker1": "0x670C44a0FC35dbC410498e47A6290a1C3196d191"
|
|
24333
24336
|
},
|
|
24334
24337
|
"v2": {
|
|
24335
24338
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
@@ -24347,7 +24350,13 @@ var _4663 = {
|
|
|
24347
24350
|
}
|
|
24348
24351
|
},
|
|
24349
24352
|
"riskEngines": ["0x0000000000000E65545005B26207D7edFd031260", "0x0000000000000fe1e261f66ce2f44def4f5ae0cb"],
|
|
24350
|
-
"markets": {
|
|
24353
|
+
"markets": { "spyUsdg": {
|
|
24354
|
+
"currency0": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
24355
|
+
"currency1": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
|
|
24356
|
+
"fee": 3e3,
|
|
24357
|
+
"tickSpacing": 60,
|
|
24358
|
+
"poolId": "0xfe2a80bb5618fd14984b92ca6d45bf5ba67443ddb1435e28b2e48df2fc1526cd"
|
|
24359
|
+
} },
|
|
24351
24360
|
"subgraphs": {
|
|
24352
24361
|
"hypovault": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/hypovault-subgraph-robinhood/prod/gn",
|
|
24353
24362
|
"panoptic": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/panoptic-subgraph-robinhood/v2_prod/gn"
|
|
@@ -24497,16 +24506,21 @@ function getChainDeployment(chainId) {
|
|
|
24497
24506
|
return CHAIN_DEPLOYMENTS[chainId];
|
|
24498
24507
|
}
|
|
24499
24508
|
function requireChainDeployment(chainId) {
|
|
24500
|
-
const deployment = getChainDeployment(chainId);
|
|
24501
|
-
if (deployment === void 0) throw new Error(`Unsupported chain deployment for chainId ${chainId}`);
|
|
24502
|
-
return deployment;
|
|
24509
|
+
const deployment$2 = getChainDeployment(chainId);
|
|
24510
|
+
if (deployment$2 === void 0) throw new Error(`Unsupported chain deployment for chainId ${chainId}`);
|
|
24511
|
+
return deployment$2;
|
|
24503
24512
|
}
|
|
24504
24513
|
function isSupportedChain(chainId) {
|
|
24505
24514
|
return getChainDeployment(chainId) !== void 0;
|
|
24506
24515
|
}
|
|
24507
|
-
function getEthUsdcMarket(deployment) {
|
|
24508
|
-
const market = deployment.markets.ethUsdc5bps ?? deployment.markets.ethUsdc30bps;
|
|
24509
|
-
if (market === void 0) throw new Error(`Missing ETH/USDC market for chainId ${deployment.chainId}`);
|
|
24516
|
+
function getEthUsdcMarket(deployment$2) {
|
|
24517
|
+
const market = deployment$2.markets.ethUsdc5bps ?? deployment$2.markets.ethUsdc30bps;
|
|
24518
|
+
if (market === void 0) throw new Error(`Missing ETH/USDC market for chainId ${deployment$2.chainId}`);
|
|
24519
|
+
return market;
|
|
24520
|
+
}
|
|
24521
|
+
function getSpyUsdgMarket(deployment$2) {
|
|
24522
|
+
const market = deployment$2.markets.spyUsdg;
|
|
24523
|
+
if (market === void 0) throw new Error(`Missing SPY/USDG market for chainId ${deployment$2.chainId}`);
|
|
24510
24524
|
return market;
|
|
24511
24525
|
}
|
|
24512
24526
|
const MAINNET_DEPLOYMENT = CHAIN_DEPLOYMENTS[MAINNET_CHAIN_ID];
|
|
@@ -24539,6 +24553,7 @@ const ROBINHOOD_HYPOVAULT_MANAGER_TURNKEY_SIGNERS = ROBINHOOD_DEPLOYMENT.hypovau
|
|
|
24539
24553
|
const ROBINHOOD_PANOPTIC_POOL_ADDRESSES = ROBINHOOD_DEPLOYMENT.panoptic.pool;
|
|
24540
24554
|
const ROBINHOOD_PANOPTIC_V2_ADDRESSES = ROBINHOOD_DEPLOYMENT.panoptic.v2;
|
|
24541
24555
|
const ROBINHOOD_RISK_ENGINES = ROBINHOOD_DEPLOYMENT.riskEngines;
|
|
24556
|
+
const ROBINHOOD_SPY_USDG_MARKET = getSpyUsdgMarket(ROBINHOOD_DEPLOYMENT);
|
|
24542
24557
|
|
|
24543
24558
|
//#endregion
|
|
24544
24559
|
//#region ../deployments/src/vaultDisplayNames.js
|
|
@@ -24552,6 +24567,9 @@ const sepoliaDeployment = requireChainDeployment(SEPOLIA_CHAIN_ID);
|
|
|
24552
24567
|
const sepoliaVaults = sepoliaDeployment.hypovault.vaults;
|
|
24553
24568
|
const baseDeployment = requireChainDeployment(BASE_CHAIN_ID);
|
|
24554
24569
|
const baseVaults = baseDeployment.hypovault.vaults;
|
|
24570
|
+
const robinhoodDeployment = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
24571
|
+
const robinhoodUsdgVault = robinhoodDeployment.hypovault.vaults.usdgPlpVault;
|
|
24572
|
+
if (robinhoodUsdgVault === void 0) throw new Error("Missing Robinhood USDG PLP vault address");
|
|
24555
24573
|
const VAULT_DISPLAY_NAMES_PER_CHAIN = {
|
|
24556
24574
|
[MAINNET_CHAIN_ID]: {
|
|
24557
24575
|
[mainnetVaults.wethPlpVault.toLowerCase()]: "PLP Vault",
|
|
@@ -24566,7 +24584,8 @@ const VAULT_DISPLAY_NAMES_PER_CHAIN = {
|
|
|
24566
24584
|
[SEPOLIA_CHAIN_ID]: {
|
|
24567
24585
|
[sepoliaVaults.wethPlpVault.toLowerCase()]: "PLP Vault",
|
|
24568
24586
|
[sepoliaVaults.usdcPlpVault.toLowerCase()]: "Unicorn Vault"
|
|
24569
|
-
}
|
|
24587
|
+
},
|
|
24588
|
+
[ROBINHOOD_CHAIN_ID]: { [robinhoodUsdgVault.toLowerCase()]: "USDG PLP Vault" }
|
|
24570
24589
|
};
|
|
24571
24590
|
const VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN = {
|
|
24572
24591
|
[MAINNET_CHAIN_ID]: {
|
|
@@ -24582,10 +24601,11 @@ const VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN = {
|
|
|
24582
24601
|
[SEPOLIA_CHAIN_ID]: {
|
|
24583
24602
|
[sepoliaVaults.wethPlpVault.toLowerCase()]: () => "PLP Vault",
|
|
24584
24603
|
[sepoliaVaults.usdcPlpVault.toLowerCase()]: () => "Unicorn Vault"
|
|
24585
|
-
}
|
|
24604
|
+
},
|
|
24605
|
+
[ROBINHOOD_CHAIN_ID]: { [robinhoodUsdgVault.toLowerCase()]: () => "USDG PLP Vault" }
|
|
24586
24606
|
};
|
|
24587
|
-
function resolveVaultDisplayName({ chainId, vaultAddress, underlyingSymbol, fallbackName }) {
|
|
24588
|
-
const vaultAddressLower = vaultAddress.toLowerCase();
|
|
24607
|
+
function resolveVaultDisplayName({ chainId, vaultAddress: vaultAddress$1, underlyingSymbol, fallbackName }) {
|
|
24608
|
+
const vaultAddressLower = vaultAddress$1.toLowerCase();
|
|
24589
24609
|
const resolver = VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN[chainId]?.[vaultAddressLower];
|
|
24590
24610
|
if (resolver !== void 0) return resolver({
|
|
24591
24611
|
chainId,
|
|
@@ -24775,6 +24795,7 @@ function createStrategistLeavesArtifact(metadata, definitions) {
|
|
|
24775
24795
|
const SEPOLIA_DEPLOYMENT$5 = requireChainDeployment(SEPOLIA_CHAIN_ID);
|
|
24776
24796
|
const BASE_DEPLOYMENT$2 = requireChainDeployment(BASE_CHAIN_ID);
|
|
24777
24797
|
const MAINNET_DEPLOYMENT$6 = requireChainDeployment(MAINNET_CHAIN_ID);
|
|
24798
|
+
const ROBINHOOD_DEPLOYMENT$1 = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
24778
24799
|
const MAX_PRICE_DEVIATION = 100;
|
|
24779
24800
|
const WSPCXX_USDC_MAX_PRICE_DEVIATION = 1e4;
|
|
24780
24801
|
const DEFAULT_TRIGGER_TICK = 150;
|
|
@@ -24817,6 +24838,14 @@ const MAINNET_WSPCXX_USDC_POOL_INFO = {
|
|
|
24817
24838
|
token1: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
24818
24839
|
positionScanFromBlock: 25302077n
|
|
24819
24840
|
};
|
|
24841
|
+
const ROBINHOOD_SPY_USDG_POOL_DEPLOYMENT_BLOCK = 62901925n;
|
|
24842
|
+
const ROBINHOOD_SPY_USDG_POOL_INFO = {
|
|
24843
|
+
maxPriceDeviation: MAX_PRICE_DEVIATION,
|
|
24844
|
+
pool: ROBINHOOD_DEPLOYMENT$1.panoptic.pool.panopticPool,
|
|
24845
|
+
token0: getSpyUsdgMarket(ROBINHOOD_DEPLOYMENT$1).currency0,
|
|
24846
|
+
token1: getSpyUsdgMarket(ROBINHOOD_DEPLOYMENT$1).currency1,
|
|
24847
|
+
positionScanFromBlock: ROBINHOOD_SPY_USDG_POOL_DEPLOYMENT_BLOCK
|
|
24848
|
+
};
|
|
24820
24849
|
/** Accountant order used by the v3-authorization release. */
|
|
24821
24850
|
const MAINNET_DEFAULT_POOL_INFOS = [MAINNET_ETH_USDC_V4_POOL_INFO, MAINNET_USDC_WETH_5BPS_V3_POOL_INFO];
|
|
24822
24851
|
const MAINNET_USDC_PLP_POOL_INFOS = [
|
|
@@ -25251,6 +25280,172 @@ const UsdcPlpVaultSepoliaProdConfig = {
|
|
|
25251
25280
|
deltaHedge: { maxHedgeSlots: 12 }
|
|
25252
25281
|
};
|
|
25253
25282
|
|
|
25283
|
+
//#endregion
|
|
25284
|
+
//#region src/hypoVault/hypoVaultManagerArtifacts/RobinhoodUSDGPLPStrategistLeaves.ts
|
|
25285
|
+
const deployment$1 = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
25286
|
+
const vault$1 = deployment$1.hypovault.vaults.usdgPlpVault;
|
|
25287
|
+
const manager$1 = deployment$1.hypovault.managers.usdgPlpVaultManager;
|
|
25288
|
+
if (vault$1 === void 0 || manager$1 === void 0) throw new Error("Missing Robinhood USDG PLP vault deployment addresses");
|
|
25289
|
+
const pool = deployment$1.panoptic.pool.panopticPool;
|
|
25290
|
+
const poSpy = deployment$1.panoptic.pool.collateralTracker0;
|
|
25291
|
+
const poUsdg = deployment$1.panoptic.pool.collateralTracker1;
|
|
25292
|
+
const spy = ROBINHOOD_SPY_USDG_POOL_INFO.token0;
|
|
25293
|
+
const usdg = ROBINHOOD_SPY_USDG_POOL_INFO.token1;
|
|
25294
|
+
const dispatchSignature = "dispatch(uint256[],uint256[],uint128[],int24[3][],bool,uint256)";
|
|
25295
|
+
const trackerLeaves = [
|
|
25296
|
+
{
|
|
25297
|
+
description: "Approve poSPY to spend SPY",
|
|
25298
|
+
target: spy,
|
|
25299
|
+
functionSignature: "approve(address,uint256)",
|
|
25300
|
+
addressArguments: [poSpy],
|
|
25301
|
+
canSendValue: false
|
|
25302
|
+
},
|
|
25303
|
+
{
|
|
25304
|
+
description: "Deposit SPY for poSPY",
|
|
25305
|
+
target: poSpy,
|
|
25306
|
+
functionSignature: "deposit(uint256,address)",
|
|
25307
|
+
addressArguments: [vault$1],
|
|
25308
|
+
canSendValue: false
|
|
25309
|
+
},
|
|
25310
|
+
{
|
|
25311
|
+
description: "Withdraw SPY from poSPY",
|
|
25312
|
+
target: poSpy,
|
|
25313
|
+
functionSignature: "withdraw(uint256,address,address)",
|
|
25314
|
+
addressArguments: [vault$1, vault$1],
|
|
25315
|
+
canSendValue: false
|
|
25316
|
+
},
|
|
25317
|
+
{
|
|
25318
|
+
description: "Withdraw SPY from poSPY (with open positions)",
|
|
25319
|
+
target: poSpy,
|
|
25320
|
+
functionSignature: "withdraw(uint256,address,address,uint256[],bool)",
|
|
25321
|
+
addressArguments: [vault$1, vault$1],
|
|
25322
|
+
canSendValue: false
|
|
25323
|
+
},
|
|
25324
|
+
{
|
|
25325
|
+
description: "Mint poSPY using SPY",
|
|
25326
|
+
target: poSpy,
|
|
25327
|
+
functionSignature: "mint(uint256,address)",
|
|
25328
|
+
addressArguments: [vault$1],
|
|
25329
|
+
canSendValue: false
|
|
25330
|
+
},
|
|
25331
|
+
{
|
|
25332
|
+
description: "Redeem poSPY for SPY",
|
|
25333
|
+
target: poSpy,
|
|
25334
|
+
functionSignature: "redeem(uint256,address,address)",
|
|
25335
|
+
addressArguments: [vault$1, vault$1],
|
|
25336
|
+
canSendValue: false
|
|
25337
|
+
},
|
|
25338
|
+
{
|
|
25339
|
+
description: "Approve poUSDG to spend USDG",
|
|
25340
|
+
target: usdg,
|
|
25341
|
+
functionSignature: "approve(address,uint256)",
|
|
25342
|
+
addressArguments: [poUsdg],
|
|
25343
|
+
canSendValue: false
|
|
25344
|
+
},
|
|
25345
|
+
{
|
|
25346
|
+
description: "Deposit USDG for poUSDG",
|
|
25347
|
+
target: poUsdg,
|
|
25348
|
+
functionSignature: "deposit(uint256,address)",
|
|
25349
|
+
addressArguments: [vault$1],
|
|
25350
|
+
canSendValue: false
|
|
25351
|
+
},
|
|
25352
|
+
{
|
|
25353
|
+
description: "Withdraw USDG from poUSDG",
|
|
25354
|
+
target: poUsdg,
|
|
25355
|
+
functionSignature: "withdraw(uint256,address,address)",
|
|
25356
|
+
addressArguments: [vault$1, vault$1],
|
|
25357
|
+
canSendValue: false
|
|
25358
|
+
},
|
|
25359
|
+
{
|
|
25360
|
+
description: "Withdraw USDG from poUSDG (with open positions)",
|
|
25361
|
+
target: poUsdg,
|
|
25362
|
+
functionSignature: "withdraw(uint256,address,address,uint256[],bool)",
|
|
25363
|
+
addressArguments: [vault$1, vault$1],
|
|
25364
|
+
canSendValue: false
|
|
25365
|
+
},
|
|
25366
|
+
{
|
|
25367
|
+
description: "Mint poUSDG using USDG",
|
|
25368
|
+
target: poUsdg,
|
|
25369
|
+
functionSignature: "mint(uint256,address)",
|
|
25370
|
+
addressArguments: [vault$1],
|
|
25371
|
+
canSendValue: false
|
|
25372
|
+
},
|
|
25373
|
+
{
|
|
25374
|
+
description: "Redeem poUSDG for USDG",
|
|
25375
|
+
target: poUsdg,
|
|
25376
|
+
functionSignature: "redeem(uint256,address,address)",
|
|
25377
|
+
addressArguments: [vault$1, vault$1],
|
|
25378
|
+
canSendValue: false
|
|
25379
|
+
}
|
|
25380
|
+
];
|
|
25381
|
+
const dispatchLeaf = {
|
|
25382
|
+
description: "Dispatch mint/burn options on SPY/USDG PanopticPool",
|
|
25383
|
+
target: pool,
|
|
25384
|
+
functionSignature: dispatchSignature,
|
|
25385
|
+
addressArguments: [],
|
|
25386
|
+
canSendValue: false
|
|
25387
|
+
};
|
|
25388
|
+
const windDownLeaves = trackerLeaves.filter(({ functionSignature }) => functionSignature.startsWith("withdraw(") || functionSignature.startsWith("redeem("));
|
|
25389
|
+
const ROBINHOOD_USDG_PLP_POOL_POLICY = [{
|
|
25390
|
+
id: "spy-usdg-v4",
|
|
25391
|
+
mode: "primary",
|
|
25392
|
+
poolInfo: ROBINHOOD_SPY_USDG_POOL_INFO,
|
|
25393
|
+
fullLeafDefinitions: [...trackerLeaves, dispatchLeaf],
|
|
25394
|
+
windDownLeafDefinitions: [...windDownLeaves, dispatchLeaf]
|
|
25395
|
+
}];
|
|
25396
|
+
const ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY = compileVaultPoolPolicy({ pools: ROBINHOOD_USDG_PLP_POOL_POLICY });
|
|
25397
|
+
const RobinhoodUSDGPLPStrategistLeaves = createStrategistLeavesArtifact({
|
|
25398
|
+
accountantAddress: deployment$1.hypovault.core.accountant,
|
|
25399
|
+
boringVaultAddress: vault$1,
|
|
25400
|
+
decoderAndSanitizerAddress: deployment$1.hypovault.core.collateralTrackerDecoderAndSanitizer,
|
|
25401
|
+
managerAddress: manager$1
|
|
25402
|
+
}, ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY.strategistLeafDefinitions);
|
|
25403
|
+
|
|
25404
|
+
//#endregion
|
|
25405
|
+
//#region src/hypoVault/hypoVaultManagerConfigs/usdgPlpVaultRobinhoodProdConfig.ts
|
|
25406
|
+
const deployment = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
25407
|
+
const vault = deployment.hypovault.vaults.usdgPlpVault;
|
|
25408
|
+
const manager = deployment.hypovault.managers.usdgPlpVaultManager;
|
|
25409
|
+
if (vault === void 0 || manager === void 0) throw new Error("Missing Robinhood USDG PLP vault deployment addresses");
|
|
25410
|
+
const UsdgPlpVaultRobinhoodProdConfig = {
|
|
25411
|
+
deployment: "prod",
|
|
25412
|
+
artifactSet: "robinhood-prod",
|
|
25413
|
+
vaultAssetIndex: 1n,
|
|
25414
|
+
manageCycleIntervalMs: 6e5,
|
|
25415
|
+
vaultCapInUnderlying: 100000000000n,
|
|
25416
|
+
vaultCapInShares: 100000000000000000n,
|
|
25417
|
+
allowUnlimitedDepositRequestIfCapNotReached: true,
|
|
25418
|
+
maxBuyingPowerUsageBps: 6600,
|
|
25419
|
+
poolDeploymentBlock: Number(ROBINHOOD_SPY_USDG_POOL_DEPLOYMENT_BLOCK),
|
|
25420
|
+
chainId: ROBINHOOD_CHAIN_ID,
|
|
25421
|
+
hypoVaultAddress: vault,
|
|
25422
|
+
addresses: {
|
|
25423
|
+
ethUsdc500bpsV4Collateral0: deployment.panoptic.pool.collateralTracker0,
|
|
25424
|
+
ethUsdc500bpsV4Collateral1: deployment.panoptic.pool.collateralTracker1,
|
|
25425
|
+
ethUsdc500bpsV4PanopticPool: deployment.panoptic.pool.panopticPool,
|
|
25426
|
+
hypoVaultManagerWithMerkleVerification: manager,
|
|
25427
|
+
hypoVault: vault,
|
|
25428
|
+
underlyingToken: getSpyUsdgMarket(deployment).currency1
|
|
25429
|
+
},
|
|
25430
|
+
automation: {
|
|
25431
|
+
primaryPool: ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY.automation.primaryPool,
|
|
25432
|
+
windDownPools: [...ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY.automation.windDownPools]
|
|
25433
|
+
},
|
|
25434
|
+
manualTxDefaults: { collateralAllocations: [{
|
|
25435
|
+
trackerAddress: deployment.panoptic.pool.collateralTracker1,
|
|
25436
|
+
allocationBps: 1e4
|
|
25437
|
+
}] },
|
|
25438
|
+
deltaHedge: {
|
|
25439
|
+
deltaThresholdBps: 200n,
|
|
25440
|
+
maxHedgeSlots: 3
|
|
25441
|
+
},
|
|
25442
|
+
alerts: { outOfRangeEnabled: true },
|
|
25443
|
+
reporting: {
|
|
25444
|
+
assetSymbol: "USDG",
|
|
25445
|
+
vaultLabel: "USDG PLP"
|
|
25446
|
+
}
|
|
25447
|
+
};
|
|
25448
|
+
|
|
25254
25449
|
//#endregion
|
|
25255
25450
|
//#region src/hypoVault/hypoVaultManagerConfigs/wethPlpVaultBaseProdConfig.ts
|
|
25256
25451
|
const BASE_DEPLOYMENT$1 = requireChainDeployment(BASE_CHAIN_ID);
|
|
@@ -25688,10 +25883,11 @@ const ALL_HYPO_VAULT_CONFIGS = [
|
|
|
25688
25883
|
WethPlpVaultMainnetProdConfig,
|
|
25689
25884
|
UsdcPlpVaultMainnetProdConfig,
|
|
25690
25885
|
WethPlpVaultMainnetLegacyConfig,
|
|
25691
|
-
UsdcPlpVaultMainnetLegacyConfig
|
|
25886
|
+
UsdcPlpVaultMainnetLegacyConfig,
|
|
25887
|
+
UsdgPlpVaultRobinhoodProdConfig
|
|
25692
25888
|
];
|
|
25693
|
-
function getHypoVaultConfigForVault(vaultAddress, chainId, options) {
|
|
25694
|
-
const vaultLower = vaultAddress.toLowerCase();
|
|
25889
|
+
function getHypoVaultConfigForVault(vaultAddress$1, chainId, options) {
|
|
25890
|
+
const vaultLower = vaultAddress$1.toLowerCase();
|
|
25695
25891
|
const matchingConfigs = ALL_HYPO_VAULT_CONFIGS.filter((c) => c.hypoVaultAddress?.toLowerCase() === vaultLower && c.chainId === chainId);
|
|
25696
25892
|
if (matchingConfigs.length === 0) return void 0;
|
|
25697
25893
|
const preferredDeployment = options?.preferredDeployment;
|
|
@@ -26013,7 +26209,7 @@ function isSnapshotCandidateEvent(event) {
|
|
|
26013
26209
|
return event.transactionHash !== null && event.blockNumber !== null && event.logIndex !== null;
|
|
26014
26210
|
}
|
|
26015
26211
|
function decodeSnapshotTransaction(params) {
|
|
26016
|
-
const { account, pool, rolesContext } = params;
|
|
26212
|
+
const { account, pool: pool$1, rolesContext } = params;
|
|
26017
26213
|
let dispatchInput = params.input;
|
|
26018
26214
|
let dispatchSender = params.from;
|
|
26019
26215
|
if (rolesContext) {
|
|
@@ -26024,14 +26220,14 @@ function decodeSnapshotTransaction(params) {
|
|
|
26024
26220
|
data: params.input
|
|
26025
26221
|
});
|
|
26026
26222
|
const [target, value, data, operation, roleKey, shouldRevert] = decodedRoleCall.args;
|
|
26027
|
-
if (!pool || getAddress(target) !== getAddress(pool) || value !== 0n || operation !== 0 || roleKey.toLowerCase() !== rolesContext.roleKey.toLowerCase() || !shouldRevert) return null;
|
|
26223
|
+
if (!pool$1 || getAddress(target) !== getAddress(pool$1) || value !== 0n || operation !== 0 || roleKey.toLowerCase() !== rolesContext.roleKey.toLowerCase() || !shouldRevert) return null;
|
|
26028
26224
|
dispatchInput = data;
|
|
26029
26225
|
if (!account) return null;
|
|
26030
26226
|
dispatchSender = account;
|
|
26031
26227
|
} catch {
|
|
26032
26228
|
return null;
|
|
26033
26229
|
}
|
|
26034
|
-
} else if (pool && (params.to === null || getAddress(params.to) !== getAddress(pool))) return null;
|
|
26230
|
+
} else if (pool$1 && (params.to === null || getAddress(params.to) !== getAddress(pool$1))) return null;
|
|
26035
26231
|
const candidates = decodeAllDispatchCalldata(dispatchInput);
|
|
26036
26232
|
if (candidates.length === 0) return null;
|
|
26037
26233
|
return account ? selectDispatchForAccount(candidates, account, dispatchSender) : candidates[candidates.length - 1];
|
|
@@ -26059,7 +26255,7 @@ function decodeSnapshotTransaction(params) {
|
|
|
26059
26255
|
* ```
|
|
26060
26256
|
*/
|
|
26061
26257
|
async function recoverSnapshotFromTx(params) {
|
|
26062
|
-
const { client, transactionHash, account, pool, rolesContext } = params;
|
|
26258
|
+
const { client, transactionHash, account, pool: pool$1, rolesContext } = params;
|
|
26063
26259
|
const tx = await client.getTransaction({ hash: transactionHash });
|
|
26064
26260
|
if (tx.blockNumber == null) return null;
|
|
26065
26261
|
const decoded = decodeSnapshotTransaction({
|
|
@@ -26067,7 +26263,7 @@ async function recoverSnapshotFromTx(params) {
|
|
|
26067
26263
|
from: tx.from,
|
|
26068
26264
|
to: tx.to,
|
|
26069
26265
|
account,
|
|
26070
|
-
pool,
|
|
26266
|
+
pool: pool$1,
|
|
26071
26267
|
rolesContext
|
|
26072
26268
|
});
|
|
26073
26269
|
if (!decoded) return null;
|
|
@@ -26355,6 +26551,15 @@ const MainnetWETHPLPLegacyVaultPoolInfos = {
|
|
|
26355
26551
|
}))
|
|
26356
26552
|
};
|
|
26357
26553
|
|
|
26554
|
+
//#endregion
|
|
26555
|
+
//#region src/hypoVault/hypoVaultManagerArtifacts/RobinhoodUSDGPLPVaultPoolInfos.ts
|
|
26556
|
+
const vaultAddress = requireChainDeployment(ROBINHOOD_CHAIN_ID).hypovault.vaults.usdgPlpVault;
|
|
26557
|
+
if (vaultAddress === void 0) throw new Error("Missing Robinhood USDG PLP vault address");
|
|
26558
|
+
const RobinhoodUSDGPLPVaultPoolInfos = {
|
|
26559
|
+
vaultAddress,
|
|
26560
|
+
poolInfos: ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY.poolInfos.map((poolInfo) => ({ ...poolInfo }))
|
|
26561
|
+
};
|
|
26562
|
+
|
|
26358
26563
|
//#endregion
|
|
26359
26564
|
//#region src/hypoVault/hypoVaultManagerArtifacts/SepoliaUSDCPLPVaultPoolInfos.ts
|
|
26360
26565
|
const SepoliaUSDCPLPVaultPoolInfos = {
|
|
@@ -26454,14 +26659,14 @@ const MAINNET_V3_AUTHORIZATION_TRANSITIONS = [createVaultTransition({
|
|
|
26454
26659
|
current: generation(MainnetUSDCPLPVaultPoolInfos.poolInfos, MainnetUSDCPLPStrategistLeaves)
|
|
26455
26660
|
})];
|
|
26456
26661
|
const authorizationCacheByClient = new WeakMap();
|
|
26457
|
-
function findTransition(chainId, vaultAddress) {
|
|
26662
|
+
function findTransition(chainId, vaultAddress$1) {
|
|
26458
26663
|
if (chainId !== MAINNET_CHAIN_ID) return null;
|
|
26459
|
-
const normalizedVault = vaultAddress.toLowerCase();
|
|
26664
|
+
const normalizedVault = vaultAddress$1.toLowerCase();
|
|
26460
26665
|
return MAINNET_V3_AUTHORIZATION_TRANSITIONS.find((transition) => transition.vaultAddress.toLowerCase() === normalizedVault) ?? null;
|
|
26461
26666
|
}
|
|
26462
26667
|
/** Returns both known generations without reading chain state. */
|
|
26463
|
-
function getMainnetV3AuthorizationGenerations({ chainId, vaultAddress }) {
|
|
26464
|
-
const transition = findTransition(chainId, vaultAddress);
|
|
26668
|
+
function getMainnetV3AuthorizationGenerations({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
26669
|
+
const transition = findTransition(chainId, vaultAddress$1);
|
|
26465
26670
|
return transition === null ? null : {
|
|
26466
26671
|
previous: transition.previous,
|
|
26467
26672
|
next: transition.next,
|
|
@@ -26473,8 +26678,8 @@ function getMainnetV3AuthorizationGenerations({ chainId, vaultAddress }) {
|
|
|
26473
26678
|
* Live callers should use the compiled current artifacts directly; this selector exists for
|
|
26474
26679
|
* block-pinned NAV and manager-input reconstruction across the V3 authorization boundary.
|
|
26475
26680
|
*/
|
|
26476
|
-
function getMainnetV3AuthorizationArtifactsAtBlock({ chainId, vaultAddress, blockNumber }) {
|
|
26477
|
-
const transition = findTransition(chainId, vaultAddress);
|
|
26681
|
+
function getMainnetV3AuthorizationArtifactsAtBlock({ chainId, vaultAddress: vaultAddress$1, blockNumber }) {
|
|
26682
|
+
const transition = findTransition(chainId, vaultAddress$1);
|
|
26478
26683
|
if (transition === null) return null;
|
|
26479
26684
|
const version = blockNumber < transition.activationBlockNumber ? "previous" : "next";
|
|
26480
26685
|
return {
|
|
@@ -26490,11 +26695,11 @@ function getMainnetV3AuthorizationArtifactsAtBlock({ chainId, vaultAddress, bloc
|
|
|
26490
26695
|
* Every authorization release must add its generation to this transition table before
|
|
26491
26696
|
* the on-chain hashes change, so startup and release verification keeps recognizing it.
|
|
26492
26697
|
*/
|
|
26493
|
-
async function resolveMainnetV3AuthorizationArtifacts({ viemClient, chainId, vaultAddress, blockNumber }) {
|
|
26494
|
-
const transition = findTransition(chainId, vaultAddress);
|
|
26698
|
+
async function resolveMainnetV3AuthorizationArtifacts({ viemClient, chainId, vaultAddress: vaultAddress$1, blockNumber }) {
|
|
26699
|
+
const transition = findTransition(chainId, vaultAddress$1);
|
|
26495
26700
|
if (transition === null) return null;
|
|
26496
26701
|
const resolvedBlockNumber = blockNumber ?? await getBlockNumber(viemClient);
|
|
26497
|
-
const cacheKey = `${chainId}:${vaultAddress.toLowerCase()}:${resolvedBlockNumber.toString()}`;
|
|
26702
|
+
const cacheKey = `${chainId}:${vaultAddress$1.toLowerCase()}:${resolvedBlockNumber.toString()}`;
|
|
26498
26703
|
const clientCache = authorizationCacheByClient.get(viemClient);
|
|
26499
26704
|
const cached = clientCache?.get(cacheKey);
|
|
26500
26705
|
if (cached !== void 0) return cached;
|
|
@@ -26663,9 +26868,9 @@ function copyHistory(history) {
|
|
|
26663
26868
|
managerRootTransitions: history.managerRootTransitions.map(copyManagerRootTransition)
|
|
26664
26869
|
};
|
|
26665
26870
|
}
|
|
26666
|
-
function findHistory(chainId, vaultAddress) {
|
|
26871
|
+
function findHistory(chainId, vaultAddress$1) {
|
|
26667
26872
|
if (chainId !== MAINNET_CHAIN_ID) return null;
|
|
26668
|
-
const normalizedVault = vaultAddress.toLowerCase();
|
|
26873
|
+
const normalizedVault = vaultAddress$1.toLowerCase();
|
|
26669
26874
|
const history = MAINNET_VAULT_HISTORIES.find((candidate) => candidate.vaultAddress.toLowerCase() === normalizedVault);
|
|
26670
26875
|
return history === void 0 ? null : copyHistory(history);
|
|
26671
26876
|
}
|
|
@@ -26676,19 +26881,19 @@ function latestAtBlock(values, blockNumber) {
|
|
|
26676
26881
|
}
|
|
26677
26882
|
return null;
|
|
26678
26883
|
}
|
|
26679
|
-
function getMainnetVaultPoolConfigurationAtBlock({ chainId, vaultAddress, blockNumber }) {
|
|
26680
|
-
const history = findHistory(chainId, vaultAddress);
|
|
26884
|
+
function getMainnetVaultPoolConfigurationAtBlock({ chainId, vaultAddress: vaultAddress$1, blockNumber }) {
|
|
26885
|
+
const history = findHistory(chainId, vaultAddress$1);
|
|
26681
26886
|
return history === null ? null : latestAtBlock(history.poolConfigurations, blockNumber);
|
|
26682
26887
|
}
|
|
26683
|
-
function getMainnetVaultManagerRootAtBlock({ chainId, vaultAddress, blockNumber }) {
|
|
26684
|
-
const history = findHistory(chainId, vaultAddress);
|
|
26888
|
+
function getMainnetVaultManagerRootAtBlock({ chainId, vaultAddress: vaultAddress$1, blockNumber }) {
|
|
26889
|
+
const history = findHistory(chainId, vaultAddress$1);
|
|
26685
26890
|
return history === null ? null : latestAtBlock(history.managerRootTransitions, blockNumber);
|
|
26686
26891
|
}
|
|
26687
|
-
function getMainnetVaultPoolConfigurationHistory({ chainId, vaultAddress }) {
|
|
26688
|
-
return findHistory(chainId, vaultAddress)?.poolConfigurations ?? null;
|
|
26892
|
+
function getMainnetVaultPoolConfigurationHistory({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
26893
|
+
return findHistory(chainId, vaultAddress$1)?.poolConfigurations ?? null;
|
|
26689
26894
|
}
|
|
26690
|
-
function getMainnetVaultManagerRootHistory({ chainId, vaultAddress }) {
|
|
26691
|
-
return findHistory(chainId, vaultAddress)?.managerRootTransitions ?? null;
|
|
26895
|
+
function getMainnetVaultManagerRootHistory({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
26896
|
+
return findHistory(chainId, vaultAddress$1)?.managerRootTransitions ?? null;
|
|
26692
26897
|
}
|
|
26693
26898
|
|
|
26694
26899
|
//#endregion
|
|
@@ -26818,7 +27023,8 @@ const VAULT_POOL_INFOS_BY_CHAIN = {
|
|
|
26818
27023
|
MainnetWETHPLPLegacyVaultPoolInfos
|
|
26819
27024
|
],
|
|
26820
27025
|
[SEPOLIA_CHAIN_ID]: [SepoliaUSDCPLPVaultPoolInfos, SepoliaWETHPLPVaultPoolInfos],
|
|
26821
|
-
[BASE_CHAIN_ID]: [BaseUSDCPLPVaultPoolInfos, BaseWETHPLPVaultPoolInfos]
|
|
27026
|
+
[BASE_CHAIN_ID]: [BaseUSDCPLPVaultPoolInfos, BaseWETHPLPVaultPoolInfos],
|
|
27027
|
+
[ROBINHOOD_CHAIN_ID]: [RobinhoodUSDGPLPVaultPoolInfos]
|
|
26822
27028
|
};
|
|
26823
27029
|
const GET_POOL_ACCOUNT_BALANCE_CANDIDATES = `
|
|
26824
27030
|
query PoolAccountBalanceCandidates(
|
|
@@ -26916,7 +27122,7 @@ async function postGraphQL({ endpoint, query, variables, fetchFn }) {
|
|
|
26916
27122
|
if (json.data === void 0) throw new Error("GraphQL response did not include data");
|
|
26917
27123
|
return json.data;
|
|
26918
27124
|
}
|
|
26919
|
-
async function collectPoolAccountBalanceCandidates({ endpoint, poolIds, vaultAddress, candidatesByPool, fetchFn }) {
|
|
27125
|
+
async function collectPoolAccountBalanceCandidates({ endpoint, poolIds, vaultAddress: vaultAddress$1, candidatesByPool, fetchFn }) {
|
|
26920
27126
|
for (let skip = 0;; skip += PAGE_SIZE) {
|
|
26921
27127
|
const page = await postGraphQL({
|
|
26922
27128
|
endpoint,
|
|
@@ -26925,7 +27131,7 @@ async function collectPoolAccountBalanceCandidates({ endpoint, poolIds, vaultAdd
|
|
|
26925
27131
|
first: PAGE_SIZE,
|
|
26926
27132
|
skip,
|
|
26927
27133
|
poolIds,
|
|
26928
|
-
vault: vaultAddress
|
|
27134
|
+
vault: vaultAddress$1
|
|
26929
27135
|
},
|
|
26930
27136
|
fetchFn
|
|
26931
27137
|
});
|
|
@@ -27025,8 +27231,8 @@ async function filterOpenTokenIdsAtBlock({ viemClient, poolAddress, account, can
|
|
|
27025
27231
|
const openTokenIds = await collectOpen(candidates);
|
|
27026
27232
|
return sortBigintsAscending(openTokenIds);
|
|
27027
27233
|
}
|
|
27028
|
-
function getVaultPoolInfos(vaultAddress, chainId) {
|
|
27029
|
-
const vaultAddressLower = toLowerAddress$1(vaultAddress);
|
|
27234
|
+
function getVaultPoolInfos(vaultAddress$1, chainId) {
|
|
27235
|
+
const vaultAddressLower = toLowerAddress$1(vaultAddress$1);
|
|
27030
27236
|
const artifacts = chainId === void 0 ? Object.values(VAULT_POOL_INFOS_BY_CHAIN).flat() : VAULT_POOL_INFOS_BY_CHAIN[chainId] ?? [];
|
|
27031
27237
|
const artifact = artifacts.find((candidate) => toLowerAddress$1(candidate.vaultAddress) === vaultAddressLower);
|
|
27032
27238
|
return artifact?.poolInfos ?? [];
|
|
@@ -27035,12 +27241,12 @@ function getVaultPoolInfos(vaultAddress, chainId) {
|
|
|
27035
27241
|
* Returns every pool that can contribute historical position candidates for a vault.
|
|
27036
27242
|
* The live accountant generation is selected separately when encoding manager input.
|
|
27037
27243
|
*/
|
|
27038
|
-
function getVaultCandidatePoolInfos(vaultAddress, chainId) {
|
|
27244
|
+
function getVaultCandidatePoolInfos(vaultAddress$1, chainId) {
|
|
27039
27245
|
const generations = getMainnetV3AuthorizationGenerations({
|
|
27040
27246
|
chainId,
|
|
27041
|
-
vaultAddress
|
|
27247
|
+
vaultAddress: vaultAddress$1
|
|
27042
27248
|
});
|
|
27043
|
-
const candidates = generations === null ? getVaultPoolInfos(vaultAddress, chainId) : [
|
|
27249
|
+
const candidates = generations === null ? getVaultPoolInfos(vaultAddress$1, chainId) : [
|
|
27044
27250
|
...generations.previous.poolInfos,
|
|
27045
27251
|
...generations.next.poolInfos,
|
|
27046
27252
|
...generations.current.poolInfos
|
|
@@ -27053,21 +27259,21 @@ function getVaultCandidatePoolInfos(vaultAddress, chainId) {
|
|
|
27053
27259
|
return [...byPoolAddress.values()];
|
|
27054
27260
|
}
|
|
27055
27261
|
/** Selects the pool tuple authorized at an exact block before encoding manager input. */
|
|
27056
|
-
async function resolveVaultPoolInfosAtBlock({ viemClient, chainId, vaultAddress, blockNumber }) {
|
|
27262
|
+
async function resolveVaultPoolInfosAtBlock({ viemClient, chainId, vaultAddress: vaultAddress$1, blockNumber }) {
|
|
27057
27263
|
if (chainId === MAINNET_CHAIN_ID && blockNumber >= MAINNET_V3_AUTHORIZATION_BLOCK) {
|
|
27058
27264
|
const authorization = await resolveMainnetV3AuthorizationArtifacts({
|
|
27059
27265
|
viemClient,
|
|
27060
27266
|
chainId,
|
|
27061
|
-
vaultAddress,
|
|
27267
|
+
vaultAddress: vaultAddress$1,
|
|
27062
27268
|
blockNumber
|
|
27063
27269
|
});
|
|
27064
27270
|
if (authorization !== null) return authorization.poolInfos;
|
|
27065
27271
|
}
|
|
27066
27272
|
return getMainnetVaultPoolConfigurationAtBlock({
|
|
27067
27273
|
chainId,
|
|
27068
|
-
vaultAddress,
|
|
27274
|
+
vaultAddress: vaultAddress$1,
|
|
27069
27275
|
blockNumber
|
|
27070
|
-
})?.poolInfos ?? getVaultPoolInfos(vaultAddress, chainId);
|
|
27276
|
+
})?.poolInfos ?? getVaultPoolInfos(vaultAddress$1, chainId);
|
|
27071
27277
|
}
|
|
27072
27278
|
/**
|
|
27073
27279
|
* Enrich a cached subgraph candidate superset with the authoritative position
|
|
@@ -27079,7 +27285,7 @@ async function resolveVaultPoolInfosAtBlock({ viemClient, chainId, vaultAddress,
|
|
|
27079
27285
|
* all-time candidate cache; closed IDs remain harmless because the normal
|
|
27080
27286
|
* per-block verifier filters them out.
|
|
27081
27287
|
*/
|
|
27082
|
-
async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultAddress, candidatesByPool, poolInfos, blockNumber, fromBlock }) {
|
|
27288
|
+
async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultAddress: vaultAddress$1, candidatesByPool, poolInfos, blockNumber, fromBlock }) {
|
|
27083
27289
|
return Promise.all(poolInfos.map(async (poolInfo) => {
|
|
27084
27290
|
const cached = candidatesByPool.find((candidate) => candidate.poolAddress.toLowerCase() === poolInfo.pool.toLowerCase());
|
|
27085
27291
|
const cachedIds = cached?.candidates ?? [];
|
|
@@ -27093,11 +27299,11 @@ async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultA
|
|
|
27093
27299
|
client: viemClient,
|
|
27094
27300
|
chainId: BigInt(chainId),
|
|
27095
27301
|
poolAddress: poolInfo.pool,
|
|
27096
|
-
account: vaultAddress,
|
|
27302
|
+
account: vaultAddress$1,
|
|
27097
27303
|
fromBlock: scanFromBlock,
|
|
27098
27304
|
toBlock: blockNumber
|
|
27099
27305
|
});
|
|
27100
|
-
if (recoveredIds === null) throw new Error(`Could not recover an authoritative position list for vault ${vaultAddress} in pool ${poolInfo.pool} between blocks ${scanFromBlock} and ${blockNumber}`);
|
|
27306
|
+
if (recoveredIds === null) throw new Error(`Could not recover an authoritative position list for vault ${vaultAddress$1} in pool ${poolInfo.pool} between blocks ${scanFromBlock} and ${blockNumber}`);
|
|
27101
27307
|
const candidates = sortBigintsAscending(new Set([...cachedIds, ...recoveredIds]));
|
|
27102
27308
|
return {
|
|
27103
27309
|
poolAddress: poolInfo.pool,
|
|
@@ -27113,15 +27319,15 @@ async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultA
|
|
|
27113
27319
|
* vault instead of re-running the subgraph paging for every anchor block. The
|
|
27114
27320
|
* combined {@link resolveVaultTokenIdsByPool} remains for one-shot callers.
|
|
27115
27321
|
*/
|
|
27116
|
-
async function resolveVaultHistoricalCandidatesByPool({ chainId, vaultAddress, managerAddress, poolInfos, panopticSubgraphUrl, fetchFn = fetch }) {
|
|
27117
|
-
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress, chainId);
|
|
27322
|
+
async function resolveVaultHistoricalCandidatesByPool({ chainId, vaultAddress: vaultAddress$1, managerAddress, poolInfos, panopticSubgraphUrl, fetchFn = fetch }) {
|
|
27323
|
+
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress$1, chainId);
|
|
27118
27324
|
if (resolvedPoolInfos.length === 0) return [];
|
|
27119
27325
|
const configuredEndpoint = panopticSubgraphUrl ?? requireChainDeployment(chainId).subgraphs.panoptic;
|
|
27120
27326
|
if (configuredEndpoint === void 0) return resolvedPoolInfos.map((poolInfo) => ({
|
|
27121
27327
|
poolAddress: poolInfo.pool,
|
|
27122
27328
|
candidates: []
|
|
27123
27329
|
}));
|
|
27124
|
-
const vaultAddressLower = toLowerAddress$1(vaultAddress);
|
|
27330
|
+
const vaultAddressLower = toLowerAddress$1(vaultAddress$1);
|
|
27125
27331
|
const recipientAddresses = Array.from(new Set([vaultAddressLower, managerAddress?.toLowerCase()].filter((value) => value !== void 0 && value.length > 0).map((value) => value.toLowerCase())));
|
|
27126
27332
|
const poolIds = Array.from(new Set(resolvedPoolInfos.map((poolInfo) => toLowerAddress$1(poolInfo.pool))));
|
|
27127
27333
|
const balanceCandidatesByPool = new Map();
|
|
@@ -27156,13 +27362,13 @@ async function resolveVaultHistoricalCandidatesByPool({ chainId, vaultAddress, m
|
|
|
27156
27362
|
* open at `blockNumber`, per pool, via on-chain `getFullPositionsData` (bisecting
|
|
27157
27363
|
* on stale candidates). This is the per-block half of the candidate/verify split.
|
|
27158
27364
|
*/
|
|
27159
|
-
async function verifyVaultOpenTokenIdsAtBlock({ viemClient, vaultAddress, candidatesByPool, blockNumber }) {
|
|
27365
|
+
async function verifyVaultOpenTokenIdsAtBlock({ viemClient, vaultAddress: vaultAddress$1, candidatesByPool, blockNumber }) {
|
|
27160
27366
|
const tokenIdsByPool = [];
|
|
27161
27367
|
for (const { poolAddress, candidates } of candidatesByPool) {
|
|
27162
27368
|
const openTokenIds = await filterOpenTokenIdsAtBlock({
|
|
27163
27369
|
viemClient,
|
|
27164
27370
|
poolAddress,
|
|
27165
|
-
account: vaultAddress,
|
|
27371
|
+
account: vaultAddress$1,
|
|
27166
27372
|
candidates,
|
|
27167
27373
|
blockNumber
|
|
27168
27374
|
});
|
|
@@ -27170,12 +27376,12 @@ async function verifyVaultOpenTokenIdsAtBlock({ viemClient, vaultAddress, candid
|
|
|
27170
27376
|
}
|
|
27171
27377
|
return tokenIdsByPool;
|
|
27172
27378
|
}
|
|
27173
|
-
async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress, managerAddress, poolInfos, panopticSubgraphUrl, verificationBlockNumber, fetchFn = fetch }) {
|
|
27174
|
-
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress, chainId);
|
|
27379
|
+
async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress: vaultAddress$1, managerAddress, poolInfos, panopticSubgraphUrl, verificationBlockNumber, fetchFn = fetch }) {
|
|
27380
|
+
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress$1, chainId);
|
|
27175
27381
|
if (resolvedPoolInfos.length === 0) return [];
|
|
27176
27382
|
const configuredEndpoint = panopticSubgraphUrl ?? requireChainDeployment(chainId).subgraphs.panoptic;
|
|
27177
27383
|
if (configuredEndpoint === void 0) return resolvedPoolInfos.map(() => []);
|
|
27178
|
-
const vaultAddressLower = toLowerAddress$1(vaultAddress);
|
|
27384
|
+
const vaultAddressLower = toLowerAddress$1(vaultAddress$1);
|
|
27179
27385
|
const recipientAddresses = Array.from(new Set([vaultAddressLower, managerAddress?.toLowerCase()].filter((value) => value !== void 0 && value.length > 0).map((value) => value.toLowerCase())));
|
|
27180
27386
|
const poolIds = Array.from(new Set(resolvedPoolInfos.map((poolInfo) => toLowerAddress$1(poolInfo.pool))));
|
|
27181
27387
|
const balanceCandidatesByPool = new Map();
|
|
@@ -27204,7 +27410,7 @@ async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress, m
|
|
|
27204
27410
|
const historicalOpenTokenIds = await filterOpenTokenIdsAtBlock({
|
|
27205
27411
|
viemClient,
|
|
27206
27412
|
poolAddress: poolInfo.pool,
|
|
27207
|
-
account: vaultAddress,
|
|
27413
|
+
account: vaultAddress$1,
|
|
27208
27414
|
candidates: historicalCandidates,
|
|
27209
27415
|
blockNumber: verificationBlockNumber
|
|
27210
27416
|
});
|
|
@@ -27226,7 +27432,7 @@ async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress, m
|
|
|
27226
27432
|
abi: panopticPoolV2Abi$1,
|
|
27227
27433
|
functionName: "getFullPositionsData",
|
|
27228
27434
|
args: [
|
|
27229
|
-
vaultAddress,
|
|
27435
|
+
vaultAddress$1,
|
|
27230
27436
|
false,
|
|
27231
27437
|
eventCandidates
|
|
27232
27438
|
],
|
|
@@ -27252,12 +27458,12 @@ async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress, m
|
|
|
27252
27458
|
}
|
|
27253
27459
|
return tokenIdsByPool;
|
|
27254
27460
|
}
|
|
27255
|
-
async function buildVaultManagerInput({ viemClient, chainId, vaultAddress, underlyingToken, managerAddress, panopticSubgraphUrl, fetchFn }) {
|
|
27461
|
+
async function buildVaultManagerInput({ viemClient, chainId, vaultAddress: vaultAddress$1, underlyingToken, managerAddress, panopticSubgraphUrl, fetchFn }) {
|
|
27256
27462
|
const blockNumber = await getBlockNumber(viemClient);
|
|
27257
27463
|
return buildVaultManagerInputAtBlock({
|
|
27258
27464
|
viemClient,
|
|
27259
27465
|
chainId,
|
|
27260
|
-
vaultAddress,
|
|
27466
|
+
vaultAddress: vaultAddress$1,
|
|
27261
27467
|
underlyingToken,
|
|
27262
27468
|
blockNumber,
|
|
27263
27469
|
managerAddress,
|
|
@@ -27265,18 +27471,18 @@ async function buildVaultManagerInput({ viemClient, chainId, vaultAddress, under
|
|
|
27265
27471
|
fetchFn
|
|
27266
27472
|
});
|
|
27267
27473
|
}
|
|
27268
|
-
async function buildVaultManagerInputAtBlock({ viemClient, chainId, vaultAddress, underlyingToken, blockNumber, managerAddress, panopticSubgraphUrl, fetchFn }) {
|
|
27474
|
+
async function buildVaultManagerInputAtBlock({ viemClient, chainId, vaultAddress: vaultAddress$1, underlyingToken, blockNumber, managerAddress, panopticSubgraphUrl, fetchFn }) {
|
|
27269
27475
|
const poolInfos = await resolveVaultPoolInfosAtBlock({
|
|
27270
27476
|
viemClient,
|
|
27271
27477
|
chainId,
|
|
27272
|
-
vaultAddress,
|
|
27478
|
+
vaultAddress: vaultAddress$1,
|
|
27273
27479
|
blockNumber
|
|
27274
27480
|
});
|
|
27275
27481
|
if (poolInfos.length === 0) return DEFAULT_MANAGER_INPUT$1;
|
|
27276
27482
|
const tokenIds = await resolveVaultTokenIdsByPool({
|
|
27277
27483
|
viemClient,
|
|
27278
27484
|
chainId,
|
|
27279
|
-
vaultAddress,
|
|
27485
|
+
vaultAddress: vaultAddress$1,
|
|
27280
27486
|
managerAddress,
|
|
27281
27487
|
poolInfos,
|
|
27282
27488
|
panopticSubgraphUrl,
|
|
@@ -27310,10 +27516,10 @@ const erc20BalanceOfAbi = [{
|
|
|
27310
27516
|
function toLowerAddress(address) {
|
|
27311
27517
|
return address.toLowerCase();
|
|
27312
27518
|
}
|
|
27313
|
-
function discoverPoolAddresses$1({ chainId, vaultAddress }) {
|
|
27519
|
+
function discoverPoolAddresses$1({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
27314
27520
|
const discoveredAddresses = [];
|
|
27315
27521
|
const seen = new Set();
|
|
27316
|
-
const config = getHypoVaultConfigForVault(vaultAddress, chainId);
|
|
27522
|
+
const config = getHypoVaultConfigForVault(vaultAddress$1, chainId);
|
|
27317
27523
|
const poolFromConfig = config?.addresses?.ethUsdc500bpsV4PanopticPool;
|
|
27318
27524
|
if (poolFromConfig !== void 0) {
|
|
27319
27525
|
const key = toLowerAddress(poolFromConfig);
|
|
@@ -27322,7 +27528,7 @@ function discoverPoolAddresses$1({ chainId, vaultAddress }) {
|
|
|
27322
27528
|
discoveredAddresses.push(poolFromConfig);
|
|
27323
27529
|
}
|
|
27324
27530
|
}
|
|
27325
|
-
const artifactPoolInfos = getVaultPoolInfos(vaultAddress, chainId);
|
|
27531
|
+
const artifactPoolInfos = getVaultPoolInfos(vaultAddress$1, chainId);
|
|
27326
27532
|
for (const poolInfo of artifactPoolInfos) {
|
|
27327
27533
|
const key = toLowerAddress(poolInfo.pool);
|
|
27328
27534
|
if (!seen.has(key)) {
|
|
@@ -27338,10 +27544,10 @@ function getUnderlyingIndex({ underlyingTokenAddress, token0Asset, token1Asset }
|
|
|
27338
27544
|
if (toLowerAddress(token1Asset) === underlyingLower) return 1;
|
|
27339
27545
|
return null;
|
|
27340
27546
|
}
|
|
27341
|
-
async function getLendingAllocationRows({ client, chainId, vaultAddress, underlyingTokenAddress, blockNumber }) {
|
|
27547
|
+
async function getLendingAllocationRows({ client, chainId, vaultAddress: vaultAddress$1, underlyingTokenAddress, blockNumber }) {
|
|
27342
27548
|
const poolAddresses = discoverPoolAddresses$1({
|
|
27343
27549
|
chainId,
|
|
27344
|
-
vaultAddress
|
|
27550
|
+
vaultAddress: vaultAddress$1
|
|
27345
27551
|
});
|
|
27346
27552
|
const poolRows = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
27347
27553
|
const metadata = await getPoolMetadata({
|
|
@@ -27362,7 +27568,7 @@ async function getLendingAllocationRows({ client, chainId, vaultAddress, underly
|
|
|
27362
27568
|
}), getAccountCollateral({
|
|
27363
27569
|
client,
|
|
27364
27570
|
poolAddress,
|
|
27365
|
-
account: vaultAddress,
|
|
27571
|
+
account: vaultAddress$1,
|
|
27366
27572
|
blockNumber
|
|
27367
27573
|
})]);
|
|
27368
27574
|
const allocationUnderlying = underlyingIndex === 0 ? accountCollateral.token0.assets : accountCollateral.token1.assets;
|
|
@@ -27383,7 +27589,7 @@ async function getLendingAllocationRows({ client, chainId, vaultAddress, underly
|
|
|
27383
27589
|
address: underlyingTokenAddress,
|
|
27384
27590
|
abi: erc20BalanceOfAbi,
|
|
27385
27591
|
functionName: "balanceOf",
|
|
27386
|
-
args: [vaultAddress],
|
|
27592
|
+
args: [vaultAddress$1],
|
|
27387
27593
|
blockNumber
|
|
27388
27594
|
});
|
|
27389
27595
|
const idleRow = {
|
|
@@ -27477,10 +27683,10 @@ function isNativeToken(tokenAddress) {
|
|
|
27477
27683
|
function addressesEqual(a, b) {
|
|
27478
27684
|
return a.toLowerCase() === b.toLowerCase();
|
|
27479
27685
|
}
|
|
27480
|
-
function discoverPoolAddresses({ chainId, vaultAddress }) {
|
|
27686
|
+
function discoverPoolAddresses({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
27481
27687
|
const seen = new Set();
|
|
27482
27688
|
const addresses = [];
|
|
27483
|
-
const config = getHypoVaultConfigForVault(vaultAddress, chainId);
|
|
27689
|
+
const config = getHypoVaultConfigForVault(vaultAddress$1, chainId);
|
|
27484
27690
|
const configuredPool = config?.addresses?.ethUsdc500bpsV4PanopticPool;
|
|
27485
27691
|
if (configuredPool !== void 0) {
|
|
27486
27692
|
const key = configuredPool.toLowerCase();
|
|
@@ -27489,7 +27695,7 @@ function discoverPoolAddresses({ chainId, vaultAddress }) {
|
|
|
27489
27695
|
addresses.push(configuredPool);
|
|
27490
27696
|
}
|
|
27491
27697
|
}
|
|
27492
|
-
const artifactInfos = getVaultPoolInfos(vaultAddress, chainId);
|
|
27698
|
+
const artifactInfos = getVaultPoolInfos(vaultAddress$1, chainId);
|
|
27493
27699
|
for (const info of artifactInfos) {
|
|
27494
27700
|
const key = info.pool.toLowerCase();
|
|
27495
27701
|
if (!seen.has(key)) {
|
|
@@ -27649,10 +27855,10 @@ function calculateVaultNetLendingYieldUnderlyingFromTrackerInputs({ inputs, inte
|
|
|
27649
27855
|
}
|
|
27650
27856
|
return sawAssets ? totalNetYieldUnderlying : null;
|
|
27651
27857
|
}
|
|
27652
|
-
async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress, underlyingTokenAddress, blockNumber }) {
|
|
27858
|
+
async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress: vaultAddress$1, underlyingTokenAddress, blockNumber }) {
|
|
27653
27859
|
const poolAddresses = discoverPoolAddresses({
|
|
27654
27860
|
chainId,
|
|
27655
|
-
vaultAddress
|
|
27861
|
+
vaultAddress: vaultAddress$1
|
|
27656
27862
|
});
|
|
27657
27863
|
if (poolAddresses.length === 0) return null;
|
|
27658
27864
|
const poolContexts = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
@@ -27712,14 +27918,14 @@ async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress, under
|
|
|
27712
27918
|
address: trackerAddress,
|
|
27713
27919
|
abi: collateralTrackerV2Abi,
|
|
27714
27920
|
functionName: "assetsOf",
|
|
27715
|
-
args: [vaultAddress],
|
|
27921
|
+
args: [vaultAddress$1],
|
|
27716
27922
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
27717
27923
|
}),
|
|
27718
27924
|
client.readContract({
|
|
27719
27925
|
address: trackerAddress,
|
|
27720
27926
|
abi: collateralTrackerV2Abi,
|
|
27721
27927
|
functionName: "interestState",
|
|
27722
|
-
args: [vaultAddress],
|
|
27928
|
+
args: [vaultAddress$1],
|
|
27723
27929
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
27724
27930
|
}),
|
|
27725
27931
|
client.readContract({
|
|
@@ -27744,10 +27950,10 @@ async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress, under
|
|
|
27744
27950
|
})));
|
|
27745
27951
|
return calculateVaultNetLendingApyPctFromTrackerInputs(trackerInputs.filter((input) => input !== null));
|
|
27746
27952
|
}
|
|
27747
|
-
async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddress, underlyingTokenAddress, blockNumber, intervalSeconds }) {
|
|
27953
|
+
async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddress: vaultAddress$1, underlyingTokenAddress, blockNumber, intervalSeconds }) {
|
|
27748
27954
|
const poolAddresses = discoverPoolAddresses({
|
|
27749
27955
|
chainId,
|
|
27750
|
-
vaultAddress
|
|
27956
|
+
vaultAddress: vaultAddress$1
|
|
27751
27957
|
});
|
|
27752
27958
|
if (poolAddresses.length === 0) return null;
|
|
27753
27959
|
const poolContexts = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
@@ -27807,14 +28013,14 @@ async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddre
|
|
|
27807
28013
|
address: trackerAddress,
|
|
27808
28014
|
abi: collateralTrackerV2Abi,
|
|
27809
28015
|
functionName: "assetsOf",
|
|
27810
|
-
args: [vaultAddress],
|
|
28016
|
+
args: [vaultAddress$1],
|
|
27811
28017
|
blockNumber
|
|
27812
28018
|
}),
|
|
27813
28019
|
client.readContract({
|
|
27814
28020
|
address: trackerAddress,
|
|
27815
28021
|
abi: collateralTrackerV2Abi,
|
|
27816
28022
|
functionName: "interestState",
|
|
27817
|
-
args: [vaultAddress],
|
|
28023
|
+
args: [vaultAddress$1],
|
|
27818
28024
|
blockNumber
|
|
27819
28025
|
}),
|
|
27820
28026
|
client.readContract({
|
|
@@ -27842,14 +28048,14 @@ async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddre
|
|
|
27842
28048
|
intervalSeconds
|
|
27843
28049
|
});
|
|
27844
28050
|
}
|
|
27845
|
-
async function fetchVaultLendingAllocation({ client, chainId, vaultAddress, underlyingTokenAddress, blockNumber }) {
|
|
28051
|
+
async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaultAddress$1, underlyingTokenAddress, blockNumber }) {
|
|
27846
28052
|
const [reservedWithdrawalAssetsRaw, depositEpochRaw] = await Promise.all([client.readContract({
|
|
27847
|
-
address: vaultAddress,
|
|
28053
|
+
address: vaultAddress$1,
|
|
27848
28054
|
abi: HypoVaultAbi,
|
|
27849
28055
|
functionName: "reservedWithdrawalAssets",
|
|
27850
28056
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
27851
28057
|
}), client.readContract({
|
|
27852
|
-
address: vaultAddress,
|
|
28058
|
+
address: vaultAddress$1,
|
|
27853
28059
|
abi: HypoVaultAbi,
|
|
27854
28060
|
functionName: "depositEpoch",
|
|
27855
28061
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
@@ -27857,7 +28063,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress, unde
|
|
|
27857
28063
|
const reservedWithdrawalAssets = toBigInt$1(reservedWithdrawalAssetsRaw) ?? 0n;
|
|
27858
28064
|
const depositEpoch = toBigInt$1(depositEpochRaw);
|
|
27859
28065
|
const depositEpochStateRaw = depositEpoch === null ? null : await client.readContract({
|
|
27860
|
-
address: vaultAddress,
|
|
28066
|
+
address: vaultAddress$1,
|
|
27861
28067
|
abi: HypoVaultAbi,
|
|
27862
28068
|
functionName: "depositEpochState",
|
|
27863
28069
|
args: [depositEpoch],
|
|
@@ -27866,7 +28072,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress, unde
|
|
|
27866
28072
|
const unfulfilledDepositAssets = depositEpochStateRaw === null ? 0n : getAssetsDepositedFromDepositEpochState$1(depositEpochStateRaw);
|
|
27867
28073
|
const poolAddresses = discoverPoolAddresses({
|
|
27868
28074
|
chainId,
|
|
27869
|
-
vaultAddress
|
|
28075
|
+
vaultAddress: vaultAddress$1
|
|
27870
28076
|
});
|
|
27871
28077
|
const poolContexts = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
27872
28078
|
const [collateral0Address, collateral1Address] = await Promise.all([client.readContract({
|
|
@@ -27947,7 +28153,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress, unde
|
|
|
27947
28153
|
address: trackerAddress,
|
|
27948
28154
|
abi: collateralTrackerV2Abi,
|
|
27949
28155
|
functionName: "assetsOf",
|
|
27950
|
-
args: [vaultAddress],
|
|
28156
|
+
args: [vaultAddress$1],
|
|
27951
28157
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
27952
28158
|
}),
|
|
27953
28159
|
client.readContract({
|
|
@@ -28022,7 +28228,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress, unde
|
|
|
28022
28228
|
const balance = await readTokenBalance({
|
|
28023
28229
|
client,
|
|
28024
28230
|
tokenAddress: address,
|
|
28025
|
-
owner: vaultAddress,
|
|
28231
|
+
owner: vaultAddress$1,
|
|
28026
28232
|
blockNumber
|
|
28027
28233
|
});
|
|
28028
28234
|
const adjustedBalance = addressesEqual(address, underlyingTokenAddress) ? adjustUnderlyingIdleBalance({
|
|
@@ -28112,8 +28318,8 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress, unde
|
|
|
28112
28318
|
|
|
28113
28319
|
//#endregion
|
|
28114
28320
|
//#region src/hypoVault/cancelDeposit/cancelDeposit.ts
|
|
28115
|
-
const getCancelDepositContractConfig = ({ vaultAddress }) => ({
|
|
28116
|
-
address: vaultAddress,
|
|
28321
|
+
const getCancelDepositContractConfig = ({ vaultAddress: vaultAddress$1 }) => ({
|
|
28322
|
+
address: vaultAddress$1,
|
|
28117
28323
|
abi: HypoVaultAbi,
|
|
28118
28324
|
functionName: "cancelDeposit",
|
|
28119
28325
|
args: []
|
|
@@ -28125,15 +28331,15 @@ function encodeCancelDepositFunctionData() {
|
|
|
28125
28331
|
args: []
|
|
28126
28332
|
});
|
|
28127
28333
|
}
|
|
28128
|
-
function simulateCancelDeposit({ viemClient, vaultAddress, account }) {
|
|
28334
|
+
function simulateCancelDeposit({ viemClient, vaultAddress: vaultAddress$1, account }) {
|
|
28129
28335
|
return simulateContract(viemClient, {
|
|
28130
|
-
...getCancelDepositContractConfig({ vaultAddress }),
|
|
28336
|
+
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$1 }),
|
|
28131
28337
|
account
|
|
28132
28338
|
});
|
|
28133
28339
|
}
|
|
28134
|
-
function cancelDeposit({ walletClient, vaultAddress, account }) {
|
|
28340
|
+
function cancelDeposit({ walletClient, vaultAddress: vaultAddress$1, account }) {
|
|
28135
28341
|
return writeContract(walletClient, {
|
|
28136
|
-
...getCancelDepositContractConfig({ vaultAddress }),
|
|
28342
|
+
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$1 }),
|
|
28137
28343
|
account
|
|
28138
28344
|
});
|
|
28139
28345
|
}
|
|
@@ -28170,12 +28376,12 @@ const isErrorUserRejection = (errorMessage) => errorMessage.includes("User rejec
|
|
|
28170
28376
|
|
|
28171
28377
|
//#endregion
|
|
28172
28378
|
//#region src/hypoVault/cancelDeposit/hooks/use-cancel-deposit.ts
|
|
28173
|
-
const useCancelDeposit = ({ chainId, vaultAddress, onWaitSuccess }) => {
|
|
28379
|
+
const useCancelDeposit = ({ chainId, vaultAddress: vaultAddress$1, onWaitSuccess }) => {
|
|
28174
28380
|
const { address: account } = useAccount();
|
|
28175
|
-
const canSimulate = vaultAddress !== zeroAddress && account != null && account !== zeroAddress;
|
|
28381
|
+
const canSimulate = vaultAddress$1 !== zeroAddress && account != null && account !== zeroAddress;
|
|
28176
28382
|
const simulate = useSimulateContract({
|
|
28177
28383
|
chainId,
|
|
28178
|
-
...getCancelDepositContractConfig({ vaultAddress }),
|
|
28384
|
+
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$1 }),
|
|
28179
28385
|
account,
|
|
28180
28386
|
query: {
|
|
28181
28387
|
enabled: canSimulate,
|
|
@@ -28251,51 +28457,51 @@ function encodeExecuteWithdrawalMulticallFunctionData({ multicallCalldatas }) {
|
|
|
28251
28457
|
args: [multicallCalldatas]
|
|
28252
28458
|
});
|
|
28253
28459
|
}
|
|
28254
|
-
const getExecuteWithdrawalContractConfig = ({ vaultAddress, user, epoch }) => ({
|
|
28255
|
-
address: vaultAddress,
|
|
28460
|
+
const getExecuteWithdrawalContractConfig = ({ vaultAddress: vaultAddress$1, user, epoch }) => ({
|
|
28461
|
+
address: vaultAddress$1,
|
|
28256
28462
|
abi: HypoVaultAbi,
|
|
28257
28463
|
functionName: "executeWithdrawal",
|
|
28258
28464
|
args: [user, epoch]
|
|
28259
28465
|
});
|
|
28260
|
-
const getExecuteWithdrawalMulticallContractConfig = ({ vaultAddress, multicallCalldatas }) => ({
|
|
28261
|
-
address: vaultAddress,
|
|
28466
|
+
const getExecuteWithdrawalMulticallContractConfig = ({ vaultAddress: vaultAddress$1, multicallCalldatas }) => ({
|
|
28467
|
+
address: vaultAddress$1,
|
|
28262
28468
|
abi: HypoVaultAbi,
|
|
28263
28469
|
functionName: "multicall",
|
|
28264
28470
|
args: [multicallCalldatas]
|
|
28265
28471
|
});
|
|
28266
|
-
function simulateExecuteWithdrawal({ viemClient, vaultAddress, user, epoch, account }) {
|
|
28472
|
+
function simulateExecuteWithdrawal({ viemClient, vaultAddress: vaultAddress$1, user, epoch, account }) {
|
|
28267
28473
|
return simulateContract(viemClient, {
|
|
28268
28474
|
...getExecuteWithdrawalContractConfig({
|
|
28269
|
-
vaultAddress,
|
|
28475
|
+
vaultAddress: vaultAddress$1,
|
|
28270
28476
|
user,
|
|
28271
28477
|
epoch
|
|
28272
28478
|
}),
|
|
28273
28479
|
account
|
|
28274
28480
|
});
|
|
28275
28481
|
}
|
|
28276
|
-
function executeWithdrawal({ walletClient, vaultAddress, user, epoch, account }) {
|
|
28482
|
+
function executeWithdrawal({ walletClient, vaultAddress: vaultAddress$1, user, epoch, account }) {
|
|
28277
28483
|
return writeContract(walletClient, {
|
|
28278
28484
|
...getExecuteWithdrawalContractConfig({
|
|
28279
|
-
vaultAddress,
|
|
28485
|
+
vaultAddress: vaultAddress$1,
|
|
28280
28486
|
user,
|
|
28281
28487
|
epoch
|
|
28282
28488
|
}),
|
|
28283
28489
|
account
|
|
28284
28490
|
});
|
|
28285
28491
|
}
|
|
28286
|
-
function simulateExecuteWithdrawalMulticall({ viemClient, vaultAddress, multicallCalldatas, account }) {
|
|
28492
|
+
function simulateExecuteWithdrawalMulticall({ viemClient, vaultAddress: vaultAddress$1, multicallCalldatas, account }) {
|
|
28287
28493
|
return simulateContract(viemClient, {
|
|
28288
28494
|
...getExecuteWithdrawalMulticallContractConfig({
|
|
28289
|
-
vaultAddress,
|
|
28495
|
+
vaultAddress: vaultAddress$1,
|
|
28290
28496
|
multicallCalldatas
|
|
28291
28497
|
}),
|
|
28292
28498
|
account
|
|
28293
28499
|
});
|
|
28294
28500
|
}
|
|
28295
|
-
function executeWithdrawalMulticall({ walletClient, vaultAddress, multicallCalldatas, account }) {
|
|
28501
|
+
function executeWithdrawalMulticall({ walletClient, vaultAddress: vaultAddress$1, multicallCalldatas, account }) {
|
|
28296
28502
|
return writeContract(walletClient, {
|
|
28297
28503
|
...getExecuteWithdrawalMulticallContractConfig({
|
|
28298
|
-
vaultAddress,
|
|
28504
|
+
vaultAddress: vaultAddress$1,
|
|
28299
28505
|
multicallCalldatas
|
|
28300
28506
|
}),
|
|
28301
28507
|
account
|
|
@@ -28375,7 +28581,7 @@ const selectExecutableWithdrawalEpochs = ({ desiredAssets, maxAssetsToExecute, c
|
|
|
28375
28581
|
assetsToExecute: accumulatedAssets
|
|
28376
28582
|
};
|
|
28377
28583
|
};
|
|
28378
|
-
const useExecuteWithdrawal = ({ chainId, vaultAddress, desiredAssets, maxAssetsToExecute, queuedWithdrawals, withdrawalEpochStates, currentWithdrawalEpoch, simulationAccount, onWaitSuccess }) => {
|
|
28584
|
+
const useExecuteWithdrawal = ({ chainId, vaultAddress: vaultAddress$1, desiredAssets, maxAssetsToExecute, queuedWithdrawals, withdrawalEpochStates, currentWithdrawalEpoch, simulationAccount, onWaitSuccess }) => {
|
|
28379
28585
|
const { address: account } = useAccount();
|
|
28380
28586
|
const simulatedAccount = simulationAccount ?? account;
|
|
28381
28587
|
const user = simulatedAccount ?? zeroAddress;
|
|
@@ -28419,11 +28625,11 @@ const useExecuteWithdrawal = ({ chainId, vaultAddress, desiredAssets, maxAssetsT
|
|
|
28419
28625
|
assetsToExecute,
|
|
28420
28626
|
claimableAssets: claimableWithdrawals.totalAssets
|
|
28421
28627
|
});
|
|
28422
|
-
const canSimulate = multicallCalldatas.length > 0 && vaultAddress !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
28628
|
+
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$1 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
28423
28629
|
const simulate = useSimulateContract({
|
|
28424
28630
|
chainId,
|
|
28425
28631
|
...getExecuteWithdrawalMulticallContractConfig({
|
|
28426
|
-
vaultAddress,
|
|
28632
|
+
vaultAddress: vaultAddress$1,
|
|
28427
28633
|
multicallCalldatas
|
|
28428
28634
|
}),
|
|
28429
28635
|
account: simulatedAccount,
|
|
@@ -29507,6 +29713,7 @@ const HypoVaultManagerConfigSchema = z.object({
|
|
|
29507
29713
|
"base",
|
|
29508
29714
|
"mainnet-prod",
|
|
29509
29715
|
"mainnet-legacy",
|
|
29716
|
+
"robinhood-prod",
|
|
29510
29717
|
"sepolia"
|
|
29511
29718
|
]).optional(),
|
|
29512
29719
|
vaultAssetIndex: z.union([z.literal(0n), z.literal(1n)]),
|
|
@@ -29539,7 +29746,11 @@ const HypoVaultManagerConfigSchema = z.object({
|
|
|
29539
29746
|
maxHedgeSlots: z.number().int().positive().optional(),
|
|
29540
29747
|
timedRehedge: timedRehedgeSchema.optional()
|
|
29541
29748
|
}).optional(),
|
|
29542
|
-
alerts: z.object({ outOfRangeEnabled: z.boolean().optional() }).optional()
|
|
29749
|
+
alerts: z.object({ outOfRangeEnabled: z.boolean().optional() }).optional(),
|
|
29750
|
+
reporting: z.object({
|
|
29751
|
+
assetSymbol: z.string().min(1),
|
|
29752
|
+
vaultLabel: z.string().min(1)
|
|
29753
|
+
}).optional()
|
|
29543
29754
|
});
|
|
29544
29755
|
|
|
29545
29756
|
//#endregion
|
|
@@ -29568,8 +29779,8 @@ function encodeFulfillWithdrawalsFunctionData({ sharesToFulfill, maxAssetsReceiv
|
|
|
29568
29779
|
|
|
29569
29780
|
//#endregion
|
|
29570
29781
|
//#region src/hypoVault/requestDeposit/requestDeposit.ts
|
|
29571
|
-
const getRequestDepositContractConfig = ({ vaultAddress, assets }) => ({
|
|
29572
|
-
address: vaultAddress,
|
|
29782
|
+
const getRequestDepositContractConfig = ({ vaultAddress: vaultAddress$1, assets }) => ({
|
|
29783
|
+
address: vaultAddress$1,
|
|
29573
29784
|
abi: HypoVaultAbi,
|
|
29574
29785
|
functionName: "requestDeposit",
|
|
29575
29786
|
args: [assets]
|
|
@@ -29581,19 +29792,19 @@ function encodeRequestDepositFunctionData({ assets }) {
|
|
|
29581
29792
|
args: [assets]
|
|
29582
29793
|
});
|
|
29583
29794
|
}
|
|
29584
|
-
function simulateRequestDeposit({ viemClient, vaultAddress, assets, account }) {
|
|
29795
|
+
function simulateRequestDeposit({ viemClient, vaultAddress: vaultAddress$1, assets, account }) {
|
|
29585
29796
|
return simulateContract(viemClient, {
|
|
29586
29797
|
...getRequestDepositContractConfig({
|
|
29587
|
-
vaultAddress,
|
|
29798
|
+
vaultAddress: vaultAddress$1,
|
|
29588
29799
|
assets
|
|
29589
29800
|
}),
|
|
29590
29801
|
account
|
|
29591
29802
|
});
|
|
29592
29803
|
}
|
|
29593
|
-
function requestDeposit({ walletClient, vaultAddress, assets, account }) {
|
|
29804
|
+
function requestDeposit({ walletClient, vaultAddress: vaultAddress$1, assets, account }) {
|
|
29594
29805
|
return writeContract(walletClient, {
|
|
29595
29806
|
...getRequestDepositContractConfig({
|
|
29596
|
-
vaultAddress,
|
|
29807
|
+
vaultAddress: vaultAddress$1,
|
|
29597
29808
|
assets
|
|
29598
29809
|
}),
|
|
29599
29810
|
account
|
|
@@ -29604,16 +29815,16 @@ function requestDeposit({ walletClient, vaultAddress, assets, account }) {
|
|
|
29604
29815
|
//#region src/hypoVault/requestDeposit/hooks/use-request-deposit.ts
|
|
29605
29816
|
const APPROVAL_SYNC_POLL_INTERVAL_MS = 1200;
|
|
29606
29817
|
const APPROVAL_SYNC_MAX_ATTEMPTS = 20;
|
|
29607
|
-
const useRequestDeposit = ({ chainId, vaultAddress, assets, tokenAddress, simulationAccount, onWaitSuccess }) => {
|
|
29818
|
+
const useRequestDeposit = ({ chainId, vaultAddress: vaultAddress$1, assets, tokenAddress, simulationAccount, onWaitSuccess }) => {
|
|
29608
29819
|
const { address: account } = useAccount();
|
|
29609
29820
|
const simulatedAccount = simulationAccount ?? account;
|
|
29610
|
-
const canReadAllowance = simulatedAccount != null && simulatedAccount !== zeroAddress && tokenAddress !== zeroAddress && vaultAddress !== zeroAddress;
|
|
29821
|
+
const canReadAllowance = simulatedAccount != null && simulatedAccount !== zeroAddress && tokenAddress !== zeroAddress && vaultAddress$1 !== zeroAddress;
|
|
29611
29822
|
const allowanceRead = useReadContract({
|
|
29612
29823
|
chainId,
|
|
29613
29824
|
address: canReadAllowance ? tokenAddress : void 0,
|
|
29614
29825
|
abi: Erc20Abi,
|
|
29615
29826
|
functionName: "allowance",
|
|
29616
|
-
args: canReadAllowance ? [simulatedAccount, vaultAddress] : void 0,
|
|
29827
|
+
args: canReadAllowance ? [simulatedAccount, vaultAddress$1] : void 0,
|
|
29617
29828
|
query: { enabled: canReadAllowance }
|
|
29618
29829
|
});
|
|
29619
29830
|
const allowanceKnown = allowanceRead.data !== void 0;
|
|
@@ -29627,7 +29838,7 @@ const useRequestDeposit = ({ chainId, vaultAddress, assets, tokenAddress, simula
|
|
|
29627
29838
|
address: tokenAddress,
|
|
29628
29839
|
abi: Erc20Abi,
|
|
29629
29840
|
functionName: "approve",
|
|
29630
|
-
args: [vaultAddress, maxUint256],
|
|
29841
|
+
args: [vaultAddress$1, maxUint256],
|
|
29631
29842
|
account,
|
|
29632
29843
|
query: {
|
|
29633
29844
|
enabled: allowanceKnown && tokenNeedsApproval && assets > 0n && account != null && canApproveForSimulatedAccount,
|
|
@@ -29646,12 +29857,12 @@ const useRequestDeposit = ({ chainId, vaultAddress, assets, tokenAddress, simula
|
|
|
29646
29857
|
const simulate = useSimulateContract({
|
|
29647
29858
|
chainId,
|
|
29648
29859
|
...getRequestDepositContractConfig({
|
|
29649
|
-
vaultAddress,
|
|
29860
|
+
vaultAddress: vaultAddress$1,
|
|
29650
29861
|
assets
|
|
29651
29862
|
}),
|
|
29652
29863
|
account: simulatedAccount,
|
|
29653
29864
|
query: {
|
|
29654
|
-
enabled: allowanceKnown && !tokenNeedsApproval && assets > 0n && vaultAddress !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress,
|
|
29865
|
+
enabled: allowanceKnown && !tokenNeedsApproval && assets > 0n && vaultAddress$1 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress,
|
|
29655
29866
|
retry: false
|
|
29656
29867
|
}
|
|
29657
29868
|
});
|
|
@@ -29910,49 +30121,49 @@ function encodeRequestWithdrawalMulticallFunctionData({ multicallCalldatas }) {
|
|
|
29910
30121
|
args: [multicallCalldatas]
|
|
29911
30122
|
});
|
|
29912
30123
|
}
|
|
29913
|
-
const getRequestWithdrawalContractConfig = ({ vaultAddress, shares }) => ({
|
|
29914
|
-
address: vaultAddress,
|
|
30124
|
+
const getRequestWithdrawalContractConfig = ({ vaultAddress: vaultAddress$1, shares }) => ({
|
|
30125
|
+
address: vaultAddress$1,
|
|
29915
30126
|
abi: HypoVaultAbi,
|
|
29916
30127
|
functionName: "requestWithdrawal",
|
|
29917
30128
|
args: [shares]
|
|
29918
30129
|
});
|
|
29919
|
-
const getRequestWithdrawalMulticallContractConfig = ({ vaultAddress, multicallCalldatas }) => ({
|
|
29920
|
-
address: vaultAddress,
|
|
30130
|
+
const getRequestWithdrawalMulticallContractConfig = ({ vaultAddress: vaultAddress$1, multicallCalldatas }) => ({
|
|
30131
|
+
address: vaultAddress$1,
|
|
29921
30132
|
abi: HypoVaultAbi,
|
|
29922
30133
|
functionName: "multicall",
|
|
29923
30134
|
args: [multicallCalldatas]
|
|
29924
30135
|
});
|
|
29925
|
-
function simulateRequestWithdrawal({ viemClient, vaultAddress, shares, account }) {
|
|
30136
|
+
function simulateRequestWithdrawal({ viemClient, vaultAddress: vaultAddress$1, shares, account }) {
|
|
29926
30137
|
return simulateContract(viemClient, {
|
|
29927
30138
|
...getRequestWithdrawalContractConfig({
|
|
29928
|
-
vaultAddress,
|
|
30139
|
+
vaultAddress: vaultAddress$1,
|
|
29929
30140
|
shares
|
|
29930
30141
|
}),
|
|
29931
30142
|
account
|
|
29932
30143
|
});
|
|
29933
30144
|
}
|
|
29934
|
-
function requestWithdrawal({ walletClient, vaultAddress, shares, account }) {
|
|
30145
|
+
function requestWithdrawal({ walletClient, vaultAddress: vaultAddress$1, shares, account }) {
|
|
29935
30146
|
return writeContract(walletClient, {
|
|
29936
30147
|
...getRequestWithdrawalContractConfig({
|
|
29937
|
-
vaultAddress,
|
|
30148
|
+
vaultAddress: vaultAddress$1,
|
|
29938
30149
|
shares
|
|
29939
30150
|
}),
|
|
29940
30151
|
account
|
|
29941
30152
|
});
|
|
29942
30153
|
}
|
|
29943
|
-
function simulateRequestWithdrawalMulticall({ viemClient, vaultAddress, multicallCalldatas, account }) {
|
|
30154
|
+
function simulateRequestWithdrawalMulticall({ viemClient, vaultAddress: vaultAddress$1, multicallCalldatas, account }) {
|
|
29944
30155
|
return simulateContract(viemClient, {
|
|
29945
30156
|
...getRequestWithdrawalMulticallContractConfig({
|
|
29946
|
-
vaultAddress,
|
|
30157
|
+
vaultAddress: vaultAddress$1,
|
|
29947
30158
|
multicallCalldatas
|
|
29948
30159
|
}),
|
|
29949
30160
|
account
|
|
29950
30161
|
});
|
|
29951
30162
|
}
|
|
29952
|
-
function requestWithdrawalMulticall({ walletClient, vaultAddress, multicallCalldatas, account }) {
|
|
30163
|
+
function requestWithdrawalMulticall({ walletClient, vaultAddress: vaultAddress$1, multicallCalldatas, account }) {
|
|
29953
30164
|
return writeContract(walletClient, {
|
|
29954
30165
|
...getRequestWithdrawalMulticallContractConfig({
|
|
29955
|
-
vaultAddress,
|
|
30166
|
+
vaultAddress: vaultAddress$1,
|
|
29956
30167
|
multicallCalldatas
|
|
29957
30168
|
}),
|
|
29958
30169
|
account
|
|
@@ -30023,7 +30234,7 @@ function buildRequestWithdrawalCalldatas({ user, desiredAssets, requestAllAvaila
|
|
|
30023
30234
|
|
|
30024
30235
|
//#endregion
|
|
30025
30236
|
//#region src/hypoVault/requestWithdrawal/hooks/use-claim-vault-shares.ts
|
|
30026
|
-
const useClaimVaultShares = ({ chainId, vaultAddress, queuedDeposits, depositEpochStates, currentDepositEpoch, simulationAccount, onWaitSuccess }) => {
|
|
30237
|
+
const useClaimVaultShares = ({ chainId, vaultAddress: vaultAddress$1, queuedDeposits, depositEpochStates, currentDepositEpoch, simulationAccount, onWaitSuccess }) => {
|
|
30027
30238
|
const { address: account } = useAccount();
|
|
30028
30239
|
const simulatedAccount = simulationAccount ?? account;
|
|
30029
30240
|
const user = simulatedAccount ?? zeroAddress;
|
|
@@ -30038,11 +30249,11 @@ const useClaimVaultShares = ({ chainId, vaultAddress, queuedDeposits, depositEpo
|
|
|
30038
30249
|
depositEpochStates,
|
|
30039
30250
|
currentDepositEpoch
|
|
30040
30251
|
]);
|
|
30041
|
-
const canSimulate = multicallCalldatas.length > 0 && vaultAddress !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
30252
|
+
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$1 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
30042
30253
|
const simulate = useSimulateContract({
|
|
30043
30254
|
chainId,
|
|
30044
30255
|
...getRequestWithdrawalMulticallContractConfig({
|
|
30045
|
-
vaultAddress,
|
|
30256
|
+
vaultAddress: vaultAddress$1,
|
|
30046
30257
|
multicallCalldatas
|
|
30047
30258
|
}),
|
|
30048
30259
|
account: simulatedAccount,
|
|
@@ -30115,7 +30326,7 @@ const useClaimVaultShares = ({ chainId, vaultAddress, queuedDeposits, depositEpo
|
|
|
30115
30326
|
|
|
30116
30327
|
//#endregion
|
|
30117
30328
|
//#region src/hypoVault/requestWithdrawal/hooks/use-request-withdrawal.ts
|
|
30118
|
-
const useRequestWithdrawal = ({ chainId, vaultAddress, desiredAssets, requestAllAvailableShares = false, sharePrice, walletShares, queuedDeposits, depositEpochStates, currentDepositEpoch, simulationAccount, onWaitSuccess }) => {
|
|
30329
|
+
const useRequestWithdrawal = ({ chainId, vaultAddress: vaultAddress$1, desiredAssets, requestAllAvailableShares = false, sharePrice, walletShares, queuedDeposits, depositEpochStates, currentDepositEpoch, simulationAccount, onWaitSuccess }) => {
|
|
30119
30330
|
const { address: account } = useAccount();
|
|
30120
30331
|
const simulatedAccount = simulationAccount ?? account;
|
|
30121
30332
|
const user = simulatedAccount ?? zeroAddress;
|
|
@@ -30138,11 +30349,11 @@ const useRequestWithdrawal = ({ chainId, vaultAddress, desiredAssets, requestAll
|
|
|
30138
30349
|
depositEpochStates,
|
|
30139
30350
|
currentDepositEpoch
|
|
30140
30351
|
]);
|
|
30141
|
-
const canSimulate = multicallCalldatas.length > 0 && vaultAddress !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
30352
|
+
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$1 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
30142
30353
|
const simulate = useSimulateContract({
|
|
30143
30354
|
chainId,
|
|
30144
30355
|
...getRequestWithdrawalMulticallContractConfig({
|
|
30145
|
-
vaultAddress,
|
|
30356
|
+
vaultAddress: vaultAddress$1,
|
|
30146
30357
|
multicallCalldatas
|
|
30147
30358
|
}),
|
|
30148
30359
|
account: simulatedAccount,
|
|
@@ -30666,7 +30877,7 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
30666
30877
|
//#endregion
|
|
30667
30878
|
//#region src/graphqlClient.ts
|
|
30668
30879
|
const chainToHypoVaultGraphQlAPI = {};
|
|
30669
|
-
for (const deployment of Object.values(CHAIN_DEPLOYMENTS)) chainToHypoVaultGraphQlAPI[deployment.chainId] = deployment.subgraphs.hypovault;
|
|
30880
|
+
for (const deployment$2 of Object.values(CHAIN_DEPLOYMENTS)) chainToHypoVaultGraphQlAPI[deployment$2.chainId] = deployment$2.subgraphs.hypovault;
|
|
30670
30881
|
function getHypoVaultGraphQLClient(chainId) {
|
|
30671
30882
|
const apiUrl = chainToHypoVaultGraphQlAPI[chainId];
|
|
30672
30883
|
if (apiUrl === void 0) throw new Error(`Unsupported HypoVault subgraph chainId: ${chainId}`);
|
|
@@ -30680,7 +30891,7 @@ function parseTimestampSec(value) {
|
|
|
30680
30891
|
const parsed = Number(value);
|
|
30681
30892
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
30682
30893
|
}
|
|
30683
|
-
async function fetchFirstDepositTimestampForVault({ graphClient, vaultAddress }) {
|
|
30894
|
+
async function fetchFirstDepositTimestampForVault({ graphClient, vaultAddress: vaultAddress$1 }) {
|
|
30684
30895
|
const response = await graphClient.request(`
|
|
30685
30896
|
query FirstVaultDepositTimestamp($hypoVault: String!) {
|
|
30686
30897
|
depositExecuteds(
|
|
@@ -30714,7 +30925,7 @@ async function fetchFirstDepositTimestampForVault({ graphClient, vaultAddress })
|
|
|
30714
30925
|
}
|
|
30715
30926
|
}
|
|
30716
30927
|
}
|
|
30717
|
-
`, { hypoVault: vaultAddress.toLowerCase() });
|
|
30928
|
+
`, { hypoVault: vaultAddress$1.toLowerCase() });
|
|
30718
30929
|
const timestamps = [...response.depositExecuteds, ...response.depositsFulfilleds].map((event) => parseTimestampSec(event.blockTimestamp)).filter((timestamp) => timestamp !== null);
|
|
30719
30930
|
if (timestamps.length === 0) return null;
|
|
30720
30931
|
return Math.min(...timestamps);
|
|
@@ -30723,8 +30934,8 @@ async function fetchFirstDepositTimestampByVaultId({ chainId, vaultAddresses })
|
|
|
30723
30934
|
const endpoint = chainToHypoVaultGraphQlAPI[chainId];
|
|
30724
30935
|
if (endpoint === void 0 || vaultAddresses.length === 0) return {};
|
|
30725
30936
|
const graphClient = new GraphQLClient(endpoint);
|
|
30726
|
-
const entries = await Promise.all(vaultAddresses.map(async (vaultAddress) => {
|
|
30727
|
-
const vaultAddressLower = vaultAddress.toLowerCase();
|
|
30937
|
+
const entries = await Promise.all(vaultAddresses.map(async (vaultAddress$1) => {
|
|
30938
|
+
const vaultAddressLower = vaultAddress$1.toLowerCase();
|
|
30728
30939
|
const timestamp = await fetchFirstDepositTimestampForVault({
|
|
30729
30940
|
graphClient,
|
|
30730
30941
|
vaultAddress: vaultAddressLower
|
|
@@ -30838,85 +31049,85 @@ function getStaleOracleStateOverrideForAccountant(accountantAddress) {
|
|
|
30838
31049
|
//#endregion
|
|
30839
31050
|
//#region src/hypoVault/sharePrice/strategies.ts
|
|
30840
31051
|
const DEFAULT_MANAGER_INPUT = "0x";
|
|
30841
|
-
function buildVaultStrategyKey(chainId, vaultAddress) {
|
|
30842
|
-
return `${chainId}:${vaultAddress.toLowerCase()}`;
|
|
31052
|
+
function buildVaultStrategyKey(chainId, vaultAddress$1) {
|
|
31053
|
+
return `${chainId}:${vaultAddress$1.toLowerCase()}`;
|
|
30843
31054
|
}
|
|
30844
31055
|
function resolveChainWethAddress(chainId) {
|
|
30845
|
-
let deployment;
|
|
31056
|
+
let deployment$2;
|
|
30846
31057
|
try {
|
|
30847
|
-
deployment = requireChainDeployment(chainId);
|
|
31058
|
+
deployment$2 = requireChainDeployment(chainId);
|
|
30848
31059
|
} catch {
|
|
30849
31060
|
return void 0;
|
|
30850
31061
|
}
|
|
30851
|
-
const wethVaultAddress = deployment.hypovault.vaults.wethPlpVault;
|
|
31062
|
+
const wethVaultAddress = deployment$2.hypovault.vaults.wethPlpVault;
|
|
30852
31063
|
return getHypoVaultConfigForVault(wethVaultAddress, chainId)?.addresses?.underlyingToken;
|
|
30853
31064
|
}
|
|
30854
|
-
function getPlpManagerAddress(chainId, vaultAddress) {
|
|
30855
|
-
return getHypoVaultConfigForVault(vaultAddress, chainId)?.addresses?.hypoVaultManagerWithMerkleVerification ?? null;
|
|
31065
|
+
function getPlpManagerAddress(chainId, vaultAddress$1) {
|
|
31066
|
+
return getHypoVaultConfigForVault(vaultAddress$1, chainId)?.addresses?.hypoVaultManagerWithMerkleVerification ?? null;
|
|
30856
31067
|
}
|
|
30857
|
-
async function getPlpPoolInfosAtBlock({ chainId, client, vaultAddress, blockNumber }) {
|
|
31068
|
+
async function getPlpPoolInfosAtBlock({ chainId, client, vaultAddress: vaultAddress$1, blockNumber }) {
|
|
30858
31069
|
return resolveVaultPoolInfosAtBlock({
|
|
30859
31070
|
viemClient: client,
|
|
30860
31071
|
chainId,
|
|
30861
|
-
vaultAddress,
|
|
31072
|
+
vaultAddress: vaultAddress$1,
|
|
30862
31073
|
blockNumber
|
|
30863
31074
|
});
|
|
30864
31075
|
}
|
|
30865
31076
|
function createPlpManagerInputStrategy(minBlock) {
|
|
30866
31077
|
return {
|
|
30867
31078
|
enabledMetrics: ["nav"],
|
|
30868
|
-
resolveCandidates: async ({ chainId, vault }) => {
|
|
30869
|
-
const vaultAddress = vault.id;
|
|
30870
|
-
const poolInfos = getVaultCandidatePoolInfos(vaultAddress, chainId);
|
|
31079
|
+
resolveCandidates: async ({ chainId, vault: vault$2 }) => {
|
|
31080
|
+
const vaultAddress$1 = vault$2.id;
|
|
31081
|
+
const poolInfos = getVaultCandidatePoolInfos(vaultAddress$1, chainId);
|
|
30871
31082
|
if (poolInfos.length === 0) return [];
|
|
30872
31083
|
return resolveVaultHistoricalCandidatesByPool({
|
|
30873
31084
|
chainId,
|
|
30874
|
-
vaultAddress,
|
|
30875
|
-
managerAddress: getPlpManagerAddress(chainId, vaultAddress),
|
|
31085
|
+
vaultAddress: vaultAddress$1,
|
|
31086
|
+
managerAddress: getPlpManagerAddress(chainId, vaultAddress$1),
|
|
30876
31087
|
poolInfos
|
|
30877
31088
|
});
|
|
30878
31089
|
},
|
|
30879
|
-
recoverCandidates: async ({ chainId, client, vault, blockNumber, fromBlock, candidates }) => {
|
|
30880
|
-
const vaultAddress = vault.id;
|
|
31090
|
+
recoverCandidates: async ({ chainId, client, vault: vault$2, blockNumber, fromBlock, candidates }) => {
|
|
31091
|
+
const vaultAddress$1 = vault$2.id;
|
|
30881
31092
|
return recoverVaultCandidateTokenIdsByPool({
|
|
30882
31093
|
viemClient: client,
|
|
30883
31094
|
chainId,
|
|
30884
|
-
vaultAddress,
|
|
31095
|
+
vaultAddress: vaultAddress$1,
|
|
30885
31096
|
candidatesByPool: candidates,
|
|
30886
31097
|
poolInfos: await getPlpPoolInfosAtBlock({
|
|
30887
31098
|
chainId,
|
|
30888
31099
|
client,
|
|
30889
|
-
vaultAddress,
|
|
31100
|
+
vaultAddress: vaultAddress$1,
|
|
30890
31101
|
blockNumber
|
|
30891
31102
|
}),
|
|
30892
31103
|
blockNumber,
|
|
30893
31104
|
fromBlock
|
|
30894
31105
|
});
|
|
30895
31106
|
},
|
|
30896
|
-
managerInputProvider: async ({ chainId, client, vault, blockNumber, candidates }) => {
|
|
30897
|
-
const vaultAddress = vault.id;
|
|
31107
|
+
managerInputProvider: async ({ chainId, client, vault: vault$2, blockNumber, candidates }) => {
|
|
31108
|
+
const vaultAddress$1 = vault$2.id;
|
|
30898
31109
|
if (minBlock !== void 0 && blockNumber < minBlock) throw new VaultApyPreInceptionBlockError({
|
|
30899
31110
|
blockNumber,
|
|
30900
31111
|
minBlockNumber: minBlock,
|
|
30901
|
-
context: `PLP manager input for vault ${vault.id}`
|
|
31112
|
+
context: `PLP manager input for vault ${vault$2.id}`
|
|
30902
31113
|
});
|
|
30903
31114
|
const poolInfos = await getPlpPoolInfosAtBlock({
|
|
30904
31115
|
chainId,
|
|
30905
31116
|
client,
|
|
30906
|
-
vaultAddress,
|
|
31117
|
+
vaultAddress: vaultAddress$1,
|
|
30907
31118
|
blockNumber
|
|
30908
31119
|
});
|
|
30909
31120
|
if (poolInfos.length === 0) return DEFAULT_MANAGER_INPUT;
|
|
30910
31121
|
const tokenIds = candidates === void 0 ? await resolveVaultTokenIdsByPool({
|
|
30911
31122
|
viemClient: client,
|
|
30912
31123
|
chainId,
|
|
30913
|
-
vaultAddress,
|
|
30914
|
-
managerAddress: getPlpManagerAddress(chainId, vaultAddress),
|
|
31124
|
+
vaultAddress: vaultAddress$1,
|
|
31125
|
+
managerAddress: getPlpManagerAddress(chainId, vaultAddress$1),
|
|
30915
31126
|
poolInfos,
|
|
30916
31127
|
verificationBlockNumber: blockNumber
|
|
30917
31128
|
}) : await verifyVaultOpenTokenIdsAtBlock({
|
|
30918
31129
|
viemClient: client,
|
|
30919
|
-
vaultAddress,
|
|
31130
|
+
vaultAddress: vaultAddress$1,
|
|
30920
31131
|
candidatesByPool: poolInfos.map((poolInfo) => {
|
|
30921
31132
|
const candidate = candidates.find((item) => item.poolAddress.toLowerCase() === poolInfo.pool.toLowerCase());
|
|
30922
31133
|
if (candidate === void 0) throw new Error(`Missing token-id candidates for authorized pool ${poolInfo.pool}`);
|
|
@@ -30932,7 +31143,7 @@ function createPlpManagerInputStrategy(minBlock) {
|
|
|
30932
31143
|
viemClient: client,
|
|
30933
31144
|
poolInfos,
|
|
30934
31145
|
tokenIds,
|
|
30935
|
-
underlyingToken: vault.underlyingToken.id,
|
|
31146
|
+
underlyingToken: vault$2.underlyingToken.id,
|
|
30936
31147
|
...wethAddress === void 0 ? {} : { wethAddress },
|
|
30937
31148
|
blockNumber
|
|
30938
31149
|
});
|
|
@@ -30956,19 +31167,20 @@ const strategyOverridesByVaultKey = {
|
|
|
30956
31167
|
[buildVaultStrategyKey(MAINNET_CHAIN_ID, MainnetWETHPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(),
|
|
30957
31168
|
[buildVaultStrategyKey(BASE_CHAIN_ID, BaseUSDCPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(),
|
|
30958
31169
|
[buildVaultStrategyKey(BASE_CHAIN_ID, BaseWETHPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(),
|
|
31170
|
+
[buildVaultStrategyKey(ROBINHOOD_CHAIN_ID, RobinhoodUSDGPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(),
|
|
30959
31171
|
[buildVaultStrategyKey(SEPOLIA_CHAIN_ID, SepoliaUSDCPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(SEPOLIA_PLP_POOL_MIN_BLOCK),
|
|
30960
31172
|
[buildVaultStrategyKey(SEPOLIA_CHAIN_ID, SepoliaWETHPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(SEPOLIA_PLP_POOL_MIN_BLOCK)
|
|
30961
31173
|
};
|
|
30962
|
-
function getVaultApyStrategy({ chainId, vaultAddress }) {
|
|
30963
|
-
const key = buildVaultStrategyKey(chainId, vaultAddress);
|
|
31174
|
+
function getVaultApyStrategy({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
31175
|
+
const key = buildVaultStrategyKey(chainId, vaultAddress$1);
|
|
30964
31176
|
return strategyOverridesByVaultKey[key] ?? defaultStrategy;
|
|
30965
31177
|
}
|
|
30966
|
-
function setVaultApyStrategyOverride({ chainId, vaultAddress, strategy }) {
|
|
30967
|
-
const key = buildVaultStrategyKey(chainId, vaultAddress);
|
|
31178
|
+
function setVaultApyStrategyOverride({ chainId, vaultAddress: vaultAddress$1, strategy }) {
|
|
31179
|
+
const key = buildVaultStrategyKey(chainId, vaultAddress$1);
|
|
30968
31180
|
strategyOverridesByVaultKey[key] = strategy;
|
|
30969
31181
|
}
|
|
30970
|
-
function clearVaultApyStrategyOverride({ chainId, vaultAddress }) {
|
|
30971
|
-
const key = buildVaultStrategyKey(chainId, vaultAddress);
|
|
31182
|
+
function clearVaultApyStrategyOverride({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
31183
|
+
const key = buildVaultStrategyKey(chainId, vaultAddress$1);
|
|
30972
31184
|
delete strategyOverridesByVaultKey[key];
|
|
30973
31185
|
}
|
|
30974
31186
|
|
|
@@ -30987,17 +31199,17 @@ function getAssetsDepositedFromDepositEpochState(value) {
|
|
|
30987
31199
|
}
|
|
30988
31200
|
return null;
|
|
30989
31201
|
}
|
|
30990
|
-
async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabel, blockNumber, readContractFn, candidates, includeTokenIdsInDiagnostics = false }) {
|
|
30991
|
-
const vaultAddress = vault.id;
|
|
30992
|
-
const accountantAddress = vault.accountant;
|
|
30993
|
-
const underlyingTokenAddress = vault.underlyingToken.id;
|
|
31202
|
+
async function fetchVaultSharePriceSnapshot({ client, vault: vault$2, chainId, windowLabel, blockNumber, readContractFn, candidates, includeTokenIdsInDiagnostics = false }) {
|
|
31203
|
+
const vaultAddress$1 = vault$2.id;
|
|
31204
|
+
const accountantAddress = vault$2.accountant;
|
|
31205
|
+
const underlyingTokenAddress = vault$2.underlyingToken.id;
|
|
30994
31206
|
const strategy = getVaultApyStrategy({
|
|
30995
31207
|
chainId,
|
|
30996
|
-
vaultAddress
|
|
31208
|
+
vaultAddress: vaultAddress$1
|
|
30997
31209
|
});
|
|
30998
31210
|
const managerInputProviderResult = await strategy.managerInputProvider({
|
|
30999
31211
|
chainId,
|
|
31000
|
-
vault,
|
|
31212
|
+
vault: vault$2,
|
|
31001
31213
|
client,
|
|
31002
31214
|
blockNumber,
|
|
31003
31215
|
candidates
|
|
@@ -31025,7 +31237,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabe
|
|
|
31025
31237
|
readWithContext({
|
|
31026
31238
|
callName: "depositEpoch",
|
|
31027
31239
|
request: {
|
|
31028
|
-
address: vaultAddress,
|
|
31240
|
+
address: vaultAddress$1,
|
|
31029
31241
|
abi: HypoVaultAbi,
|
|
31030
31242
|
functionName: "depositEpoch",
|
|
31031
31243
|
blockNumber
|
|
@@ -31034,7 +31246,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabe
|
|
|
31034
31246
|
readWithContext({
|
|
31035
31247
|
callName: "reservedWithdrawalAssets",
|
|
31036
31248
|
request: {
|
|
31037
|
-
address: vaultAddress,
|
|
31249
|
+
address: vaultAddress$1,
|
|
31038
31250
|
abi: HypoVaultAbi,
|
|
31039
31251
|
functionName: "reservedWithdrawalAssets",
|
|
31040
31252
|
blockNumber
|
|
@@ -31043,7 +31255,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabe
|
|
|
31043
31255
|
readWithContext({
|
|
31044
31256
|
callName: "totalSupply",
|
|
31045
31257
|
request: {
|
|
31046
|
-
address: vaultAddress,
|
|
31258
|
+
address: vaultAddress$1,
|
|
31047
31259
|
abi: HypoVaultAbi,
|
|
31048
31260
|
functionName: "totalSupply",
|
|
31049
31261
|
blockNumber
|
|
@@ -31051,11 +31263,11 @@ async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabe
|
|
|
31051
31263
|
})
|
|
31052
31264
|
]);
|
|
31053
31265
|
const depositEpoch = toBigInt(depositEpochRaw);
|
|
31054
|
-
if (depositEpoch === null) throw new Error(`Unexpected depositEpoch output type for vault ${vault.id}`);
|
|
31266
|
+
if (depositEpoch === null) throw new Error(`Unexpected depositEpoch output type for vault ${vault$2.id}`);
|
|
31055
31267
|
const depositEpochStateRaw = await readWithContext({
|
|
31056
31268
|
callName: "depositEpochState",
|
|
31057
31269
|
request: {
|
|
31058
|
-
address: vaultAddress,
|
|
31270
|
+
address: vaultAddress$1,
|
|
31059
31271
|
abi: HypoVaultAbi,
|
|
31060
31272
|
functionName: "depositEpochState",
|
|
31061
31273
|
args: [depositEpoch],
|
|
@@ -31065,7 +31277,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabe
|
|
|
31065
31277
|
const reservedWithdrawalAssets = toBigInt(reservedWithdrawalAssetsRaw);
|
|
31066
31278
|
const shares = toBigInt(sharesRaw);
|
|
31067
31279
|
const assetsDeposited = getAssetsDepositedFromDepositEpochState(depositEpochStateRaw);
|
|
31068
|
-
if (reservedWithdrawalAssets === null || shares === null || assetsDeposited === null) throw new Error(`Unexpected readContract output types for vault ${vault.id}`);
|
|
31280
|
+
if (reservedWithdrawalAssets === null || shares === null || assetsDeposited === null) throw new Error(`Unexpected readContract output types for vault ${vault$2.id}`);
|
|
31069
31281
|
let nav = null;
|
|
31070
31282
|
let navSource = "computeNAV";
|
|
31071
31283
|
const staleOracleStateOverride = getStaleOracleStateOverrideForAccountant(accountantAddress);
|
|
@@ -31074,7 +31286,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabe
|
|
|
31074
31286
|
abi: PanopticVaultAccountantAbi,
|
|
31075
31287
|
functionName: "computeNAV",
|
|
31076
31288
|
args: [
|
|
31077
|
-
vaultAddress,
|
|
31289
|
+
vaultAddress$1,
|
|
31078
31290
|
underlyingTokenAddress,
|
|
31079
31291
|
managerInput
|
|
31080
31292
|
],
|
|
@@ -31100,7 +31312,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault, chainId, windowLabe
|
|
|
31100
31312
|
nav = toBigInt(navRawWithOverride);
|
|
31101
31313
|
navSource = "computeNAVStateOverride";
|
|
31102
31314
|
}
|
|
31103
|
-
if (nav === null) throw new Error(`Unexpected computeNAV output type for vault ${vault.id}`);
|
|
31315
|
+
if (nav === null) throw new Error(`Unexpected computeNAV output type for vault ${vault$2.id}`);
|
|
31104
31316
|
const sharePrice = computeSharePriceFromNavSnapshot({
|
|
31105
31317
|
nav,
|
|
31106
31318
|
assetsDeposited,
|
|
@@ -31163,43 +31375,43 @@ function createVaultSharePriceProcessor({ chainId, client, candidateRefreshSecon
|
|
|
31163
31375
|
const candidateCache = new Map();
|
|
31164
31376
|
const lastTrustedBlockByVault = new Map();
|
|
31165
31377
|
const seededVaults = new Set();
|
|
31166
|
-
async function getCandidates({ strategy, vault, blockTimestamp }) {
|
|
31378
|
+
async function getCandidates({ strategy, vault: vault$2, blockTimestamp }) {
|
|
31167
31379
|
if (strategy.resolveCandidates === void 0) return void 0;
|
|
31168
|
-
const cached = candidateCache.get(vault.id);
|
|
31380
|
+
const cached = candidateCache.get(vault$2.id);
|
|
31169
31381
|
if (cached !== void 0 && blockTimestamp - cached.fetchedAtChainTime < candidateRefreshSeconds) return cached.candidates;
|
|
31170
31382
|
const candidates = await strategy.resolveCandidates({
|
|
31171
31383
|
chainId,
|
|
31172
|
-
vault,
|
|
31384
|
+
vault: vault$2,
|
|
31173
31385
|
client
|
|
31174
31386
|
});
|
|
31175
|
-
candidateCache.set(vault.id, {
|
|
31387
|
+
candidateCache.set(vault$2.id, {
|
|
31176
31388
|
candidates,
|
|
31177
31389
|
fetchedAtChainTime: blockTimestamp
|
|
31178
31390
|
});
|
|
31179
31391
|
return candidates;
|
|
31180
31392
|
}
|
|
31181
|
-
async function getRecoveryFromBlock({ vault, recoveryFallbackBlock, loadLastTrustedBlock }) {
|
|
31182
|
-
if (!seededVaults.has(vault.id)) {
|
|
31393
|
+
async function getRecoveryFromBlock({ vault: vault$2, recoveryFallbackBlock, loadLastTrustedBlock }) {
|
|
31394
|
+
if (!seededVaults.has(vault$2.id)) {
|
|
31183
31395
|
const persistedBlock = await loadLastTrustedBlock();
|
|
31184
|
-
if (persistedBlock !== void 0) lastTrustedBlockByVault.set(vault.id, persistedBlock);
|
|
31185
|
-
seededVaults.add(vault.id);
|
|
31396
|
+
if (persistedBlock !== void 0) lastTrustedBlockByVault.set(vault$2.id, persistedBlock);
|
|
31397
|
+
seededVaults.add(vault$2.id);
|
|
31186
31398
|
}
|
|
31187
|
-
return lastTrustedBlockByVault.get(vault.id) ?? recoveryFallbackBlock;
|
|
31399
|
+
return lastTrustedBlockByVault.get(vault$2.id) ?? recoveryFallbackBlock;
|
|
31188
31400
|
}
|
|
31189
|
-
return { async process({ vault, strategy, blockNumber, blockTimestamp, recoveryFallbackBlock, loadLastTrustedBlock, readContractFn, windowLabel = "series" }) {
|
|
31401
|
+
return { async process({ vault: vault$2, strategy, blockNumber, blockTimestamp, recoveryFallbackBlock, loadLastTrustedBlock, readContractFn, windowLabel = "series" }) {
|
|
31190
31402
|
const candidates = await getCandidates({
|
|
31191
31403
|
strategy,
|
|
31192
|
-
vault,
|
|
31404
|
+
vault: vault$2,
|
|
31193
31405
|
blockTimestamp
|
|
31194
31406
|
});
|
|
31195
31407
|
const recoveryFromBlock = await getRecoveryFromBlock({
|
|
31196
|
-
vault,
|
|
31408
|
+
vault: vault$2,
|
|
31197
31409
|
recoveryFallbackBlock,
|
|
31198
31410
|
loadLastTrustedBlock
|
|
31199
31411
|
});
|
|
31200
31412
|
const result = await fetchVaultSharePriceSnapshotWithCandidateRecovery({
|
|
31201
31413
|
client,
|
|
31202
|
-
vault,
|
|
31414
|
+
vault: vault$2,
|
|
31203
31415
|
chainId,
|
|
31204
31416
|
windowLabel,
|
|
31205
31417
|
blockNumber,
|
|
@@ -31207,12 +31419,12 @@ function createVaultSharePriceProcessor({ chainId, client, candidateRefreshSecon
|
|
|
31207
31419
|
candidates,
|
|
31208
31420
|
recoveryFromBlock
|
|
31209
31421
|
});
|
|
31210
|
-
if (result.candidates !== void 0 && result.candidates !== candidates) candidateCache.set(vault.id, {
|
|
31422
|
+
if (result.candidates !== void 0 && result.candidates !== candidates) candidateCache.set(vault$2.id, {
|
|
31211
31423
|
candidates: result.candidates,
|
|
31212
31424
|
fetchedAtChainTime: blockTimestamp
|
|
31213
31425
|
});
|
|
31214
31426
|
const status = statusForVaultSharePriceSnapshot(result.snapshot);
|
|
31215
|
-
if (isTrustedVaultSharePriceStatus(status)) lastTrustedBlockByVault.set(vault.id, blockNumber);
|
|
31427
|
+
if (isTrustedVaultSharePriceStatus(status)) lastTrustedBlockByVault.set(vault$2.id, blockNumber);
|
|
31216
31428
|
return {
|
|
31217
31429
|
snapshot: result.snapshot,
|
|
31218
31430
|
status
|
|
@@ -32029,5 +32241,5 @@ async function getIrmCurve(params) {
|
|
|
32029
32241
|
}
|
|
32030
32242
|
|
|
32031
32243
|
//#endregion
|
|
32032
|
-
export { BASE_CHAIN_ID, BASE_DEPLOYMENT, BASE_ETH_USDC_5BPS_MARKET, BASE_HYPOVAULT_ADDRESSES, BASE_HYPOVAULT_CORE_ADDRESSES, BASE_HYPOVAULT_MANAGER_ADDRESSES, BASE_HYPOVAULT_MANAGER_TURNKEY_SIGNERS, BASE_PANOPTIC_POOL_ADDRESSES, BASE_PANOPTIC_V2_ADDRESSES, BORROW_INDEX_BITS, BPS_SCALE, BaseUSDCPLPStrategistLeaves, BaseUSDCPLPVaultPoolInfos, BaseWETHPLPStrategistLeaves, BaseWETHPLPVaultPoolInfos, CHAIN_DEPLOYMENTS, CollateralTrackerAbi, CollateralTrackerV1_1Abi, Erc1155Abi, Erc20Abi, HypoVaultAbi, HypoVaultManagerConfigSchema, HypoVaultManagerWithMerkleVerificationAbi, MAINNET_CHAIN_ID, MAINNET_DEPLOYMENT, MAINNET_ETH_USDC_5BPS_V3_PANOPTIC_POOL_ADDRESSES, MAINNET_PANOPTIC_V2_ADDRESSES, MAINNET_RISK_ENGINES, MAINNET_USDC_PLP_COMPILED_POOL_POLICY, MAINNET_USDC_PLP_POOL_POLICY, MAINNET_V3_AUTHORIZATION_BLOCK, MAINNET_WETH_PLP_COMPILED_POOL_POLICY, MAINNET_WETH_PLP_POOL_POLICY, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, MAX_STALE_DELTA_HEDGE_PRIORITY_FEE_PER_GAS, MAX_VAULT_PRIORITY_FEE_PER_GAS, MAX_VAULT_TRANSACTION_GAS_COST, MIN_VAULT_PRIORITY_FEE_PER_GAS, MainnetLegacyUSDCPLPStrategistLeaves, MainnetLegacyWETHPLPStrategistLeaves, MainnetUSDCPLPLegacyVaultPoolInfos, MainnetUSDCPLPPreviousStrategistLeaves, MainnetUSDCPLPPreviousVaultPoolInfos, MainnetUSDCPLPStrategistLeaves, MainnetUSDCPLPV3AuthorizedStrategistLeaves, MainnetUSDCPLPV3AuthorizedVaultPoolInfos, MainnetUSDCPLPVaultPoolInfos, MainnetWETHPLPLegacyVaultPoolInfos, MainnetWETHPLPPreviousStrategistLeaves, MainnetWETHPLPPreviousVaultPoolInfos, MainnetWETHPLPStrategistLeaves, MainnetWETHPLPV3AuthorizedStrategistLeaves, MainnetWETHPLPV3AuthorizedVaultPoolInfos, MainnetWETHPLPVaultPoolInfos, Multicall3Abi, NonFungiblePositionManagerAbi, PanopticFactoryV3Abi, PanopticFactoryV4Abi, PanopticHelperAbi, PanopticPoolAbi, PanopticPoolV1_1Abi, PanopticQueryV1_1Abi, PanopticVaultAccountantAbi, PanopticVaultAccountantManagerInputAbi, PoolManagerAbi, RATE_AT_TARGET_BITS, ROBINHOOD_CHAIN_ID, ROBINHOOD_DEPLOYMENT, ROBINHOOD_HYPOVAULT_ADDRESSES, ROBINHOOD_HYPOVAULT_CORE_ADDRESSES, ROBINHOOD_HYPOVAULT_MANAGER_ADDRESSES, ROBINHOOD_HYPOVAULT_MANAGER_TURNKEY_SIGNERS, ROBINHOOD_PANOPTIC_POOL_ADDRESSES, ROBINHOOD_PANOPTIC_V2_ADDRESSES, ROBINHOOD_RISK_ENGINES, RescueDistributorAbi, SECONDS_PER_YEAR, SEPOLIA_CHAIN_ID, SEPOLIA_DEPLOYMENT, SEPOLIA_ETH_USDC_5BPS_MARKET, SEPOLIA_HYPOVAULT_ADDRESSES, SEPOLIA_HYPOVAULT_CORE_ADDRESSES, SEPOLIA_HYPOVAULT_MANAGER_ADDRESSES, SEPOLIA_HYPOVAULT_MANAGER_TURNKEY_SIGNERS, SEPOLIA_PANOPTIC_POOL_ADDRESSES, SEPOLIA_PANOPTIC_V2_ADDRESSES, SemiFungiblePositionManagerAbi, SemiFungiblePositionManagerV1_1Abi, SepoliaUSDCPLPStrategistLeaves, SepoliaUSDCPLPVaultPoolInfos, SepoliaWETHPLPStrategistLeaves, SepoliaWETHPLPVaultPoolInfos, Simple7702AccountAbi, StateViewAbi, TRUSTED_VAULT_SHARE_PRICE_STATUSES, UNREALIZED_INTEREST_BITS, UniswapHelperAbi, UniswapHelperV1_1Abi, UniswapMigratorAbi, UniswapV3FactoryAbi, UniswapV3PoolAbi, UsdcPlpVaultBaseProdConfig, UsdcPlpVaultMainnetLegacyConfig, UsdcPlpVaultMainnetProdConfig, UsdcPlpVaultSepoliaDevConfig, UsdcPlpVaultSepoliaProdConfig, VAULT_DISPLAY_NAMES_PER_CHAIN, VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN, VaultApyPreInceptionBlockError, VaultTransactionFeeEstimationError, VaultTransactionGasCostLimitError, VaultTransactionReplacementLimitError, WAD, WETHAbi, WethPlpVaultBaseProdConfig, WethPlpVaultMainnetLegacyConfig, WethPlpVaultMainnetProdConfig, WethPlpVaultSepoliaDevConfig, WethPlpVaultSepoliaProdConfig, adjustUnderlyingIdleBalance, annualizePerSecondRateWad, applyVaultTransactionGasCostLimit, bufferVaultTransactionGasEstimate, buildClaimVaultShareCalldatas, buildExecuteDepositCalldatas, buildExecuteWithdrawalCalldatas, buildManageArgs, buildManagerInput, buildManagerInputAtBlock, buildRequestWithdrawalCalldatas, buildVaultManagerInput, buildVaultManagerInputAtBlock, builderFactoryAbi, builderWalletAbi, calculateAnnualizedApyPct, calculateAssetsFromShares, calculateAvailableShares, calculateClaimableAssetsFromQueuedWithdrawals, calculateClaimableSharesFromQueuedDeposits, calculateSharesFromAssets, calculateVaultNetLendingApyPctFromTrackerInputs, calculateVaultNetLendingYieldUnderlyingFromTrackerInputs, cancelDeposit, chainToHypoVaultGraphQlAPI, clearVaultApyStrategyOverride, collateralTrackerV2Abi as collateralTrackerAbi, collateralTrackerV2Abi, computeSharePriceFromNavSnapshot, convertJsonTreeToArray, createVaultSharePriceProcessor, deriveSupplyRatePerSecWad, deriveVaultApyTimeseriesFromSharePrices, encodeApproveFunctionData, encodeCancelDepositFunctionData, encodeDepositFunctionData, encodeExecuteDepositFunctionData, encodeExecuteWithdrawalFunctionData, encodeExecuteWithdrawalMulticallFunctionData, encodeFulfillDepositsFunctionData, encodeFulfillWithdrawalsFunctionData, encodeRequestDepositFunctionData, encodeRequestWithdrawalFunctionData, encodeRequestWithdrawalMulticallFunctionData, encodeWithdrawFunctionData, executeWithdrawal, executeWithdrawalMulticall, fetchFirstDepositTimestampByVaultId, fetchVaultLendingAllocation, fetchVaultNetLendingApyPct, fetchVaultNetLendingYieldUnderlying, fetchVaultSharePriceSnapshot, fetchVaultSharePriceSnapshotWithCandidateRecovery, findLeaf, findLeafForTarget, findLeafForTargetAndSignature, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, generateProof, getAlchemyRpcUrl, getAlchemyWsRpcUrl, getCancelDepositContractConfig, getChainDeployment, getEthUsdcMarket, getExecuteWithdrawalContractConfig, getExecuteWithdrawalMulticallContractConfig, getHypoVaultConfigForVault, getHypoVaultGraphQLClient, getIrmCurrent, getIrmCurve, getLendingAllocationRows, getMainnetV3AuthorizationArtifactsAtBlock, getMainnetV3AuthorizationGenerations, getMainnetVaultManagerRootAtBlock, getMainnetVaultManagerRootHistory, getMainnetVaultPoolConfigurationAtBlock, getMainnetVaultPoolConfigurationHistory, getMinQueuedDepositEpoch, getProofsFromDigests, getProofsUsingTree, getRequestDepositContractConfig, getRequestWithdrawalContractConfig, getRequestWithdrawalMulticallContractConfig, getStaleOracleOverrideBytecodeForAccountant, getStaleOracleStateOverrideForAccountant, getVaultApyErrorMessage, getVaultApyStrategy, getVaultCandidatePoolInfos, getVaultDeltaHedgeHistoricalFeeQuote, getVaultDeltaHedgeInitialFeeQuote, getVaultPoolInfos, getVaultTransactionFeeQuote, getVaultTransactionReplacementFeeQuote, isExpectedHistoricalReadMiss, isIncorrectPositionListReadError, isStaleOraclePriceError, isStaleOraclePriceReadError, isSupportedChain, isTrustedVaultSharePriceStatus, packMarketState, panopticFactoryV4Abi as panopticFactoryAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticLiquidatorAbi, panopticPoolV2Abi as panopticPoolAbi, panopticPoolV2Abi, panopticQueryAbi, parseCustomError, ratePerSecWadToAprPct, recoverVaultCandidateTokenIdsByPool, requestDeposit, requestWithdrawal, requestWithdrawalMulticall, requireChainDeployment, resolveMainnetV3AuthorizationArtifacts, resolvePositionScanFromBlock, resolveVaultDisplayName, resolveVaultHistoricalCandidatesByPool, resolveVaultPoolInfosAtBlock, resolveVaultTokenIdsByPool, riskEngineAbi, semiFungiblePositionManagerV4Abi as semiFungiblePositionManagerAbi, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi, setVaultApyStrategyOverride, simulateCancelDeposit, simulateExecuteWithdrawal, simulateExecuteWithdrawalMulticall, simulateRequestDeposit, simulateRequestWithdrawal, simulateRequestWithdrawalMulticall, statusForVaultSharePriceSnapshot, useCancelDeposit, useClaimVaultShares, useExecuteWithdrawal, useRequestDeposit, useRequestWithdrawal, utilizationBpsToWad, utilizationPctToWad, validateVaultSignedTransactionFeeCaps, verifyVaultOpenTokenIdsAtBlock };
|
|
32244
|
+
export { BASE_CHAIN_ID, BASE_DEPLOYMENT, BASE_ETH_USDC_5BPS_MARKET, BASE_HYPOVAULT_ADDRESSES, BASE_HYPOVAULT_CORE_ADDRESSES, BASE_HYPOVAULT_MANAGER_ADDRESSES, BASE_HYPOVAULT_MANAGER_TURNKEY_SIGNERS, BASE_PANOPTIC_POOL_ADDRESSES, BASE_PANOPTIC_V2_ADDRESSES, BORROW_INDEX_BITS, BPS_SCALE, BaseUSDCPLPStrategistLeaves, BaseUSDCPLPVaultPoolInfos, BaseWETHPLPStrategistLeaves, BaseWETHPLPVaultPoolInfos, CHAIN_DEPLOYMENTS, CollateralTrackerAbi, CollateralTrackerV1_1Abi, Erc1155Abi, Erc20Abi, HypoVaultAbi, HypoVaultManagerConfigSchema, HypoVaultManagerWithMerkleVerificationAbi, MAINNET_CHAIN_ID, MAINNET_DEPLOYMENT, MAINNET_ETH_USDC_5BPS_V3_PANOPTIC_POOL_ADDRESSES, MAINNET_PANOPTIC_V2_ADDRESSES, MAINNET_RISK_ENGINES, MAINNET_USDC_PLP_COMPILED_POOL_POLICY, MAINNET_USDC_PLP_POOL_POLICY, MAINNET_V3_AUTHORIZATION_BLOCK, MAINNET_WETH_PLP_COMPILED_POOL_POLICY, MAINNET_WETH_PLP_POOL_POLICY, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, MAX_STALE_DELTA_HEDGE_PRIORITY_FEE_PER_GAS, MAX_VAULT_PRIORITY_FEE_PER_GAS, MAX_VAULT_TRANSACTION_GAS_COST, MIN_VAULT_PRIORITY_FEE_PER_GAS, MainnetLegacyUSDCPLPStrategistLeaves, MainnetLegacyWETHPLPStrategistLeaves, MainnetUSDCPLPLegacyVaultPoolInfos, MainnetUSDCPLPPreviousStrategistLeaves, MainnetUSDCPLPPreviousVaultPoolInfos, MainnetUSDCPLPStrategistLeaves, MainnetUSDCPLPV3AuthorizedStrategistLeaves, MainnetUSDCPLPV3AuthorizedVaultPoolInfos, MainnetUSDCPLPVaultPoolInfos, MainnetWETHPLPLegacyVaultPoolInfos, MainnetWETHPLPPreviousStrategistLeaves, MainnetWETHPLPPreviousVaultPoolInfos, MainnetWETHPLPStrategistLeaves, MainnetWETHPLPV3AuthorizedStrategistLeaves, MainnetWETHPLPV3AuthorizedVaultPoolInfos, MainnetWETHPLPVaultPoolInfos, Multicall3Abi, NonFungiblePositionManagerAbi, PanopticFactoryV3Abi, PanopticFactoryV4Abi, PanopticHelperAbi, PanopticPoolAbi, PanopticPoolV1_1Abi, PanopticQueryV1_1Abi, PanopticVaultAccountantAbi, PanopticVaultAccountantManagerInputAbi, PoolManagerAbi, RATE_AT_TARGET_BITS, ROBINHOOD_CHAIN_ID, ROBINHOOD_DEPLOYMENT, ROBINHOOD_HYPOVAULT_ADDRESSES, ROBINHOOD_HYPOVAULT_CORE_ADDRESSES, ROBINHOOD_HYPOVAULT_MANAGER_ADDRESSES, ROBINHOOD_HYPOVAULT_MANAGER_TURNKEY_SIGNERS, ROBINHOOD_PANOPTIC_POOL_ADDRESSES, ROBINHOOD_PANOPTIC_V2_ADDRESSES, ROBINHOOD_RISK_ENGINES, ROBINHOOD_SPY_USDG_MARKET, ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY, ROBINHOOD_USDG_PLP_POOL_POLICY, RescueDistributorAbi, RobinhoodUSDGPLPStrategistLeaves, RobinhoodUSDGPLPVaultPoolInfos, SECONDS_PER_YEAR, SEPOLIA_CHAIN_ID, SEPOLIA_DEPLOYMENT, SEPOLIA_ETH_USDC_5BPS_MARKET, SEPOLIA_HYPOVAULT_ADDRESSES, SEPOLIA_HYPOVAULT_CORE_ADDRESSES, SEPOLIA_HYPOVAULT_MANAGER_ADDRESSES, SEPOLIA_HYPOVAULT_MANAGER_TURNKEY_SIGNERS, SEPOLIA_PANOPTIC_POOL_ADDRESSES, SEPOLIA_PANOPTIC_V2_ADDRESSES, SemiFungiblePositionManagerAbi, SemiFungiblePositionManagerV1_1Abi, SepoliaUSDCPLPStrategistLeaves, SepoliaUSDCPLPVaultPoolInfos, SepoliaWETHPLPStrategistLeaves, SepoliaWETHPLPVaultPoolInfos, Simple7702AccountAbi, StateViewAbi, TRUSTED_VAULT_SHARE_PRICE_STATUSES, UNREALIZED_INTEREST_BITS, UniswapHelperAbi, UniswapHelperV1_1Abi, UniswapMigratorAbi, UniswapV3FactoryAbi, UniswapV3PoolAbi, UsdcPlpVaultBaseProdConfig, UsdcPlpVaultMainnetLegacyConfig, UsdcPlpVaultMainnetProdConfig, UsdcPlpVaultSepoliaDevConfig, UsdcPlpVaultSepoliaProdConfig, UsdgPlpVaultRobinhoodProdConfig, VAULT_DISPLAY_NAMES_PER_CHAIN, VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN, VaultApyPreInceptionBlockError, VaultTransactionFeeEstimationError, VaultTransactionGasCostLimitError, VaultTransactionReplacementLimitError, WAD, WETHAbi, WethPlpVaultBaseProdConfig, WethPlpVaultMainnetLegacyConfig, WethPlpVaultMainnetProdConfig, WethPlpVaultSepoliaDevConfig, WethPlpVaultSepoliaProdConfig, adjustUnderlyingIdleBalance, annualizePerSecondRateWad, applyVaultTransactionGasCostLimit, bufferVaultTransactionGasEstimate, buildClaimVaultShareCalldatas, buildExecuteDepositCalldatas, buildExecuteWithdrawalCalldatas, buildManageArgs, buildManagerInput, buildManagerInputAtBlock, buildRequestWithdrawalCalldatas, buildVaultManagerInput, buildVaultManagerInputAtBlock, builderFactoryAbi, builderWalletAbi, calculateAnnualizedApyPct, calculateAssetsFromShares, calculateAvailableShares, calculateClaimableAssetsFromQueuedWithdrawals, calculateClaimableSharesFromQueuedDeposits, calculateSharesFromAssets, calculateVaultNetLendingApyPctFromTrackerInputs, calculateVaultNetLendingYieldUnderlyingFromTrackerInputs, cancelDeposit, chainToHypoVaultGraphQlAPI, clearVaultApyStrategyOverride, collateralTrackerV2Abi as collateralTrackerAbi, collateralTrackerV2Abi, computeSharePriceFromNavSnapshot, convertJsonTreeToArray, createVaultSharePriceProcessor, deriveSupplyRatePerSecWad, deriveVaultApyTimeseriesFromSharePrices, encodeApproveFunctionData, encodeCancelDepositFunctionData, encodeDepositFunctionData, encodeExecuteDepositFunctionData, encodeExecuteWithdrawalFunctionData, encodeExecuteWithdrawalMulticallFunctionData, encodeFulfillDepositsFunctionData, encodeFulfillWithdrawalsFunctionData, encodeRequestDepositFunctionData, encodeRequestWithdrawalFunctionData, encodeRequestWithdrawalMulticallFunctionData, encodeWithdrawFunctionData, executeWithdrawal, executeWithdrawalMulticall, fetchFirstDepositTimestampByVaultId, fetchVaultLendingAllocation, fetchVaultNetLendingApyPct, fetchVaultNetLendingYieldUnderlying, fetchVaultSharePriceSnapshot, fetchVaultSharePriceSnapshotWithCandidateRecovery, findLeaf, findLeafForTarget, findLeafForTargetAndSignature, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, generateProof, getAlchemyRpcUrl, getAlchemyWsRpcUrl, getCancelDepositContractConfig, getChainDeployment, getEthUsdcMarket, getExecuteWithdrawalContractConfig, getExecuteWithdrawalMulticallContractConfig, getHypoVaultConfigForVault, getHypoVaultGraphQLClient, getIrmCurrent, getIrmCurve, getLendingAllocationRows, getMainnetV3AuthorizationArtifactsAtBlock, getMainnetV3AuthorizationGenerations, getMainnetVaultManagerRootAtBlock, getMainnetVaultManagerRootHistory, getMainnetVaultPoolConfigurationAtBlock, getMainnetVaultPoolConfigurationHistory, getMinQueuedDepositEpoch, getProofsFromDigests, getProofsUsingTree, getRequestDepositContractConfig, getRequestWithdrawalContractConfig, getRequestWithdrawalMulticallContractConfig, getSpyUsdgMarket, getStaleOracleOverrideBytecodeForAccountant, getStaleOracleStateOverrideForAccountant, getVaultApyErrorMessage, getVaultApyStrategy, getVaultCandidatePoolInfos, getVaultDeltaHedgeHistoricalFeeQuote, getVaultDeltaHedgeInitialFeeQuote, getVaultPoolInfos, getVaultTransactionFeeQuote, getVaultTransactionReplacementFeeQuote, isExpectedHistoricalReadMiss, isIncorrectPositionListReadError, isStaleOraclePriceError, isStaleOraclePriceReadError, isSupportedChain, isTrustedVaultSharePriceStatus, packMarketState, panopticFactoryV4Abi as panopticFactoryAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticLiquidatorAbi, panopticPoolV2Abi as panopticPoolAbi, panopticPoolV2Abi, panopticQueryAbi, parseCustomError, ratePerSecWadToAprPct, recoverVaultCandidateTokenIdsByPool, requestDeposit, requestWithdrawal, requestWithdrawalMulticall, requireChainDeployment, resolveMainnetV3AuthorizationArtifacts, resolvePositionScanFromBlock, resolveVaultDisplayName, resolveVaultHistoricalCandidatesByPool, resolveVaultPoolInfosAtBlock, resolveVaultTokenIdsByPool, riskEngineAbi, semiFungiblePositionManagerV4Abi as semiFungiblePositionManagerAbi, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi, setVaultApyStrategyOverride, simulateCancelDeposit, simulateExecuteWithdrawal, simulateExecuteWithdrawalMulticall, simulateRequestDeposit, simulateRequestWithdrawal, simulateRequestWithdrawalMulticall, statusForVaultSharePriceSnapshot, useCancelDeposit, useClaimVaultShares, useExecuteWithdrawal, useRequestDeposit, useRequestWithdrawal, utilizationBpsToWad, utilizationPctToWad, validateVaultSignedTransactionFeeCaps, verifyVaultOpenTokenIdsAtBlock };
|
|
32033
32245
|
//# sourceMappingURL=index.js.map
|