@panoptic-eng/sdk 1.0.61 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chainDeployments-CmDzAmZ3.js → chainDeployments-BhXMBZ4B.js} +50 -12
- package/dist/{cow-BItQK2Bi.js → cow-BsSaoahK.js} +1 -1
- package/dist/deployments.d.ts +9 -1
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +50 -12
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +541 -45
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +551 -353
- package/dist/index.js.map +1 -1
- package/dist/{irm-BEug2-TH.js → irm-BDlcUNgJ.js} +1 -1
- package/dist/panoptic/v2/index.d.ts +122 -1
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +406 -25
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.d.ts +122 -1
- package/dist/panoptic/v2/react-public.d.ts.map +1 -1
- package/dist/panoptic/v2/react-public.js +406 -25
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/providers-1WdiaRbY.js +54 -0
- package/dist/{rates-CPHxWqpT.js → rates-BwZnK0tG.js} +1 -1
- package/dist/{router-BZGHjEcU.js → router-Dejb6MWu.js} +137 -10
- package/dist/{router-kTiatP_R.js → router-pm9PDlyH.js} +2 -2
- package/dist/rpc/index.d.ts +112 -0
- package/dist/rpc/index.d.ts.map +1 -0
- package/dist/rpc/index.js +242 -0
- package/dist/rpc/index.js.map +1 -0
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +1 -14
- package/dist/test/index.js.map +1 -1
- package/dist/{transactionFees-MocbcAyR.js → transactionFees-aXQlx-lq.js} +1 -1
- package/dist/uniswap/index.d.ts +310 -215
- package/dist/uniswap/index.d.ts.map +1 -1
- package/dist/uniswap/index.js +253 -20
- package/dist/uniswap/index.js.map +1 -1
- package/dist/{v2-odOz_0wM.js → v2-ccGPXWvq.js} +226 -9
- package/dist/vault-transaction-fees.js +49 -11
- package/dist/vault-transaction-fees.js.map +1 -1
- package/dist/{writes-gs0k0uoN.js → writes--fM_8ggw.js} +2 -2
- package/dist/zodiac/index.d.ts.map +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -24608,15 +24608,29 @@ var _4663 = {
|
|
|
24608
24608
|
"panoptic": {
|
|
24609
24609
|
"pool": {
|
|
24610
24610
|
"version": "v4",
|
|
24611
|
-
"panopticPool": "
|
|
24612
|
-
"collateralTracker0": "
|
|
24613
|
-
"collateralTracker1": "
|
|
24611
|
+
"panopticPool": "0x000000000c21b38c54AcA7c7145Df01ff09d69Bb",
|
|
24612
|
+
"collateralTracker0": "0xDc508622CD7e3850c8240e88c10361Cf493465b6",
|
|
24613
|
+
"collateralTracker1": "0x9212d804953bAf89C24ceFa6545aA293bA08a876"
|
|
24614
|
+
},
|
|
24615
|
+
"additionalPools": {
|
|
24616
|
+
"spyUsdg30bpsV4": {
|
|
24617
|
+
"version": "v4",
|
|
24618
|
+
"panopticPool": "0x00000000989bcb6f24af4a1Ab2A6d6a31c98A58E",
|
|
24619
|
+
"collateralTracker0": "0x49eaAC32A7CD4B8fB2209a12859a95E0b20aB0e5",
|
|
24620
|
+
"collateralTracker1": "0x670C44a0FC35dbC410498e47A6290a1C3196d191"
|
|
24621
|
+
},
|
|
24622
|
+
"spyUsdg5bpsV4": {
|
|
24623
|
+
"version": "v4",
|
|
24624
|
+
"panopticPool": "0x000000000c21b38c54AcA7c7145Df01ff09d69Bb",
|
|
24625
|
+
"collateralTracker0": "0xDc508622CD7e3850c8240e88c10361Cf493465b6",
|
|
24626
|
+
"collateralTracker1": "0x9212d804953bAf89C24ceFa6545aA293bA08a876"
|
|
24627
|
+
}
|
|
24614
24628
|
},
|
|
24615
24629
|
"v2": {
|
|
24616
24630
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
24617
24631
|
"semiFungiblePositionManagerV3": "0x00000000000005E4693aDc8Ec0f12D686f728198",
|
|
24618
24632
|
"builderFactory": "0x0000000000000a3D22E158417AA639D7F71b0FF7",
|
|
24619
|
-
"riskEngine": "
|
|
24633
|
+
"riskEngine": "0x0000000000000fE1E261f66ce2F44def4F5Ae0CB",
|
|
24620
24634
|
"panopticPoolImplementation": "0x000000000000135429F0DaCaB61639Bf6a63EbbC",
|
|
24621
24635
|
"collateralTrackerImplementation": "0x0000000000001d9c38CA405A2e04420865A08A33",
|
|
24622
24636
|
"panopticFactoryV4": "0x0000000000000c51d0f8cf4bd9adE7191372a625",
|
|
@@ -24632,13 +24646,29 @@ var _4663 = {
|
|
|
24632
24646
|
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb",
|
|
24633
24647
|
"0x0000000000000f3fb82469581A74776178E76Ca4"
|
|
24634
24648
|
],
|
|
24635
|
-
"markets": {
|
|
24636
|
-
"
|
|
24637
|
-
|
|
24638
|
-
|
|
24639
|
-
|
|
24640
|
-
|
|
24641
|
-
|
|
24649
|
+
"markets": {
|
|
24650
|
+
"spyUsdg": {
|
|
24651
|
+
"currency0": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
24652
|
+
"currency1": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
|
|
24653
|
+
"fee": 500,
|
|
24654
|
+
"tickSpacing": 5,
|
|
24655
|
+
"poolId": "0xe5923c8a8be481ec89a2ca784a2bbfa4235de6d88f92260fd66b660c4babf907"
|
|
24656
|
+
},
|
|
24657
|
+
"spyUsdg30bps": {
|
|
24658
|
+
"currency0": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
24659
|
+
"currency1": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
|
|
24660
|
+
"fee": 3e3,
|
|
24661
|
+
"tickSpacing": 60,
|
|
24662
|
+
"poolId": "0xfe2a80bb5618fd14984b92ca6d45bf5ba67443ddb1435e28b2e48df2fc1526cd"
|
|
24663
|
+
},
|
|
24664
|
+
"spyUsdg5bps": {
|
|
24665
|
+
"currency0": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
24666
|
+
"currency1": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
|
|
24667
|
+
"fee": 500,
|
|
24668
|
+
"tickSpacing": 5,
|
|
24669
|
+
"poolId": "0xe5923c8a8be481ec89a2ca784a2bbfa4235de6d88f92260fd66b660c4babf907"
|
|
24670
|
+
}
|
|
24671
|
+
},
|
|
24642
24672
|
"subgraphs": {
|
|
24643
24673
|
"hypovault": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/hypovault-subgraph-robinhood/prod/gn",
|
|
24644
24674
|
"panoptic": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/panoptic-subgraph-robinhood/v2_prod/gn"
|
|
@@ -24789,23 +24819,27 @@ function getChainDeployment(chainId) {
|
|
|
24789
24819
|
return CHAIN_DEPLOYMENTS[chainId];
|
|
24790
24820
|
}
|
|
24791
24821
|
function requireChainDeployment(chainId) {
|
|
24792
|
-
const deployment$
|
|
24793
|
-
if (deployment$
|
|
24794
|
-
return deployment$
|
|
24822
|
+
const deployment$3 = getChainDeployment(chainId);
|
|
24823
|
+
if (deployment$3 === void 0) throw new Error(`Unsupported chain deployment for chainId ${chainId}`);
|
|
24824
|
+
return deployment$3;
|
|
24795
24825
|
}
|
|
24796
24826
|
function isSupportedChain(chainId) {
|
|
24797
24827
|
return getChainDeployment(chainId) !== void 0;
|
|
24798
24828
|
}
|
|
24799
|
-
function getEthUsdcMarket(deployment$
|
|
24800
|
-
const market = deployment$
|
|
24801
|
-
if (market === void 0) throw new Error(`Missing ETH/USDC market for chainId ${deployment$
|
|
24829
|
+
function getEthUsdcMarket(deployment$3) {
|
|
24830
|
+
const market = deployment$3.markets.ethUsdc5bps ?? deployment$3.markets.ethUsdc30bps;
|
|
24831
|
+
if (market === void 0) throw new Error(`Missing ETH/USDC market for chainId ${deployment$3.chainId}`);
|
|
24802
24832
|
return market;
|
|
24803
24833
|
}
|
|
24804
|
-
function getSpyUsdgMarket(deployment$
|
|
24805
|
-
const market = deployment$
|
|
24806
|
-
if (market === void 0) throw new Error(`Missing SPY/USDG market for chainId ${deployment$
|
|
24834
|
+
function getSpyUsdgMarket(deployment$3) {
|
|
24835
|
+
const market = deployment$3.markets.spyUsdg;
|
|
24836
|
+
if (market === void 0) throw new Error(`Missing SPY/USDG market for chainId ${deployment$3.chainId}`);
|
|
24807
24837
|
return market;
|
|
24808
24838
|
}
|
|
24839
|
+
function requireDeploymentValue(value, label) {
|
|
24840
|
+
if (value === void 0) throw new Error(`Missing deployment value: ${label}`);
|
|
24841
|
+
return value;
|
|
24842
|
+
}
|
|
24809
24843
|
const MAINNET_DEPLOYMENT = CHAIN_DEPLOYMENTS[MAINNET_CHAIN_ID];
|
|
24810
24844
|
const MAINNET_ETH_USDC_5BPS_V3_PANOPTIC_POOL_ADDRESSES = MAINNET_DEPLOYMENT.panoptic.additionalPools?.ethUsdc5bpsV3;
|
|
24811
24845
|
const MAINNET_PANOPTIC_V2_ADDRESSES = MAINNET_DEPLOYMENT.panoptic.v2;
|
|
@@ -24834,9 +24868,13 @@ const ROBINHOOD_HYPOVAULT_ADDRESSES = ROBINHOOD_DEPLOYMENT.hypovault.vaults;
|
|
|
24834
24868
|
const ROBINHOOD_HYPOVAULT_MANAGER_ADDRESSES = ROBINHOOD_DEPLOYMENT.hypovault.managers;
|
|
24835
24869
|
const ROBINHOOD_HYPOVAULT_MANAGER_TURNKEY_SIGNERS = ROBINHOOD_DEPLOYMENT.hypovault.turnkeySigners;
|
|
24836
24870
|
const ROBINHOOD_PANOPTIC_POOL_ADDRESSES = ROBINHOOD_DEPLOYMENT.panoptic.pool;
|
|
24871
|
+
const ROBINHOOD_SPY_USDG_30BPS_PANOPTIC_POOL_ADDRESSES = requireDeploymentValue(ROBINHOOD_DEPLOYMENT.panoptic.additionalPools?.spyUsdg30bpsV4, "Robinhood SPY/USDG 30bps Panoptic pool");
|
|
24872
|
+
const ROBINHOOD_SPY_USDG_5BPS_PANOPTIC_POOL_ADDRESSES = requireDeploymentValue(ROBINHOOD_DEPLOYMENT.panoptic.additionalPools?.spyUsdg5bpsV4, "Robinhood SPY/USDG 5bps Panoptic pool");
|
|
24837
24873
|
const ROBINHOOD_PANOPTIC_V2_ADDRESSES = ROBINHOOD_DEPLOYMENT.panoptic.v2;
|
|
24838
24874
|
const ROBINHOOD_RISK_ENGINES = ROBINHOOD_DEPLOYMENT.riskEngines;
|
|
24839
24875
|
const ROBINHOOD_SPY_USDG_MARKET = getSpyUsdgMarket(ROBINHOOD_DEPLOYMENT);
|
|
24876
|
+
const ROBINHOOD_SPY_USDG_30BPS_MARKET = requireDeploymentValue(ROBINHOOD_DEPLOYMENT.markets.spyUsdg30bps, "Robinhood SPY/USDG 30bps market");
|
|
24877
|
+
const ROBINHOOD_SPY_USDG_5BPS_MARKET = requireDeploymentValue(ROBINHOOD_DEPLOYMENT.markets.spyUsdg5bps, "Robinhood SPY/USDG 5bps market");
|
|
24840
24878
|
|
|
24841
24879
|
//#endregion
|
|
24842
24880
|
//#region ../deployments/src/vaultDisplayNames.js
|
|
@@ -24887,8 +24925,8 @@ const VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN = {
|
|
|
24887
24925
|
},
|
|
24888
24926
|
[ROBINHOOD_CHAIN_ID]: { [robinhoodUsdgVault.toLowerCase()]: () => "0DTE +67∆ Vault" }
|
|
24889
24927
|
};
|
|
24890
|
-
function resolveVaultDisplayName({ chainId, vaultAddress: vaultAddress$
|
|
24891
|
-
const vaultAddressLower = vaultAddress$
|
|
24928
|
+
function resolveVaultDisplayName({ chainId, vaultAddress: vaultAddress$3, underlyingSymbol, fallbackName }) {
|
|
24929
|
+
const vaultAddressLower = vaultAddress$3.toLowerCase();
|
|
24892
24930
|
const resolver = VAULT_DISPLAY_NAME_RESOLVERS_PER_CHAIN[chainId]?.[vaultAddressLower];
|
|
24893
24931
|
if (resolver !== void 0) return resolver({
|
|
24894
24932
|
chainId,
|
|
@@ -25078,7 +25116,6 @@ function createStrategistLeavesArtifact(metadata, definitions) {
|
|
|
25078
25116
|
const SEPOLIA_DEPLOYMENT$5 = requireChainDeployment(SEPOLIA_CHAIN_ID);
|
|
25079
25117
|
const BASE_DEPLOYMENT$2 = requireChainDeployment(BASE_CHAIN_ID);
|
|
25080
25118
|
const MAINNET_DEPLOYMENT$6 = requireChainDeployment(MAINNET_CHAIN_ID);
|
|
25081
|
-
const ROBINHOOD_DEPLOYMENT$1 = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
25082
25119
|
const MAX_PRICE_DEVIATION = 100;
|
|
25083
25120
|
const WSPCXX_USDC_MAX_PRICE_DEVIATION = 1e4;
|
|
25084
25121
|
const DEFAULT_TRIGGER_TICK = 150;
|
|
@@ -25121,14 +25158,24 @@ const MAINNET_WSPCXX_USDC_POOL_INFO = {
|
|
|
25121
25158
|
token1: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
25122
25159
|
positionScanFromBlock: 25302077n
|
|
25123
25160
|
};
|
|
25124
|
-
const
|
|
25125
|
-
const
|
|
25161
|
+
const ROBINHOOD_SPY_USDG_30BPS_POOL_DEPLOYMENT_BLOCK = 62901925n;
|
|
25162
|
+
const ROBINHOOD_SPY_USDG_30BPS_POOL_INFO = {
|
|
25163
|
+
maxPriceDeviation: MAX_PRICE_DEVIATION,
|
|
25164
|
+
pool: "0x00000000989bcb6f24af4a1Ab2A6d6a31c98A58E",
|
|
25165
|
+
token0: "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
25166
|
+
token1: "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
|
|
25167
|
+
positionScanFromBlock: ROBINHOOD_SPY_USDG_30BPS_POOL_DEPLOYMENT_BLOCK
|
|
25168
|
+
};
|
|
25169
|
+
const ROBINHOOD_SPY_USDG_5BPS_POOL_DEPLOYMENT_BLOCK = 72457529n;
|
|
25170
|
+
const ROBINHOOD_SPY_USDG_5BPS_POOL_INFO = {
|
|
25126
25171
|
maxPriceDeviation: MAX_PRICE_DEVIATION,
|
|
25127
|
-
pool:
|
|
25128
|
-
token0:
|
|
25129
|
-
token1:
|
|
25130
|
-
positionScanFromBlock:
|
|
25172
|
+
pool: "0x000000000c21b38c54AcA7c7145Df01ff09d69Bb",
|
|
25173
|
+
token0: ROBINHOOD_SPY_USDG_30BPS_POOL_INFO.token0,
|
|
25174
|
+
token1: ROBINHOOD_SPY_USDG_30BPS_POOL_INFO.token1,
|
|
25175
|
+
positionScanFromBlock: ROBINHOOD_SPY_USDG_5BPS_POOL_DEPLOYMENT_BLOCK
|
|
25131
25176
|
};
|
|
25177
|
+
const ROBINHOOD_SPY_USDG_POOL_DEPLOYMENT_BLOCK = ROBINHOOD_SPY_USDG_5BPS_POOL_DEPLOYMENT_BLOCK;
|
|
25178
|
+
const ROBINHOOD_SPY_USDG_POOL_INFO = ROBINHOOD_SPY_USDG_5BPS_POOL_INFO;
|
|
25132
25179
|
/** Accountant order used by the v3-authorization release. */
|
|
25133
25180
|
const MAINNET_DEFAULT_POOL_INFOS = [MAINNET_ETH_USDC_V4_POOL_INFO, MAINNET_USDC_WETH_5BPS_V3_POOL_INFO];
|
|
25134
25181
|
const MAINNET_USDC_PLP_POOL_INFOS = [
|
|
@@ -25565,130 +25612,159 @@ const UsdcPlpVaultSepoliaProdConfig = {
|
|
|
25565
25612
|
|
|
25566
25613
|
//#endregion
|
|
25567
25614
|
//#region src/hypoVault/hypoVaultManagerArtifacts/RobinhoodUSDGPLPStrategistLeaves.ts
|
|
25568
|
-
const deployment$
|
|
25569
|
-
const vault$1 = deployment$
|
|
25570
|
-
const manager$1 = deployment$
|
|
25571
|
-
|
|
25572
|
-
const
|
|
25573
|
-
|
|
25574
|
-
const
|
|
25575
|
-
const
|
|
25576
|
-
const
|
|
25615
|
+
const deployment$2 = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
25616
|
+
const vault$1 = deployment$2.hypovault.vaults.usdgPlpVault;
|
|
25617
|
+
const manager$1 = deployment$2.hypovault.managers.usdgPlpVaultManager;
|
|
25618
|
+
const oldPool = deployment$2.panoptic.additionalPools?.spyUsdg30bpsV4;
|
|
25619
|
+
const newPool = deployment$2.panoptic.additionalPools?.spyUsdg5bpsV4;
|
|
25620
|
+
if (vault$1 === void 0 || manager$1 === void 0 || oldPool === void 0 || newPool === void 0) throw new Error("Missing Robinhood USDG PLP dual-generation deployment addresses");
|
|
25621
|
+
const vaultAddress$2 = vault$1;
|
|
25622
|
+
const managerAddress$1 = manager$1;
|
|
25623
|
+
const oldPoolAddresses = oldPool;
|
|
25624
|
+
const newPoolAddresses = newPool;
|
|
25577
25625
|
const dispatchSignature = "dispatch(uint256[],uint256[],uint128[],int24[3][],bool,uint256)";
|
|
25578
|
-
|
|
25579
|
-
|
|
25580
|
-
|
|
25581
|
-
|
|
25582
|
-
|
|
25583
|
-
|
|
25584
|
-
|
|
25585
|
-
|
|
25586
|
-
|
|
25587
|
-
|
|
25588
|
-
|
|
25589
|
-
|
|
25590
|
-
|
|
25591
|
-
|
|
25592
|
-
|
|
25593
|
-
|
|
25594
|
-
|
|
25595
|
-
|
|
25596
|
-
|
|
25597
|
-
|
|
25598
|
-
|
|
25599
|
-
|
|
25600
|
-
|
|
25601
|
-
|
|
25602
|
-
|
|
25603
|
-
|
|
25604
|
-
|
|
25605
|
-
|
|
25606
|
-
|
|
25607
|
-
|
|
25608
|
-
|
|
25609
|
-
|
|
25610
|
-
|
|
25611
|
-
|
|
25612
|
-
|
|
25613
|
-
|
|
25614
|
-
|
|
25615
|
-
|
|
25616
|
-
|
|
25617
|
-
|
|
25618
|
-
|
|
25619
|
-
|
|
25620
|
-
|
|
25621
|
-
|
|
25622
|
-
|
|
25623
|
-
|
|
25624
|
-
|
|
25625
|
-
|
|
25626
|
-
|
|
25627
|
-
|
|
25628
|
-
|
|
25629
|
-
|
|
25630
|
-
|
|
25631
|
-
|
|
25632
|
-
|
|
25633
|
-
|
|
25634
|
-
|
|
25635
|
-
|
|
25636
|
-
|
|
25637
|
-
|
|
25638
|
-
|
|
25639
|
-
|
|
25640
|
-
|
|
25641
|
-
|
|
25642
|
-
|
|
25643
|
-
|
|
25644
|
-
|
|
25645
|
-
|
|
25646
|
-
|
|
25647
|
-
|
|
25648
|
-
|
|
25649
|
-
|
|
25650
|
-
|
|
25651
|
-
|
|
25652
|
-
|
|
25653
|
-
|
|
25654
|
-
|
|
25655
|
-
|
|
25656
|
-
|
|
25657
|
-
|
|
25658
|
-
|
|
25659
|
-
|
|
25660
|
-
|
|
25626
|
+
function createPolicy({ id, poolInfo, collateralTracker0, collateralTracker1 }) {
|
|
25627
|
+
const trackerLeaves = [
|
|
25628
|
+
{
|
|
25629
|
+
description: "Approve poSPY to spend SPY",
|
|
25630
|
+
target: poolInfo.token0,
|
|
25631
|
+
functionSignature: "approve(address,uint256)",
|
|
25632
|
+
addressArguments: [collateralTracker0],
|
|
25633
|
+
canSendValue: false
|
|
25634
|
+
},
|
|
25635
|
+
{
|
|
25636
|
+
description: "Deposit SPY for poSPY",
|
|
25637
|
+
target: collateralTracker0,
|
|
25638
|
+
functionSignature: "deposit(uint256,address)",
|
|
25639
|
+
addressArguments: [vaultAddress$2],
|
|
25640
|
+
canSendValue: false
|
|
25641
|
+
},
|
|
25642
|
+
{
|
|
25643
|
+
description: "Withdraw SPY from poSPY",
|
|
25644
|
+
target: collateralTracker0,
|
|
25645
|
+
functionSignature: "withdraw(uint256,address,address)",
|
|
25646
|
+
addressArguments: [vaultAddress$2, vaultAddress$2],
|
|
25647
|
+
canSendValue: false
|
|
25648
|
+
},
|
|
25649
|
+
{
|
|
25650
|
+
description: "Withdraw SPY from poSPY (with open positions)",
|
|
25651
|
+
target: collateralTracker0,
|
|
25652
|
+
functionSignature: "withdraw(uint256,address,address,uint256[],bool)",
|
|
25653
|
+
addressArguments: [vaultAddress$2, vaultAddress$2],
|
|
25654
|
+
canSendValue: false
|
|
25655
|
+
},
|
|
25656
|
+
{
|
|
25657
|
+
description: "Mint poSPY using SPY",
|
|
25658
|
+
target: collateralTracker0,
|
|
25659
|
+
functionSignature: "mint(uint256,address)",
|
|
25660
|
+
addressArguments: [vaultAddress$2],
|
|
25661
|
+
canSendValue: false
|
|
25662
|
+
},
|
|
25663
|
+
{
|
|
25664
|
+
description: "Redeem poSPY for SPY",
|
|
25665
|
+
target: collateralTracker0,
|
|
25666
|
+
functionSignature: "redeem(uint256,address,address)",
|
|
25667
|
+
addressArguments: [vaultAddress$2, vaultAddress$2],
|
|
25668
|
+
canSendValue: false
|
|
25669
|
+
},
|
|
25670
|
+
{
|
|
25671
|
+
description: "Approve poUSDG to spend USDG",
|
|
25672
|
+
target: poolInfo.token1,
|
|
25673
|
+
functionSignature: "approve(address,uint256)",
|
|
25674
|
+
addressArguments: [collateralTracker1],
|
|
25675
|
+
canSendValue: false
|
|
25676
|
+
},
|
|
25677
|
+
{
|
|
25678
|
+
description: "Deposit USDG for poUSDG",
|
|
25679
|
+
target: collateralTracker1,
|
|
25680
|
+
functionSignature: "deposit(uint256,address)",
|
|
25681
|
+
addressArguments: [vaultAddress$2],
|
|
25682
|
+
canSendValue: false
|
|
25683
|
+
},
|
|
25684
|
+
{
|
|
25685
|
+
description: "Withdraw USDG from poUSDG",
|
|
25686
|
+
target: collateralTracker1,
|
|
25687
|
+
functionSignature: "withdraw(uint256,address,address)",
|
|
25688
|
+
addressArguments: [vaultAddress$2, vaultAddress$2],
|
|
25689
|
+
canSendValue: false
|
|
25690
|
+
},
|
|
25691
|
+
{
|
|
25692
|
+
description: "Withdraw USDG from poUSDG (with open positions)",
|
|
25693
|
+
target: collateralTracker1,
|
|
25694
|
+
functionSignature: "withdraw(uint256,address,address,uint256[],bool)",
|
|
25695
|
+
addressArguments: [vaultAddress$2, vaultAddress$2],
|
|
25696
|
+
canSendValue: false
|
|
25697
|
+
},
|
|
25698
|
+
{
|
|
25699
|
+
description: "Mint poUSDG using USDG",
|
|
25700
|
+
target: collateralTracker1,
|
|
25701
|
+
functionSignature: "mint(uint256,address)",
|
|
25702
|
+
addressArguments: [vaultAddress$2],
|
|
25703
|
+
canSendValue: false
|
|
25704
|
+
},
|
|
25705
|
+
{
|
|
25706
|
+
description: "Redeem poUSDG for USDG",
|
|
25707
|
+
target: collateralTracker1,
|
|
25708
|
+
functionSignature: "redeem(uint256,address,address)",
|
|
25709
|
+
addressArguments: [vaultAddress$2, vaultAddress$2],
|
|
25710
|
+
canSendValue: false
|
|
25711
|
+
}
|
|
25712
|
+
];
|
|
25713
|
+
const dispatchLeaf = {
|
|
25714
|
+
description: "Dispatch mint/burn options on PanopticPool",
|
|
25715
|
+
target: poolInfo.pool,
|
|
25716
|
+
functionSignature: dispatchSignature,
|
|
25717
|
+
addressArguments: [],
|
|
25661
25718
|
canSendValue: false
|
|
25662
|
-
}
|
|
25663
|
-
|
|
25664
|
-
|
|
25665
|
-
|
|
25666
|
-
|
|
25667
|
-
|
|
25668
|
-
|
|
25669
|
-
|
|
25670
|
-
};
|
|
25671
|
-
|
|
25672
|
-
|
|
25673
|
-
|
|
25674
|
-
|
|
25675
|
-
|
|
25676
|
-
|
|
25677
|
-
|
|
25678
|
-
|
|
25679
|
-
|
|
25680
|
-
|
|
25681
|
-
|
|
25682
|
-
|
|
25683
|
-
|
|
25684
|
-
|
|
25685
|
-
|
|
25719
|
+
};
|
|
25720
|
+
const windDownLeaves = trackerLeaves.filter(({ functionSignature }) => functionSignature.startsWith("withdraw(") || functionSignature.startsWith("redeem("));
|
|
25721
|
+
return [{
|
|
25722
|
+
id,
|
|
25723
|
+
mode: "primary",
|
|
25724
|
+
poolInfo,
|
|
25725
|
+
fullLeafDefinitions: [...trackerLeaves, dispatchLeaf],
|
|
25726
|
+
windDownLeafDefinitions: [...windDownLeaves, dispatchLeaf]
|
|
25727
|
+
}];
|
|
25728
|
+
}
|
|
25729
|
+
function createArtifact(policy) {
|
|
25730
|
+
const compiled = compileVaultPoolPolicy({ pools: policy });
|
|
25731
|
+
return {
|
|
25732
|
+
compiled,
|
|
25733
|
+
artifact: createStrategistLeavesArtifact({
|
|
25734
|
+
accountantAddress: deployment$2.hypovault.core.accountant,
|
|
25735
|
+
boringVaultAddress: vaultAddress$2,
|
|
25736
|
+
decoderAndSanitizerAddress: deployment$2.hypovault.core.collateralTrackerDecoderAndSanitizer,
|
|
25737
|
+
managerAddress: managerAddress$1
|
|
25738
|
+
}, compiled.strategistLeafDefinitions)
|
|
25739
|
+
};
|
|
25740
|
+
}
|
|
25741
|
+
const ROBINHOOD_USDG_PLP_30BPS_POOL_POLICY = createPolicy({
|
|
25742
|
+
id: "spy-usdg-30bps-v4",
|
|
25743
|
+
poolInfo: ROBINHOOD_SPY_USDG_30BPS_POOL_INFO,
|
|
25744
|
+
collateralTracker0: oldPoolAddresses.collateralTracker0,
|
|
25745
|
+
collateralTracker1: oldPoolAddresses.collateralTracker1
|
|
25746
|
+
});
|
|
25747
|
+
const ROBINHOOD_USDG_PLP_5BPS_POOL_POLICY = createPolicy({
|
|
25748
|
+
id: "spy-usdg-5bps-v4",
|
|
25749
|
+
poolInfo: ROBINHOOD_SPY_USDG_5BPS_POOL_INFO,
|
|
25750
|
+
collateralTracker0: newPoolAddresses.collateralTracker0,
|
|
25751
|
+
collateralTracker1: newPoolAddresses.collateralTracker1
|
|
25752
|
+
});
|
|
25753
|
+
const previous = createArtifact(ROBINHOOD_USDG_PLP_30BPS_POOL_POLICY);
|
|
25754
|
+
const next = createArtifact(ROBINHOOD_USDG_PLP_5BPS_POOL_POLICY);
|
|
25755
|
+
const ROBINHOOD_USDG_PLP_30BPS_COMPILED_POOL_POLICY = previous.compiled;
|
|
25756
|
+
const ROBINHOOD_USDG_PLP_5BPS_COMPILED_POOL_POLICY = next.compiled;
|
|
25757
|
+
const RobinhoodUSDGPLP30bpsStrategistLeaves = previous.artifact;
|
|
25758
|
+
const RobinhoodUSDGPLP5bpsStrategistLeaves = next.artifact;
|
|
25759
|
+
const ROBINHOOD_USDG_PLP_POOL_POLICY = ROBINHOOD_USDG_PLP_5BPS_POOL_POLICY;
|
|
25760
|
+
const ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY = ROBINHOOD_USDG_PLP_5BPS_COMPILED_POOL_POLICY;
|
|
25761
|
+
const RobinhoodUSDGPLPStrategistLeaves = RobinhoodUSDGPLP5bpsStrategistLeaves;
|
|
25686
25762
|
|
|
25687
25763
|
//#endregion
|
|
25688
25764
|
//#region src/hypoVault/hypoVaultManagerConfigs/usdgPlpVaultRobinhoodProdConfig.ts
|
|
25689
|
-
const deployment = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
25690
|
-
const vault = deployment.hypovault.vaults.usdgPlpVault;
|
|
25691
|
-
const manager = deployment.hypovault.managers.usdgPlpVaultManager;
|
|
25765
|
+
const deployment$1 = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
25766
|
+
const vault = deployment$1.hypovault.vaults.usdgPlpVault;
|
|
25767
|
+
const manager = deployment$1.hypovault.managers.usdgPlpVaultManager;
|
|
25692
25768
|
if (vault === void 0 || manager === void 0) throw new Error("Missing Robinhood USDG PLP vault deployment addresses");
|
|
25693
25769
|
const UsdgPlpVaultRobinhoodProdConfig = {
|
|
25694
25770
|
deployment: "prod",
|
|
@@ -25703,19 +25779,19 @@ const UsdgPlpVaultRobinhoodProdConfig = {
|
|
|
25703
25779
|
chainId: ROBINHOOD_CHAIN_ID,
|
|
25704
25780
|
hypoVaultAddress: vault,
|
|
25705
25781
|
addresses: {
|
|
25706
|
-
ethUsdc500bpsV4Collateral0: deployment.panoptic.pool.collateralTracker0,
|
|
25707
|
-
ethUsdc500bpsV4Collateral1: deployment.panoptic.pool.collateralTracker1,
|
|
25708
|
-
ethUsdc500bpsV4PanopticPool: deployment.panoptic.pool.panopticPool,
|
|
25782
|
+
ethUsdc500bpsV4Collateral0: deployment$1.panoptic.pool.collateralTracker0,
|
|
25783
|
+
ethUsdc500bpsV4Collateral1: deployment$1.panoptic.pool.collateralTracker1,
|
|
25784
|
+
ethUsdc500bpsV4PanopticPool: deployment$1.panoptic.pool.panopticPool,
|
|
25709
25785
|
hypoVaultManagerWithMerkleVerification: manager,
|
|
25710
25786
|
hypoVault: vault,
|
|
25711
|
-
underlyingToken: getSpyUsdgMarket(deployment).currency1
|
|
25787
|
+
underlyingToken: getSpyUsdgMarket(deployment$1).currency1
|
|
25712
25788
|
},
|
|
25713
25789
|
automation: {
|
|
25714
25790
|
primaryPool: ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY.automation.primaryPool,
|
|
25715
25791
|
windDownPools: [...ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY.automation.windDownPools]
|
|
25716
25792
|
},
|
|
25717
25793
|
manualTxDefaults: { collateralAllocations: [{
|
|
25718
|
-
trackerAddress: deployment.panoptic.pool.collateralTracker1,
|
|
25794
|
+
trackerAddress: deployment$1.panoptic.pool.collateralTracker1,
|
|
25719
25795
|
allocationBps: 1e4
|
|
25720
25796
|
}] },
|
|
25721
25797
|
deltaHedge: {
|
|
@@ -26170,8 +26246,8 @@ const ALL_HYPO_VAULT_CONFIGS = [
|
|
|
26170
26246
|
UsdcPlpVaultMainnetLegacyConfig,
|
|
26171
26247
|
UsdgPlpVaultRobinhoodProdConfig
|
|
26172
26248
|
];
|
|
26173
|
-
function getHypoVaultConfigForVault(vaultAddress$
|
|
26174
|
-
const vaultLower = vaultAddress$
|
|
26249
|
+
function getHypoVaultConfigForVault(vaultAddress$3, chainId, options) {
|
|
26250
|
+
const vaultLower = vaultAddress$3.toLowerCase();
|
|
26175
26251
|
const matchingConfigs = ALL_HYPO_VAULT_CONFIGS.filter((c) => c.hypoVaultAddress?.toLowerCase() === vaultLower && c.chainId === chainId);
|
|
26176
26252
|
if (matchingConfigs.length === 0) return void 0;
|
|
26177
26253
|
const preferredDeployment = options?.preferredDeployment;
|
|
@@ -26493,7 +26569,7 @@ function isSnapshotCandidateEvent(event) {
|
|
|
26493
26569
|
return event.transactionHash !== null && event.blockNumber !== null && event.logIndex !== null;
|
|
26494
26570
|
}
|
|
26495
26571
|
function decodeSnapshotTransaction(params) {
|
|
26496
|
-
const { account, pool
|
|
26572
|
+
const { account, pool, rolesContext } = params;
|
|
26497
26573
|
let dispatchInput = params.input;
|
|
26498
26574
|
let dispatchSender = params.from;
|
|
26499
26575
|
if (rolesContext) {
|
|
@@ -26504,14 +26580,14 @@ function decodeSnapshotTransaction(params) {
|
|
|
26504
26580
|
data: params.input
|
|
26505
26581
|
});
|
|
26506
26582
|
const [target, value, data, operation, roleKey, shouldRevert] = decodedRoleCall.args;
|
|
26507
|
-
if (!pool
|
|
26583
|
+
if (!pool || getAddress(target) !== getAddress(pool) || value !== 0n || operation !== 0 || roleKey.toLowerCase() !== rolesContext.roleKey.toLowerCase() || !shouldRevert) return null;
|
|
26508
26584
|
dispatchInput = data;
|
|
26509
26585
|
if (!account) return null;
|
|
26510
26586
|
dispatchSender = account;
|
|
26511
26587
|
} catch {
|
|
26512
26588
|
return null;
|
|
26513
26589
|
}
|
|
26514
|
-
} else if (pool
|
|
26590
|
+
} else if (pool && (params.to === null || getAddress(params.to) !== getAddress(pool))) return null;
|
|
26515
26591
|
const candidates = decodeAllDispatchCalldata(dispatchInput);
|
|
26516
26592
|
if (candidates.length === 0) return null;
|
|
26517
26593
|
return account ? selectDispatchForAccount(candidates, account, dispatchSender) : candidates[candidates.length - 1];
|
|
@@ -26539,7 +26615,7 @@ function decodeSnapshotTransaction(params) {
|
|
|
26539
26615
|
* ```
|
|
26540
26616
|
*/
|
|
26541
26617
|
async function recoverSnapshotFromTx(params) {
|
|
26542
|
-
const { client, transactionHash, account, pool
|
|
26618
|
+
const { client, transactionHash, account, pool, rolesContext } = params;
|
|
26543
26619
|
const tx = await client.getTransaction({ hash: transactionHash });
|
|
26544
26620
|
if (tx.blockNumber == null) return null;
|
|
26545
26621
|
const decoded = decodeSnapshotTransaction({
|
|
@@ -26547,7 +26623,7 @@ async function recoverSnapshotFromTx(params) {
|
|
|
26547
26623
|
from: tx.from,
|
|
26548
26624
|
to: tx.to,
|
|
26549
26625
|
account,
|
|
26550
|
-
pool
|
|
26626
|
+
pool,
|
|
26551
26627
|
rolesContext
|
|
26552
26628
|
});
|
|
26553
26629
|
if (!decoded) return null;
|
|
@@ -26837,12 +26913,18 @@ const MainnetWETHPLPLegacyVaultPoolInfos = {
|
|
|
26837
26913
|
|
|
26838
26914
|
//#endregion
|
|
26839
26915
|
//#region src/hypoVault/hypoVaultManagerArtifacts/RobinhoodUSDGPLPVaultPoolInfos.ts
|
|
26840
|
-
const vaultAddress = requireChainDeployment(ROBINHOOD_CHAIN_ID).hypovault.vaults.usdgPlpVault;
|
|
26841
|
-
if (vaultAddress === void 0) throw new Error("Missing Robinhood USDG PLP vault address");
|
|
26842
|
-
const
|
|
26843
|
-
|
|
26844
|
-
|
|
26845
|
-
|
|
26916
|
+
const vaultAddress$1 = requireChainDeployment(ROBINHOOD_CHAIN_ID).hypovault.vaults.usdgPlpVault;
|
|
26917
|
+
if (vaultAddress$1 === void 0) throw new Error("Missing Robinhood USDG PLP vault address");
|
|
26918
|
+
const resolvedVaultAddress$1 = vaultAddress$1;
|
|
26919
|
+
function createVaultPoolInfos(poolInfos) {
|
|
26920
|
+
return {
|
|
26921
|
+
vaultAddress: resolvedVaultAddress$1,
|
|
26922
|
+
poolInfos: poolInfos.map((poolInfo) => ({ ...poolInfo }))
|
|
26923
|
+
};
|
|
26924
|
+
}
|
|
26925
|
+
const RobinhoodUSDGPLP30bpsVaultPoolInfos = createVaultPoolInfos(ROBINHOOD_USDG_PLP_30BPS_COMPILED_POOL_POLICY.poolInfos);
|
|
26926
|
+
const RobinhoodUSDGPLP5bpsVaultPoolInfos = createVaultPoolInfos(ROBINHOOD_USDG_PLP_5BPS_COMPILED_POOL_POLICY.poolInfos);
|
|
26927
|
+
const RobinhoodUSDGPLPVaultPoolInfos = RobinhoodUSDGPLP5bpsVaultPoolInfos;
|
|
26846
26928
|
|
|
26847
26929
|
//#endregion
|
|
26848
26930
|
//#region src/hypoVault/hypoVaultManagerArtifacts/SepoliaUSDCPLPVaultPoolInfos.ts
|
|
@@ -26869,7 +26951,7 @@ const SepoliaWETHPLPVaultPoolInfos = {
|
|
|
26869
26951
|
const MAINNET_DEPLOYMENT$2 = requireChainDeployment(MAINNET_CHAIN_ID);
|
|
26870
26952
|
/** Block containing the successful V3 accountant-hash and manager-root update. */
|
|
26871
26953
|
const MAINNET_V3_AUTHORIZATION_BLOCK = 25704951n;
|
|
26872
|
-
const POOL_INFO_ARRAY_ABI$
|
|
26954
|
+
const POOL_INFO_ARRAY_ABI$2 = {
|
|
26873
26955
|
type: "tuple[]",
|
|
26874
26956
|
components: [
|
|
26875
26957
|
{
|
|
@@ -26910,7 +26992,7 @@ function createVaultTransition(transition) {
|
|
|
26910
26992
|
};
|
|
26911
26993
|
}
|
|
26912
26994
|
function hashPoolInfos$1(poolInfos) {
|
|
26913
|
-
return keccak256(encodeAbiParameters([POOL_INFO_ARRAY_ABI$
|
|
26995
|
+
return keccak256(encodeAbiParameters([POOL_INFO_ARRAY_ABI$2], [poolInfos.map((poolInfo) => ({
|
|
26914
26996
|
pool: getAddress(poolInfo.pool),
|
|
26915
26997
|
token0: getAddress(poolInfo.token0),
|
|
26916
26998
|
token1: getAddress(poolInfo.token1),
|
|
@@ -26943,14 +27025,14 @@ const MAINNET_V3_AUTHORIZATION_TRANSITIONS = [createVaultTransition({
|
|
|
26943
27025
|
current: generation(MainnetUSDCPLPVaultPoolInfos.poolInfos, MainnetUSDCPLPStrategistLeaves)
|
|
26944
27026
|
})];
|
|
26945
27027
|
const authorizationCacheByClient = new WeakMap();
|
|
26946
|
-
function findTransition(chainId, vaultAddress$
|
|
27028
|
+
function findTransition(chainId, vaultAddress$3) {
|
|
26947
27029
|
if (chainId !== MAINNET_CHAIN_ID) return null;
|
|
26948
|
-
const normalizedVault = vaultAddress$
|
|
27030
|
+
const normalizedVault = vaultAddress$3.toLowerCase();
|
|
26949
27031
|
return MAINNET_V3_AUTHORIZATION_TRANSITIONS.find((transition) => transition.vaultAddress.toLowerCase() === normalizedVault) ?? null;
|
|
26950
27032
|
}
|
|
26951
27033
|
/** Returns both known generations without reading chain state. */
|
|
26952
|
-
function getMainnetV3AuthorizationGenerations({ chainId, vaultAddress: vaultAddress$
|
|
26953
|
-
const transition = findTransition(chainId, vaultAddress$
|
|
27034
|
+
function getMainnetV3AuthorizationGenerations({ chainId, vaultAddress: vaultAddress$3 }) {
|
|
27035
|
+
const transition = findTransition(chainId, vaultAddress$3);
|
|
26954
27036
|
return transition === null ? null : {
|
|
26955
27037
|
previous: transition.previous,
|
|
26956
27038
|
next: transition.next,
|
|
@@ -26962,8 +27044,8 @@ function getMainnetV3AuthorizationGenerations({ chainId, vaultAddress: vaultAddr
|
|
|
26962
27044
|
* Live callers should use the compiled current artifacts directly; this selector exists for
|
|
26963
27045
|
* block-pinned NAV and manager-input reconstruction across the V3 authorization boundary.
|
|
26964
27046
|
*/
|
|
26965
|
-
function getMainnetV3AuthorizationArtifactsAtBlock({ chainId, vaultAddress: vaultAddress$
|
|
26966
|
-
const transition = findTransition(chainId, vaultAddress$
|
|
27047
|
+
function getMainnetV3AuthorizationArtifactsAtBlock({ chainId, vaultAddress: vaultAddress$3, blockNumber }) {
|
|
27048
|
+
const transition = findTransition(chainId, vaultAddress$3);
|
|
26967
27049
|
if (transition === null) return null;
|
|
26968
27050
|
const version = blockNumber < transition.activationBlockNumber ? "previous" : "next";
|
|
26969
27051
|
return {
|
|
@@ -26979,11 +27061,11 @@ function getMainnetV3AuthorizationArtifactsAtBlock({ chainId, vaultAddress: vaul
|
|
|
26979
27061
|
* Every authorization release must add its generation to this transition table before
|
|
26980
27062
|
* the on-chain hashes change, so startup and release verification keeps recognizing it.
|
|
26981
27063
|
*/
|
|
26982
|
-
async function resolveMainnetV3AuthorizationArtifacts({ viemClient, chainId, vaultAddress: vaultAddress$
|
|
26983
|
-
const transition = findTransition(chainId, vaultAddress$
|
|
27064
|
+
async function resolveMainnetV3AuthorizationArtifacts({ viemClient, chainId, vaultAddress: vaultAddress$3, blockNumber }) {
|
|
27065
|
+
const transition = findTransition(chainId, vaultAddress$3);
|
|
26984
27066
|
if (transition === null) return null;
|
|
26985
27067
|
const resolvedBlockNumber = blockNumber ?? await getBlockNumber(viemClient);
|
|
26986
|
-
const cacheKey = `${chainId}:${vaultAddress$
|
|
27068
|
+
const cacheKey = `${chainId}:${vaultAddress$3.toLowerCase()}:${resolvedBlockNumber.toString()}`;
|
|
26987
27069
|
const clientCache = authorizationCacheByClient.get(viemClient);
|
|
26988
27070
|
const cached = clientCache?.get(cacheKey);
|
|
26989
27071
|
if (cached !== void 0) return cached;
|
|
@@ -27020,7 +27102,7 @@ const MAINNET_POOL_RETIREMENT_BLOCK = 25898997n;
|
|
|
27020
27102
|
const MAINNET_POOL_RETIREMENT_TRANSACTION = "0xfca6a6dd0f081649dd6f50496175a58e6a119d574b594390beab23618b05ba2c";
|
|
27021
27103
|
const ROBINHOOD_USDG_VAULT_DEPLOYMENT_BLOCK = 63972776n;
|
|
27022
27104
|
const ROBINHOOD_USDG_VAULT_DEPLOYMENT_TRANSACTION = "0x738c8a6d30a45f9b71d2d6260aa1c04aff558489631b3a9c6ccd5f49e0f57df4";
|
|
27023
|
-
const POOL_INFO_ARRAY_ABI = {
|
|
27105
|
+
const POOL_INFO_ARRAY_ABI$1 = {
|
|
27024
27106
|
type: "tuple[]",
|
|
27025
27107
|
components: [
|
|
27026
27108
|
{
|
|
@@ -27042,7 +27124,7 @@ const POOL_INFO_ARRAY_ABI = {
|
|
|
27042
27124
|
]
|
|
27043
27125
|
};
|
|
27044
27126
|
function hashPoolInfos(poolInfos) {
|
|
27045
|
-
return keccak256(encodeAbiParameters([POOL_INFO_ARRAY_ABI], [poolInfos.map((poolInfo) => ({
|
|
27127
|
+
return keccak256(encodeAbiParameters([POOL_INFO_ARRAY_ABI$1], [poolInfos.map((poolInfo) => ({
|
|
27046
27128
|
pool: getAddress(poolInfo.pool),
|
|
27047
27129
|
token0: getAddress(poolInfo.token0),
|
|
27048
27130
|
token1: getAddress(poolInfo.token1),
|
|
@@ -27139,8 +27221,8 @@ const MAINNET_VAULT_HISTORIES = [{
|
|
|
27139
27221
|
]
|
|
27140
27222
|
}];
|
|
27141
27223
|
const ROBINHOOD_VAULT_HISTORIES = [{
|
|
27142
|
-
vaultAddress:
|
|
27143
|
-
poolConfigurations: [poolConfiguration(ROBINHOOD_USDG_VAULT_DEPLOYMENT_BLOCK, ROBINHOOD_USDG_VAULT_DEPLOYMENT_TRANSACTION,
|
|
27224
|
+
vaultAddress: RobinhoodUSDGPLP30bpsVaultPoolInfos.vaultAddress,
|
|
27225
|
+
poolConfigurations: [poolConfiguration(ROBINHOOD_USDG_VAULT_DEPLOYMENT_BLOCK, ROBINHOOD_USDG_VAULT_DEPLOYMENT_TRANSACTION, RobinhoodUSDGPLP30bpsVaultPoolInfos.poolInfos)],
|
|
27144
27226
|
managerRootTransitions: [{
|
|
27145
27227
|
activationBlockNumber: ROBINHOOD_USDG_VAULT_DEPLOYMENT_BLOCK,
|
|
27146
27228
|
transactionHash: ROBINHOOD_USDG_VAULT_DEPLOYMENT_TRANSACTION,
|
|
@@ -27163,10 +27245,10 @@ function copyHistory(history) {
|
|
|
27163
27245
|
managerRootTransitions: history.managerRootTransitions.map(copyManagerRootTransition)
|
|
27164
27246
|
};
|
|
27165
27247
|
}
|
|
27166
|
-
function findHistory(chainId, vaultAddress$
|
|
27248
|
+
function findHistory(chainId, vaultAddress$3) {
|
|
27167
27249
|
const histories = chainId === MAINNET_CHAIN_ID ? MAINNET_VAULT_HISTORIES : chainId === ROBINHOOD_CHAIN_ID ? ROBINHOOD_VAULT_HISTORIES : null;
|
|
27168
27250
|
if (histories === null) return null;
|
|
27169
|
-
const normalizedVault = vaultAddress$
|
|
27251
|
+
const normalizedVault = vaultAddress$3.toLowerCase();
|
|
27170
27252
|
const history = histories.find((candidate) => candidate.vaultAddress.toLowerCase() === normalizedVault);
|
|
27171
27253
|
return history === void 0 ? null : copyHistory(history);
|
|
27172
27254
|
}
|
|
@@ -27177,19 +27259,117 @@ function latestAtBlock(values, blockNumber) {
|
|
|
27177
27259
|
}
|
|
27178
27260
|
return null;
|
|
27179
27261
|
}
|
|
27180
|
-
function
|
|
27181
|
-
const history = findHistory(chainId, vaultAddress$
|
|
27262
|
+
function getVaultPoolConfigurationAtBlock({ chainId, vaultAddress: vaultAddress$3, blockNumber }) {
|
|
27263
|
+
const history = findHistory(chainId, vaultAddress$3);
|
|
27182
27264
|
return history === null ? null : latestAtBlock(history.poolConfigurations, blockNumber);
|
|
27183
27265
|
}
|
|
27184
|
-
function
|
|
27185
|
-
const history = findHistory(chainId, vaultAddress$
|
|
27266
|
+
function getVaultManagerRootAtBlock({ chainId, vaultAddress: vaultAddress$3, blockNumber }) {
|
|
27267
|
+
const history = findHistory(chainId, vaultAddress$3);
|
|
27186
27268
|
return history === null ? null : latestAtBlock(history.managerRootTransitions, blockNumber);
|
|
27187
27269
|
}
|
|
27188
|
-
function
|
|
27189
|
-
return findHistory(chainId, vaultAddress$
|
|
27270
|
+
function getVaultPoolConfigurationHistory({ chainId, vaultAddress: vaultAddress$3 }) {
|
|
27271
|
+
return findHistory(chainId, vaultAddress$3)?.poolConfigurations ?? null;
|
|
27190
27272
|
}
|
|
27191
|
-
function
|
|
27192
|
-
return findHistory(chainId, vaultAddress$
|
|
27273
|
+
function getVaultManagerRootHistory({ chainId, vaultAddress: vaultAddress$3 }) {
|
|
27274
|
+
return findHistory(chainId, vaultAddress$3)?.managerRootTransitions ?? null;
|
|
27275
|
+
}
|
|
27276
|
+
const getMainnetVaultPoolConfigurationAtBlock = getVaultPoolConfigurationAtBlock;
|
|
27277
|
+
const getMainnetVaultManagerRootAtBlock = getVaultManagerRootAtBlock;
|
|
27278
|
+
const getMainnetVaultPoolConfigurationHistory = getVaultPoolConfigurationHistory;
|
|
27279
|
+
const getMainnetVaultManagerRootHistory = getVaultManagerRootHistory;
|
|
27280
|
+
|
|
27281
|
+
//#endregion
|
|
27282
|
+
//#region src/hypoVault/robinhoodSpyUsdgAuthorization.ts
|
|
27283
|
+
const deployment = requireChainDeployment(ROBINHOOD_CHAIN_ID);
|
|
27284
|
+
const vaultAddress = deployment.hypovault.vaults.usdgPlpVault;
|
|
27285
|
+
const managerAddress = deployment.hypovault.managers.usdgPlpVaultManager;
|
|
27286
|
+
const strategistAddress = deployment.hypovault.turnkeySigners.usdgPlpVaultManager;
|
|
27287
|
+
if (vaultAddress === void 0 || managerAddress === void 0 || strategistAddress === void 0) throw new Error("Missing Robinhood USDG authorization addresses");
|
|
27288
|
+
const resolvedVaultAddress = vaultAddress;
|
|
27289
|
+
const resolvedManagerAddress = managerAddress;
|
|
27290
|
+
const resolvedStrategistAddress = strategistAddress;
|
|
27291
|
+
const POOL_INFO_ARRAY_ABI = {
|
|
27292
|
+
type: "tuple[]",
|
|
27293
|
+
components: [
|
|
27294
|
+
{
|
|
27295
|
+
name: "pool",
|
|
27296
|
+
type: "address"
|
|
27297
|
+
},
|
|
27298
|
+
{
|
|
27299
|
+
name: "token0",
|
|
27300
|
+
type: "address"
|
|
27301
|
+
},
|
|
27302
|
+
{
|
|
27303
|
+
name: "token1",
|
|
27304
|
+
type: "address"
|
|
27305
|
+
},
|
|
27306
|
+
{
|
|
27307
|
+
name: "maxPriceDeviation",
|
|
27308
|
+
type: "int24"
|
|
27309
|
+
}
|
|
27310
|
+
]
|
|
27311
|
+
};
|
|
27312
|
+
const ROBINHOOD_USDG_30BPS_MANAGE_ROOT = "0x5ef821042a85fea05901e4612e8a8d60efd2468ca08f0810d5691e23ea98967f";
|
|
27313
|
+
const ROBINHOOD_USDG_30BPS_POOL_HASH = "0x12b0d7232a6250eb3cf61040edbf4015717756c4819926aedc3670a4217e56cc";
|
|
27314
|
+
const ROBINHOOD_USDG_5BPS_POOL_HASH = "0xc5dcfa7ae982f641493c9f848bb93cb138a1ad5b3bc13c309b7625850af8562b";
|
|
27315
|
+
function hashRobinhoodSpyUsdgPoolInfos(poolInfos) {
|
|
27316
|
+
return keccak256(encodeAbiParameters([POOL_INFO_ARRAY_ABI], [poolInfos.map((poolInfo) => ({
|
|
27317
|
+
pool: getAddress(poolInfo.pool),
|
|
27318
|
+
token0: getAddress(poolInfo.token0),
|
|
27319
|
+
token1: getAddress(poolInfo.token1),
|
|
27320
|
+
maxPriceDeviation: poolInfo.maxPriceDeviation
|
|
27321
|
+
}))]));
|
|
27322
|
+
}
|
|
27323
|
+
const generations = [{
|
|
27324
|
+
version: "30bps",
|
|
27325
|
+
poolInfos: RobinhoodUSDGPLP30bpsVaultPoolInfos.poolInfos,
|
|
27326
|
+
strategistLeaves: RobinhoodUSDGPLP30bpsStrategistLeaves,
|
|
27327
|
+
poolHash: ROBINHOOD_USDG_30BPS_POOL_HASH,
|
|
27328
|
+
manageRoot: ROBINHOOD_USDG_30BPS_MANAGE_ROOT
|
|
27329
|
+
}, {
|
|
27330
|
+
version: "5bps",
|
|
27331
|
+
poolInfos: RobinhoodUSDGPLP5bpsVaultPoolInfos.poolInfos,
|
|
27332
|
+
strategistLeaves: RobinhoodUSDGPLP5bpsStrategistLeaves,
|
|
27333
|
+
poolHash: ROBINHOOD_USDG_5BPS_POOL_HASH,
|
|
27334
|
+
manageRoot: RobinhoodUSDGPLP5bpsStrategistLeaves.metadata.ManageRoot
|
|
27335
|
+
}];
|
|
27336
|
+
for (const generation$1 of generations) {
|
|
27337
|
+
const computedPoolHash = hashRobinhoodSpyUsdgPoolInfos(generation$1.poolInfos);
|
|
27338
|
+
if (computedPoolHash !== generation$1.poolHash) throw new Error(`Robinhood ${generation$1.version} pool hash mismatch: expected ${generation$1.poolHash}, computed ${computedPoolHash}`);
|
|
27339
|
+
}
|
|
27340
|
+
if (RobinhoodUSDGPLP30bpsStrategistLeaves.metadata.ManageRoot !== ROBINHOOD_USDG_30BPS_MANAGE_ROOT) throw new Error("Robinhood 30bps strategist artifact no longer reproduces the live manage root");
|
|
27341
|
+
function getRobinhoodSpyUsdgAuthorizationGenerations() {
|
|
27342
|
+
return generations;
|
|
27343
|
+
}
|
|
27344
|
+
function resolveRobinhoodSpyUsdgAuthorizationState({ blockNumber, poolHash, manageRoot }) {
|
|
27345
|
+
const generation$1 = generations.find((candidate) => candidate.poolHash === poolHash && candidate.manageRoot === manageRoot);
|
|
27346
|
+
if (generation$1 === void 0) throw new Error(`Unsupported or inconsistent Robinhood SPY/USDG authorization state: accountant pool hash ${poolHash}, manager root ${manageRoot}`);
|
|
27347
|
+
return {
|
|
27348
|
+
blockNumber,
|
|
27349
|
+
...generation$1
|
|
27350
|
+
};
|
|
27351
|
+
}
|
|
27352
|
+
async function resolveRobinhoodSpyUsdgAuthorizationArtifacts({ viemClient, chainId, vault: vault$2, blockNumber }) {
|
|
27353
|
+
if (chainId !== ROBINHOOD_CHAIN_ID || vault$2.toLowerCase() !== resolvedVaultAddress.toLowerCase()) return null;
|
|
27354
|
+
const resolvedBlockNumber = blockNumber ?? await getBlockNumber(viemClient);
|
|
27355
|
+
const [poolHash, manageRoot] = await Promise.all([readContract(viemClient, {
|
|
27356
|
+
address: deployment.hypovault.core.accountant,
|
|
27357
|
+
abi: PanopticVaultAccountantAbi,
|
|
27358
|
+
functionName: "vaultHashes",
|
|
27359
|
+
args: [resolvedVaultAddress, 0n],
|
|
27360
|
+
blockNumber: resolvedBlockNumber
|
|
27361
|
+
}), readContract(viemClient, {
|
|
27362
|
+
address: resolvedManagerAddress,
|
|
27363
|
+
abi: HypoVaultManagerWithMerkleVerificationAbi,
|
|
27364
|
+
functionName: "manageRoot",
|
|
27365
|
+
args: [resolvedStrategistAddress],
|
|
27366
|
+
blockNumber: resolvedBlockNumber
|
|
27367
|
+
})]);
|
|
27368
|
+
return resolveRobinhoodSpyUsdgAuthorizationState({
|
|
27369
|
+
blockNumber: resolvedBlockNumber,
|
|
27370
|
+
poolHash,
|
|
27371
|
+
manageRoot
|
|
27372
|
+
});
|
|
27193
27373
|
}
|
|
27194
27374
|
|
|
27195
27375
|
//#endregion
|
|
@@ -27320,7 +27500,7 @@ const VAULT_POOL_INFOS_BY_CHAIN = {
|
|
|
27320
27500
|
],
|
|
27321
27501
|
[SEPOLIA_CHAIN_ID]: [SepoliaUSDCPLPVaultPoolInfos, SepoliaWETHPLPVaultPoolInfos],
|
|
27322
27502
|
[BASE_CHAIN_ID]: [BaseUSDCPLPVaultPoolInfos, BaseWETHPLPVaultPoolInfos],
|
|
27323
|
-
[ROBINHOOD_CHAIN_ID]: [
|
|
27503
|
+
[ROBINHOOD_CHAIN_ID]: [RobinhoodUSDGPLP5bpsVaultPoolInfos, RobinhoodUSDGPLP30bpsVaultPoolInfos]
|
|
27324
27504
|
};
|
|
27325
27505
|
const GET_POOL_ACCOUNT_BALANCE_CANDIDATES = `
|
|
27326
27506
|
query PoolAccountBalanceCandidates(
|
|
@@ -27418,7 +27598,7 @@ async function postGraphQL({ endpoint, query, variables, fetchFn }) {
|
|
|
27418
27598
|
if (json.data === void 0) throw new Error("GraphQL response did not include data");
|
|
27419
27599
|
return json.data;
|
|
27420
27600
|
}
|
|
27421
|
-
async function collectPoolAccountBalanceCandidates({ endpoint, poolIds, vaultAddress: vaultAddress$
|
|
27601
|
+
async function collectPoolAccountBalanceCandidates({ endpoint, poolIds, vaultAddress: vaultAddress$3, candidatesByPool, fetchFn }) {
|
|
27422
27602
|
for (let skip = 0;; skip += PAGE_SIZE) {
|
|
27423
27603
|
const page = await postGraphQL({
|
|
27424
27604
|
endpoint,
|
|
@@ -27427,7 +27607,7 @@ async function collectPoolAccountBalanceCandidates({ endpoint, poolIds, vaultAdd
|
|
|
27427
27607
|
first: PAGE_SIZE,
|
|
27428
27608
|
skip,
|
|
27429
27609
|
poolIds,
|
|
27430
|
-
vault: vaultAddress$
|
|
27610
|
+
vault: vaultAddress$3
|
|
27431
27611
|
},
|
|
27432
27612
|
fetchFn
|
|
27433
27613
|
});
|
|
@@ -27527,8 +27707,8 @@ async function filterOpenTokenIdsAtBlock({ viemClient, poolAddress, account, can
|
|
|
27527
27707
|
const openTokenIds = await collectOpen(candidates);
|
|
27528
27708
|
return sortBigintsAscending(openTokenIds);
|
|
27529
27709
|
}
|
|
27530
|
-
function getVaultPoolInfos(vaultAddress$
|
|
27531
|
-
const vaultAddressLower = toLowerAddress$1(vaultAddress$
|
|
27710
|
+
function getVaultPoolInfos(vaultAddress$3, chainId) {
|
|
27711
|
+
const vaultAddressLower = toLowerAddress$1(vaultAddress$3);
|
|
27532
27712
|
const artifacts = chainId === void 0 ? Object.values(VAULT_POOL_INFOS_BY_CHAIN).flat() : VAULT_POOL_INFOS_BY_CHAIN[chainId] ?? [];
|
|
27533
27713
|
const artifact = artifacts.find((candidate) => toLowerAddress$1(candidate.vaultAddress) === vaultAddressLower);
|
|
27534
27714
|
return artifact?.poolInfos ?? [];
|
|
@@ -27537,15 +27717,24 @@ function getVaultPoolInfos(vaultAddress$1, chainId) {
|
|
|
27537
27717
|
* Returns every pool that can contribute historical position candidates for a vault.
|
|
27538
27718
|
* The live accountant generation is selected separately when encoding manager input.
|
|
27539
27719
|
*/
|
|
27540
|
-
function getVaultCandidatePoolInfos(vaultAddress$
|
|
27541
|
-
const generations = getMainnetV3AuthorizationGenerations({
|
|
27720
|
+
function getVaultCandidatePoolInfos(vaultAddress$3, chainId) {
|
|
27721
|
+
const generations$1 = getMainnetV3AuthorizationGenerations({
|
|
27542
27722
|
chainId,
|
|
27543
|
-
vaultAddress: vaultAddress$
|
|
27723
|
+
vaultAddress: vaultAddress$3
|
|
27544
27724
|
});
|
|
27545
|
-
const
|
|
27546
|
-
|
|
27547
|
-
|
|
27548
|
-
|
|
27725
|
+
const robinhoodGenerations = chainId === ROBINHOOD_CHAIN_ID ? getRobinhoodSpyUsdgAuthorizationGenerations() : [];
|
|
27726
|
+
const history = getVaultPoolConfigurationHistory({
|
|
27727
|
+
chainId,
|
|
27728
|
+
vaultAddress: vaultAddress$3
|
|
27729
|
+
}) ?? [];
|
|
27730
|
+
const candidates = [
|
|
27731
|
+
...history.flatMap(({ poolInfos }) => poolInfos),
|
|
27732
|
+
...generations$1 === null ? getVaultPoolInfos(vaultAddress$3, chainId) : [
|
|
27733
|
+
...generations$1.previous.poolInfos,
|
|
27734
|
+
...generations$1.next.poolInfos,
|
|
27735
|
+
...generations$1.current.poolInfos
|
|
27736
|
+
],
|
|
27737
|
+
...robinhoodGenerations.flatMap((generation$1) => generation$1.poolInfos)
|
|
27549
27738
|
];
|
|
27550
27739
|
const byPoolAddress = new Map();
|
|
27551
27740
|
for (const candidate of candidates) {
|
|
@@ -27555,21 +27744,30 @@ function getVaultCandidatePoolInfos(vaultAddress$1, chainId) {
|
|
|
27555
27744
|
return [...byPoolAddress.values()];
|
|
27556
27745
|
}
|
|
27557
27746
|
/** Selects the pool tuple authorized at an exact block before encoding manager input. */
|
|
27558
|
-
async function resolveVaultPoolInfosAtBlock({ viemClient, chainId, vaultAddress: vaultAddress$
|
|
27747
|
+
async function resolveVaultPoolInfosAtBlock({ viemClient, chainId, vaultAddress: vaultAddress$3, blockNumber }) {
|
|
27748
|
+
if (chainId === ROBINHOOD_CHAIN_ID && blockNumber >= ROBINHOOD_USDG_VAULT_DEPLOYMENT_BLOCK) {
|
|
27749
|
+
const authorization = await resolveRobinhoodSpyUsdgAuthorizationArtifacts({
|
|
27750
|
+
viemClient,
|
|
27751
|
+
chainId,
|
|
27752
|
+
vault: vaultAddress$3,
|
|
27753
|
+
blockNumber
|
|
27754
|
+
});
|
|
27755
|
+
if (authorization !== null) return authorization.poolInfos;
|
|
27756
|
+
}
|
|
27559
27757
|
if (chainId === MAINNET_CHAIN_ID && blockNumber >= MAINNET_V3_AUTHORIZATION_BLOCK) {
|
|
27560
27758
|
const authorization = await resolveMainnetV3AuthorizationArtifacts({
|
|
27561
27759
|
viemClient,
|
|
27562
27760
|
chainId,
|
|
27563
|
-
vaultAddress: vaultAddress$
|
|
27761
|
+
vaultAddress: vaultAddress$3,
|
|
27564
27762
|
blockNumber
|
|
27565
27763
|
});
|
|
27566
27764
|
if (authorization !== null) return authorization.poolInfos;
|
|
27567
27765
|
}
|
|
27568
|
-
return
|
|
27766
|
+
return getVaultPoolConfigurationAtBlock({
|
|
27569
27767
|
chainId,
|
|
27570
|
-
vaultAddress: vaultAddress$
|
|
27768
|
+
vaultAddress: vaultAddress$3,
|
|
27571
27769
|
blockNumber
|
|
27572
|
-
})?.poolInfos ?? getVaultPoolInfos(vaultAddress$
|
|
27770
|
+
})?.poolInfos ?? getVaultPoolInfos(vaultAddress$3, chainId);
|
|
27573
27771
|
}
|
|
27574
27772
|
/**
|
|
27575
27773
|
* Enrich a cached subgraph candidate superset with the authoritative position
|
|
@@ -27581,7 +27779,7 @@ async function resolveVaultPoolInfosAtBlock({ viemClient, chainId, vaultAddress:
|
|
|
27581
27779
|
* all-time candidate cache; closed IDs remain harmless because the normal
|
|
27582
27780
|
* per-block verifier filters them out.
|
|
27583
27781
|
*/
|
|
27584
|
-
async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultAddress: vaultAddress$
|
|
27782
|
+
async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultAddress: vaultAddress$3, candidatesByPool, poolInfos, blockNumber, fromBlock }) {
|
|
27585
27783
|
return Promise.all(poolInfos.map(async (poolInfo) => {
|
|
27586
27784
|
const cached = candidatesByPool.find((candidate) => candidate.poolAddress.toLowerCase() === poolInfo.pool.toLowerCase());
|
|
27587
27785
|
const cachedIds = cached?.candidates ?? [];
|
|
@@ -27595,11 +27793,11 @@ async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultA
|
|
|
27595
27793
|
client: viemClient,
|
|
27596
27794
|
chainId: BigInt(chainId),
|
|
27597
27795
|
poolAddress: poolInfo.pool,
|
|
27598
|
-
account: vaultAddress$
|
|
27796
|
+
account: vaultAddress$3,
|
|
27599
27797
|
fromBlock: scanFromBlock,
|
|
27600
27798
|
toBlock: blockNumber
|
|
27601
27799
|
});
|
|
27602
|
-
if (recoveredIds === null) throw new Error(`Could not recover an authoritative position list for vault ${vaultAddress$
|
|
27800
|
+
if (recoveredIds === null) throw new Error(`Could not recover an authoritative position list for vault ${vaultAddress$3} in pool ${poolInfo.pool} between blocks ${scanFromBlock} and ${blockNumber}`);
|
|
27603
27801
|
const candidates = sortBigintsAscending(new Set([...cachedIds, ...recoveredIds]));
|
|
27604
27802
|
return {
|
|
27605
27803
|
poolAddress: poolInfo.pool,
|
|
@@ -27615,16 +27813,16 @@ async function recoverVaultCandidateTokenIdsByPool({ viemClient, chainId, vaultA
|
|
|
27615
27813
|
* vault instead of re-running the subgraph paging for every anchor block. The
|
|
27616
27814
|
* combined {@link resolveVaultTokenIdsByPool} remains for one-shot callers.
|
|
27617
27815
|
*/
|
|
27618
|
-
async function resolveVaultHistoricalCandidatesByPool({ chainId, vaultAddress: vaultAddress$
|
|
27619
|
-
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress$
|
|
27816
|
+
async function resolveVaultHistoricalCandidatesByPool({ chainId, vaultAddress: vaultAddress$3, managerAddress: managerAddress$2, poolInfos, panopticSubgraphUrl, fetchFn = fetch }) {
|
|
27817
|
+
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress$3, chainId);
|
|
27620
27818
|
if (resolvedPoolInfos.length === 0) return [];
|
|
27621
27819
|
const configuredEndpoint = panopticSubgraphUrl ?? requireChainDeployment(chainId).subgraphs.panoptic;
|
|
27622
27820
|
if (configuredEndpoint === void 0) return resolvedPoolInfos.map((poolInfo) => ({
|
|
27623
27821
|
poolAddress: poolInfo.pool,
|
|
27624
27822
|
candidates: []
|
|
27625
27823
|
}));
|
|
27626
|
-
const vaultAddressLower = toLowerAddress$1(vaultAddress$
|
|
27627
|
-
const recipientAddresses = Array.from(new Set([vaultAddressLower, managerAddress?.toLowerCase()].filter((value) => value !== void 0 && value.length > 0).map((value) => value.toLowerCase())));
|
|
27824
|
+
const vaultAddressLower = toLowerAddress$1(vaultAddress$3);
|
|
27825
|
+
const recipientAddresses = Array.from(new Set([vaultAddressLower, managerAddress$2?.toLowerCase()].filter((value) => value !== void 0 && value.length > 0).map((value) => value.toLowerCase())));
|
|
27628
27826
|
const poolIds = Array.from(new Set(resolvedPoolInfos.map((poolInfo) => toLowerAddress$1(poolInfo.pool))));
|
|
27629
27827
|
const balanceCandidatesByPool = new Map();
|
|
27630
27828
|
const eventCandidatesByPool = new Map();
|
|
@@ -27658,13 +27856,13 @@ async function resolveVaultHistoricalCandidatesByPool({ chainId, vaultAddress: v
|
|
|
27658
27856
|
* open at `blockNumber`, per pool, via on-chain `getFullPositionsData` (bisecting
|
|
27659
27857
|
* on stale candidates). This is the per-block half of the candidate/verify split.
|
|
27660
27858
|
*/
|
|
27661
|
-
async function verifyVaultOpenTokenIdsAtBlock({ viemClient, vaultAddress: vaultAddress$
|
|
27859
|
+
async function verifyVaultOpenTokenIdsAtBlock({ viemClient, vaultAddress: vaultAddress$3, candidatesByPool, blockNumber }) {
|
|
27662
27860
|
const tokenIdsByPool = [];
|
|
27663
27861
|
for (const { poolAddress, candidates } of candidatesByPool) {
|
|
27664
27862
|
const openTokenIds = await filterOpenTokenIdsAtBlock({
|
|
27665
27863
|
viemClient,
|
|
27666
27864
|
poolAddress,
|
|
27667
|
-
account: vaultAddress$
|
|
27865
|
+
account: vaultAddress$3,
|
|
27668
27866
|
candidates,
|
|
27669
27867
|
blockNumber
|
|
27670
27868
|
});
|
|
@@ -27672,13 +27870,13 @@ async function verifyVaultOpenTokenIdsAtBlock({ viemClient, vaultAddress: vaultA
|
|
|
27672
27870
|
}
|
|
27673
27871
|
return tokenIdsByPool;
|
|
27674
27872
|
}
|
|
27675
|
-
async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress: vaultAddress$
|
|
27676
|
-
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress$
|
|
27873
|
+
async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress: vaultAddress$3, managerAddress: managerAddress$2, poolInfos, panopticSubgraphUrl, verificationBlockNumber, fetchFn = fetch }) {
|
|
27874
|
+
const resolvedPoolInfos = poolInfos ?? getVaultPoolInfos(vaultAddress$3, chainId);
|
|
27677
27875
|
if (resolvedPoolInfos.length === 0) return [];
|
|
27678
27876
|
const configuredEndpoint = panopticSubgraphUrl ?? requireChainDeployment(chainId).subgraphs.panoptic;
|
|
27679
27877
|
if (configuredEndpoint === void 0) return resolvedPoolInfos.map(() => []);
|
|
27680
|
-
const vaultAddressLower = toLowerAddress$1(vaultAddress$
|
|
27681
|
-
const recipientAddresses = Array.from(new Set([vaultAddressLower, managerAddress?.toLowerCase()].filter((value) => value !== void 0 && value.length > 0).map((value) => value.toLowerCase())));
|
|
27878
|
+
const vaultAddressLower = toLowerAddress$1(vaultAddress$3);
|
|
27879
|
+
const recipientAddresses = Array.from(new Set([vaultAddressLower, managerAddress$2?.toLowerCase()].filter((value) => value !== void 0 && value.length > 0).map((value) => value.toLowerCase())));
|
|
27682
27880
|
const poolIds = Array.from(new Set(resolvedPoolInfos.map((poolInfo) => toLowerAddress$1(poolInfo.pool))));
|
|
27683
27881
|
const balanceCandidatesByPool = new Map();
|
|
27684
27882
|
const eventCandidatesByPool = new Map();
|
|
@@ -27706,7 +27904,7 @@ async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress: v
|
|
|
27706
27904
|
const historicalOpenTokenIds = await filterOpenTokenIdsAtBlock({
|
|
27707
27905
|
viemClient,
|
|
27708
27906
|
poolAddress: poolInfo.pool,
|
|
27709
|
-
account: vaultAddress$
|
|
27907
|
+
account: vaultAddress$3,
|
|
27710
27908
|
candidates: historicalCandidates,
|
|
27711
27909
|
blockNumber: verificationBlockNumber
|
|
27712
27910
|
});
|
|
@@ -27728,7 +27926,7 @@ async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress: v
|
|
|
27728
27926
|
abi: panopticPoolV2Abi$1,
|
|
27729
27927
|
functionName: "getFullPositionsData",
|
|
27730
27928
|
args: [
|
|
27731
|
-
vaultAddress$
|
|
27929
|
+
vaultAddress$3,
|
|
27732
27930
|
false,
|
|
27733
27931
|
eventCandidates
|
|
27734
27932
|
],
|
|
@@ -27754,32 +27952,32 @@ async function resolveVaultTokenIdsByPool({ viemClient, chainId, vaultAddress: v
|
|
|
27754
27952
|
}
|
|
27755
27953
|
return tokenIdsByPool;
|
|
27756
27954
|
}
|
|
27757
|
-
async function buildVaultManagerInput({ viemClient, chainId, vaultAddress: vaultAddress$
|
|
27955
|
+
async function buildVaultManagerInput({ viemClient, chainId, vaultAddress: vaultAddress$3, underlyingToken, managerAddress: managerAddress$2, panopticSubgraphUrl, fetchFn }) {
|
|
27758
27956
|
const blockNumber = await getBlockNumber(viemClient);
|
|
27759
27957
|
return buildVaultManagerInputAtBlock({
|
|
27760
27958
|
viemClient,
|
|
27761
27959
|
chainId,
|
|
27762
|
-
vaultAddress: vaultAddress$
|
|
27960
|
+
vaultAddress: vaultAddress$3,
|
|
27763
27961
|
underlyingToken,
|
|
27764
27962
|
blockNumber,
|
|
27765
|
-
managerAddress,
|
|
27963
|
+
managerAddress: managerAddress$2,
|
|
27766
27964
|
panopticSubgraphUrl,
|
|
27767
27965
|
fetchFn
|
|
27768
27966
|
});
|
|
27769
27967
|
}
|
|
27770
|
-
async function buildVaultManagerInputAtBlock({ viemClient, chainId, vaultAddress: vaultAddress$
|
|
27968
|
+
async function buildVaultManagerInputAtBlock({ viemClient, chainId, vaultAddress: vaultAddress$3, underlyingToken, blockNumber, managerAddress: managerAddress$2, panopticSubgraphUrl, fetchFn }) {
|
|
27771
27969
|
const poolInfos = await resolveVaultPoolInfosAtBlock({
|
|
27772
27970
|
viemClient,
|
|
27773
27971
|
chainId,
|
|
27774
|
-
vaultAddress: vaultAddress$
|
|
27972
|
+
vaultAddress: vaultAddress$3,
|
|
27775
27973
|
blockNumber
|
|
27776
27974
|
});
|
|
27777
27975
|
if (poolInfos.length === 0) return DEFAULT_MANAGER_INPUT$1;
|
|
27778
27976
|
const tokenIds = await resolveVaultTokenIdsByPool({
|
|
27779
27977
|
viemClient,
|
|
27780
27978
|
chainId,
|
|
27781
|
-
vaultAddress: vaultAddress$
|
|
27782
|
-
managerAddress,
|
|
27979
|
+
vaultAddress: vaultAddress$3,
|
|
27980
|
+
managerAddress: managerAddress$2,
|
|
27783
27981
|
poolInfos,
|
|
27784
27982
|
panopticSubgraphUrl,
|
|
27785
27983
|
verificationBlockNumber: blockNumber,
|
|
@@ -27812,10 +28010,10 @@ const erc20BalanceOfAbi = [{
|
|
|
27812
28010
|
function toLowerAddress(address) {
|
|
27813
28011
|
return address.toLowerCase();
|
|
27814
28012
|
}
|
|
27815
|
-
function discoverPoolAddresses$1({ chainId, vaultAddress: vaultAddress$
|
|
28013
|
+
function discoverPoolAddresses$1({ chainId, vaultAddress: vaultAddress$3 }) {
|
|
27816
28014
|
const discoveredAddresses = [];
|
|
27817
28015
|
const seen = new Set();
|
|
27818
|
-
const config = getHypoVaultConfigForVault(vaultAddress$
|
|
28016
|
+
const config = getHypoVaultConfigForVault(vaultAddress$3, chainId);
|
|
27819
28017
|
const poolFromConfig = config?.addresses?.ethUsdc500bpsV4PanopticPool;
|
|
27820
28018
|
if (poolFromConfig !== void 0) {
|
|
27821
28019
|
const key = toLowerAddress(poolFromConfig);
|
|
@@ -27824,7 +28022,7 @@ function discoverPoolAddresses$1({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
|
27824
28022
|
discoveredAddresses.push(poolFromConfig);
|
|
27825
28023
|
}
|
|
27826
28024
|
}
|
|
27827
|
-
const artifactPoolInfos = getVaultPoolInfos(vaultAddress$
|
|
28025
|
+
const artifactPoolInfos = getVaultPoolInfos(vaultAddress$3, chainId);
|
|
27828
28026
|
for (const poolInfo of artifactPoolInfos) {
|
|
27829
28027
|
const key = toLowerAddress(poolInfo.pool);
|
|
27830
28028
|
if (!seen.has(key)) {
|
|
@@ -27840,10 +28038,10 @@ function getUnderlyingIndex({ underlyingTokenAddress, token0Asset, token1Asset }
|
|
|
27840
28038
|
if (toLowerAddress(token1Asset) === underlyingLower) return 1;
|
|
27841
28039
|
return null;
|
|
27842
28040
|
}
|
|
27843
|
-
async function getLendingAllocationRows({ client, chainId, vaultAddress: vaultAddress$
|
|
28041
|
+
async function getLendingAllocationRows({ client, chainId, vaultAddress: vaultAddress$3, underlyingTokenAddress, blockNumber }) {
|
|
27844
28042
|
const poolAddresses = discoverPoolAddresses$1({
|
|
27845
28043
|
chainId,
|
|
27846
|
-
vaultAddress: vaultAddress$
|
|
28044
|
+
vaultAddress: vaultAddress$3
|
|
27847
28045
|
});
|
|
27848
28046
|
const poolRows = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
27849
28047
|
const metadata = await getPoolMetadata({
|
|
@@ -27864,7 +28062,7 @@ async function getLendingAllocationRows({ client, chainId, vaultAddress: vaultAd
|
|
|
27864
28062
|
}), getAccountCollateral({
|
|
27865
28063
|
client,
|
|
27866
28064
|
poolAddress,
|
|
27867
|
-
account: vaultAddress$
|
|
28065
|
+
account: vaultAddress$3,
|
|
27868
28066
|
blockNumber
|
|
27869
28067
|
})]);
|
|
27870
28068
|
const allocationUnderlying = underlyingIndex === 0 ? accountCollateral.token0.assets : accountCollateral.token1.assets;
|
|
@@ -27885,7 +28083,7 @@ async function getLendingAllocationRows({ client, chainId, vaultAddress: vaultAd
|
|
|
27885
28083
|
address: underlyingTokenAddress,
|
|
27886
28084
|
abi: erc20BalanceOfAbi,
|
|
27887
28085
|
functionName: "balanceOf",
|
|
27888
|
-
args: [vaultAddress$
|
|
28086
|
+
args: [vaultAddress$3],
|
|
27889
28087
|
blockNumber
|
|
27890
28088
|
});
|
|
27891
28089
|
const idleRow = {
|
|
@@ -27979,10 +28177,10 @@ function isNativeToken(tokenAddress) {
|
|
|
27979
28177
|
function addressesEqual(a, b) {
|
|
27980
28178
|
return a.toLowerCase() === b.toLowerCase();
|
|
27981
28179
|
}
|
|
27982
|
-
function discoverPoolAddresses({ chainId, vaultAddress: vaultAddress$
|
|
28180
|
+
function discoverPoolAddresses({ chainId, vaultAddress: vaultAddress$3 }) {
|
|
27983
28181
|
const seen = new Set();
|
|
27984
28182
|
const addresses = [];
|
|
27985
|
-
const config = getHypoVaultConfigForVault(vaultAddress$
|
|
28183
|
+
const config = getHypoVaultConfigForVault(vaultAddress$3, chainId);
|
|
27986
28184
|
const configuredPool = config?.addresses?.ethUsdc500bpsV4PanopticPool;
|
|
27987
28185
|
if (configuredPool !== void 0) {
|
|
27988
28186
|
const key = configuredPool.toLowerCase();
|
|
@@ -27991,7 +28189,7 @@ function discoverPoolAddresses({ chainId, vaultAddress: vaultAddress$1 }) {
|
|
|
27991
28189
|
addresses.push(configuredPool);
|
|
27992
28190
|
}
|
|
27993
28191
|
}
|
|
27994
|
-
const artifactInfos = getVaultPoolInfos(vaultAddress$
|
|
28192
|
+
const artifactInfos = getVaultPoolInfos(vaultAddress$3, chainId);
|
|
27995
28193
|
for (const info of artifactInfos) {
|
|
27996
28194
|
const key = info.pool.toLowerCase();
|
|
27997
28195
|
if (!seen.has(key)) {
|
|
@@ -28151,10 +28349,10 @@ function calculateVaultNetLendingYieldUnderlyingFromTrackerInputs({ inputs, inte
|
|
|
28151
28349
|
}
|
|
28152
28350
|
return sawAssets ? totalNetYieldUnderlying : null;
|
|
28153
28351
|
}
|
|
28154
|
-
async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress: vaultAddress$
|
|
28352
|
+
async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress: vaultAddress$3, underlyingTokenAddress, blockNumber }) {
|
|
28155
28353
|
const poolAddresses = discoverPoolAddresses({
|
|
28156
28354
|
chainId,
|
|
28157
|
-
vaultAddress: vaultAddress$
|
|
28355
|
+
vaultAddress: vaultAddress$3
|
|
28158
28356
|
});
|
|
28159
28357
|
if (poolAddresses.length === 0) return null;
|
|
28160
28358
|
const poolContexts = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
@@ -28214,14 +28412,14 @@ async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress: vault
|
|
|
28214
28412
|
address: trackerAddress,
|
|
28215
28413
|
abi: collateralTrackerV2Abi,
|
|
28216
28414
|
functionName: "assetsOf",
|
|
28217
|
-
args: [vaultAddress$
|
|
28415
|
+
args: [vaultAddress$3],
|
|
28218
28416
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
28219
28417
|
}),
|
|
28220
28418
|
client.readContract({
|
|
28221
28419
|
address: trackerAddress,
|
|
28222
28420
|
abi: collateralTrackerV2Abi,
|
|
28223
28421
|
functionName: "interestState",
|
|
28224
|
-
args: [vaultAddress$
|
|
28422
|
+
args: [vaultAddress$3],
|
|
28225
28423
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
28226
28424
|
}),
|
|
28227
28425
|
client.readContract({
|
|
@@ -28246,10 +28444,10 @@ async function fetchVaultNetLendingApyPct({ client, chainId, vaultAddress: vault
|
|
|
28246
28444
|
})));
|
|
28247
28445
|
return calculateVaultNetLendingApyPctFromTrackerInputs(trackerInputs.filter((input) => input !== null));
|
|
28248
28446
|
}
|
|
28249
|
-
async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddress: vaultAddress$
|
|
28447
|
+
async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddress: vaultAddress$3, underlyingTokenAddress, blockNumber, intervalSeconds }) {
|
|
28250
28448
|
const poolAddresses = discoverPoolAddresses({
|
|
28251
28449
|
chainId,
|
|
28252
|
-
vaultAddress: vaultAddress$
|
|
28450
|
+
vaultAddress: vaultAddress$3
|
|
28253
28451
|
});
|
|
28254
28452
|
if (poolAddresses.length === 0) return null;
|
|
28255
28453
|
const poolContexts = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
@@ -28309,14 +28507,14 @@ async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddre
|
|
|
28309
28507
|
address: trackerAddress,
|
|
28310
28508
|
abi: collateralTrackerV2Abi,
|
|
28311
28509
|
functionName: "assetsOf",
|
|
28312
|
-
args: [vaultAddress$
|
|
28510
|
+
args: [vaultAddress$3],
|
|
28313
28511
|
blockNumber
|
|
28314
28512
|
}),
|
|
28315
28513
|
client.readContract({
|
|
28316
28514
|
address: trackerAddress,
|
|
28317
28515
|
abi: collateralTrackerV2Abi,
|
|
28318
28516
|
functionName: "interestState",
|
|
28319
|
-
args: [vaultAddress$
|
|
28517
|
+
args: [vaultAddress$3],
|
|
28320
28518
|
blockNumber
|
|
28321
28519
|
}),
|
|
28322
28520
|
client.readContract({
|
|
@@ -28344,14 +28542,14 @@ async function fetchVaultNetLendingYieldUnderlying({ client, chainId, vaultAddre
|
|
|
28344
28542
|
intervalSeconds
|
|
28345
28543
|
});
|
|
28346
28544
|
}
|
|
28347
|
-
async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaultAddress$
|
|
28545
|
+
async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaultAddress$3, underlyingTokenAddress, blockNumber }) {
|
|
28348
28546
|
const [reservedWithdrawalAssetsRaw, depositEpochRaw] = await Promise.all([client.readContract({
|
|
28349
|
-
address: vaultAddress$
|
|
28547
|
+
address: vaultAddress$3,
|
|
28350
28548
|
abi: HypoVaultAbi,
|
|
28351
28549
|
functionName: "reservedWithdrawalAssets",
|
|
28352
28550
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
28353
28551
|
}), client.readContract({
|
|
28354
|
-
address: vaultAddress$
|
|
28552
|
+
address: vaultAddress$3,
|
|
28355
28553
|
abi: HypoVaultAbi,
|
|
28356
28554
|
functionName: "depositEpoch",
|
|
28357
28555
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
@@ -28359,7 +28557,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaul
|
|
|
28359
28557
|
const reservedWithdrawalAssets = toBigInt$1(reservedWithdrawalAssetsRaw) ?? 0n;
|
|
28360
28558
|
const depositEpoch = toBigInt$1(depositEpochRaw);
|
|
28361
28559
|
const depositEpochStateRaw = depositEpoch === null ? null : await client.readContract({
|
|
28362
|
-
address: vaultAddress$
|
|
28560
|
+
address: vaultAddress$3,
|
|
28363
28561
|
abi: HypoVaultAbi,
|
|
28364
28562
|
functionName: "depositEpochState",
|
|
28365
28563
|
args: [depositEpoch],
|
|
@@ -28368,7 +28566,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaul
|
|
|
28368
28566
|
const unfulfilledDepositAssets = depositEpochStateRaw === null ? 0n : getAssetsDepositedFromDepositEpochState$1(depositEpochStateRaw);
|
|
28369
28567
|
const poolAddresses = discoverPoolAddresses({
|
|
28370
28568
|
chainId,
|
|
28371
|
-
vaultAddress: vaultAddress$
|
|
28569
|
+
vaultAddress: vaultAddress$3
|
|
28372
28570
|
});
|
|
28373
28571
|
const poolContexts = await Promise.all(poolAddresses.map(async (poolAddress) => {
|
|
28374
28572
|
const [collateral0Address, collateral1Address] = await Promise.all([client.readContract({
|
|
@@ -28449,7 +28647,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaul
|
|
|
28449
28647
|
address: trackerAddress,
|
|
28450
28648
|
abi: collateralTrackerV2Abi,
|
|
28451
28649
|
functionName: "assetsOf",
|
|
28452
|
-
args: [vaultAddress$
|
|
28650
|
+
args: [vaultAddress$3],
|
|
28453
28651
|
...blockNumber === void 0 ? {} : { blockNumber }
|
|
28454
28652
|
}),
|
|
28455
28653
|
client.readContract({
|
|
@@ -28524,7 +28722,7 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaul
|
|
|
28524
28722
|
const balance = await readTokenBalance({
|
|
28525
28723
|
client,
|
|
28526
28724
|
tokenAddress: address,
|
|
28527
|
-
owner: vaultAddress$
|
|
28725
|
+
owner: vaultAddress$3,
|
|
28528
28726
|
blockNumber
|
|
28529
28727
|
});
|
|
28530
28728
|
const adjustedBalance = addressesEqual(address, underlyingTokenAddress) ? adjustUnderlyingIdleBalance({
|
|
@@ -28614,8 +28812,8 @@ async function fetchVaultLendingAllocation({ client, chainId, vaultAddress: vaul
|
|
|
28614
28812
|
|
|
28615
28813
|
//#endregion
|
|
28616
28814
|
//#region src/hypoVault/cancelDeposit/cancelDeposit.ts
|
|
28617
|
-
const getCancelDepositContractConfig = ({ vaultAddress: vaultAddress$
|
|
28618
|
-
address: vaultAddress$
|
|
28815
|
+
const getCancelDepositContractConfig = ({ vaultAddress: vaultAddress$3 }) => ({
|
|
28816
|
+
address: vaultAddress$3,
|
|
28619
28817
|
abi: HypoVaultAbi,
|
|
28620
28818
|
functionName: "cancelDeposit",
|
|
28621
28819
|
args: []
|
|
@@ -28627,15 +28825,15 @@ function encodeCancelDepositFunctionData() {
|
|
|
28627
28825
|
args: []
|
|
28628
28826
|
});
|
|
28629
28827
|
}
|
|
28630
|
-
function simulateCancelDeposit({ viemClient, vaultAddress: vaultAddress$
|
|
28828
|
+
function simulateCancelDeposit({ viemClient, vaultAddress: vaultAddress$3, account }) {
|
|
28631
28829
|
return simulateContract(viemClient, {
|
|
28632
|
-
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$
|
|
28830
|
+
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$3 }),
|
|
28633
28831
|
account
|
|
28634
28832
|
});
|
|
28635
28833
|
}
|
|
28636
|
-
function cancelDeposit({ walletClient, vaultAddress: vaultAddress$
|
|
28834
|
+
function cancelDeposit({ walletClient, vaultAddress: vaultAddress$3, account }) {
|
|
28637
28835
|
return writeContract(walletClient, {
|
|
28638
|
-
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$
|
|
28836
|
+
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$3 }),
|
|
28639
28837
|
account
|
|
28640
28838
|
});
|
|
28641
28839
|
}
|
|
@@ -28672,12 +28870,12 @@ const isErrorUserRejection = (errorMessage) => errorMessage.includes("User rejec
|
|
|
28672
28870
|
|
|
28673
28871
|
//#endregion
|
|
28674
28872
|
//#region src/hypoVault/cancelDeposit/hooks/use-cancel-deposit.ts
|
|
28675
|
-
const useCancelDeposit = ({ chainId, vaultAddress: vaultAddress$
|
|
28873
|
+
const useCancelDeposit = ({ chainId, vaultAddress: vaultAddress$3, onWaitSuccess }) => {
|
|
28676
28874
|
const { address: account } = useAccount();
|
|
28677
|
-
const canSimulate = vaultAddress$
|
|
28875
|
+
const canSimulate = vaultAddress$3 !== zeroAddress && account != null && account !== zeroAddress;
|
|
28678
28876
|
const simulate = useSimulateContract({
|
|
28679
28877
|
chainId,
|
|
28680
|
-
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$
|
|
28878
|
+
...getCancelDepositContractConfig({ vaultAddress: vaultAddress$3 }),
|
|
28681
28879
|
account,
|
|
28682
28880
|
query: {
|
|
28683
28881
|
enabled: canSimulate,
|
|
@@ -28753,51 +28951,51 @@ function encodeExecuteWithdrawalMulticallFunctionData({ multicallCalldatas }) {
|
|
|
28753
28951
|
args: [multicallCalldatas]
|
|
28754
28952
|
});
|
|
28755
28953
|
}
|
|
28756
|
-
const getExecuteWithdrawalContractConfig = ({ vaultAddress: vaultAddress$
|
|
28757
|
-
address: vaultAddress$
|
|
28954
|
+
const getExecuteWithdrawalContractConfig = ({ vaultAddress: vaultAddress$3, user, epoch }) => ({
|
|
28955
|
+
address: vaultAddress$3,
|
|
28758
28956
|
abi: HypoVaultAbi,
|
|
28759
28957
|
functionName: "executeWithdrawal",
|
|
28760
28958
|
args: [user, epoch]
|
|
28761
28959
|
});
|
|
28762
|
-
const getExecuteWithdrawalMulticallContractConfig = ({ vaultAddress: vaultAddress$
|
|
28763
|
-
address: vaultAddress$
|
|
28960
|
+
const getExecuteWithdrawalMulticallContractConfig = ({ vaultAddress: vaultAddress$3, multicallCalldatas }) => ({
|
|
28961
|
+
address: vaultAddress$3,
|
|
28764
28962
|
abi: HypoVaultAbi,
|
|
28765
28963
|
functionName: "multicall",
|
|
28766
28964
|
args: [multicallCalldatas]
|
|
28767
28965
|
});
|
|
28768
|
-
function simulateExecuteWithdrawal({ viemClient, vaultAddress: vaultAddress$
|
|
28966
|
+
function simulateExecuteWithdrawal({ viemClient, vaultAddress: vaultAddress$3, user, epoch, account }) {
|
|
28769
28967
|
return simulateContract(viemClient, {
|
|
28770
28968
|
...getExecuteWithdrawalContractConfig({
|
|
28771
|
-
vaultAddress: vaultAddress$
|
|
28969
|
+
vaultAddress: vaultAddress$3,
|
|
28772
28970
|
user,
|
|
28773
28971
|
epoch
|
|
28774
28972
|
}),
|
|
28775
28973
|
account
|
|
28776
28974
|
});
|
|
28777
28975
|
}
|
|
28778
|
-
function executeWithdrawal({ walletClient, vaultAddress: vaultAddress$
|
|
28976
|
+
function executeWithdrawal({ walletClient, vaultAddress: vaultAddress$3, user, epoch, account }) {
|
|
28779
28977
|
return writeContract(walletClient, {
|
|
28780
28978
|
...getExecuteWithdrawalContractConfig({
|
|
28781
|
-
vaultAddress: vaultAddress$
|
|
28979
|
+
vaultAddress: vaultAddress$3,
|
|
28782
28980
|
user,
|
|
28783
28981
|
epoch
|
|
28784
28982
|
}),
|
|
28785
28983
|
account
|
|
28786
28984
|
});
|
|
28787
28985
|
}
|
|
28788
|
-
function simulateExecuteWithdrawalMulticall({ viemClient, vaultAddress: vaultAddress$
|
|
28986
|
+
function simulateExecuteWithdrawalMulticall({ viemClient, vaultAddress: vaultAddress$3, multicallCalldatas, account }) {
|
|
28789
28987
|
return simulateContract(viemClient, {
|
|
28790
28988
|
...getExecuteWithdrawalMulticallContractConfig({
|
|
28791
|
-
vaultAddress: vaultAddress$
|
|
28989
|
+
vaultAddress: vaultAddress$3,
|
|
28792
28990
|
multicallCalldatas
|
|
28793
28991
|
}),
|
|
28794
28992
|
account
|
|
28795
28993
|
});
|
|
28796
28994
|
}
|
|
28797
|
-
function executeWithdrawalMulticall({ walletClient, vaultAddress: vaultAddress$
|
|
28995
|
+
function executeWithdrawalMulticall({ walletClient, vaultAddress: vaultAddress$3, multicallCalldatas, account }) {
|
|
28798
28996
|
return writeContract(walletClient, {
|
|
28799
28997
|
...getExecuteWithdrawalMulticallContractConfig({
|
|
28800
|
-
vaultAddress: vaultAddress$
|
|
28998
|
+
vaultAddress: vaultAddress$3,
|
|
28801
28999
|
multicallCalldatas
|
|
28802
29000
|
}),
|
|
28803
29001
|
account
|
|
@@ -28877,7 +29075,7 @@ const selectExecutableWithdrawalEpochs = ({ desiredAssets, maxAssetsToExecute, c
|
|
|
28877
29075
|
assetsToExecute: accumulatedAssets
|
|
28878
29076
|
};
|
|
28879
29077
|
};
|
|
28880
|
-
const useExecuteWithdrawal = ({ chainId, vaultAddress: vaultAddress$
|
|
29078
|
+
const useExecuteWithdrawal = ({ chainId, vaultAddress: vaultAddress$3, desiredAssets, maxAssetsToExecute, queuedWithdrawals, withdrawalEpochStates, currentWithdrawalEpoch, simulationAccount, onWaitSuccess }) => {
|
|
28881
29079
|
const { address: account } = useAccount();
|
|
28882
29080
|
const simulatedAccount = simulationAccount ?? account;
|
|
28883
29081
|
const user = simulatedAccount ?? zeroAddress;
|
|
@@ -28921,11 +29119,11 @@ const useExecuteWithdrawal = ({ chainId, vaultAddress: vaultAddress$1, desiredAs
|
|
|
28921
29119
|
assetsToExecute,
|
|
28922
29120
|
claimableAssets: claimableWithdrawals.totalAssets
|
|
28923
29121
|
});
|
|
28924
|
-
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$
|
|
29122
|
+
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$3 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
28925
29123
|
const simulate = useSimulateContract({
|
|
28926
29124
|
chainId,
|
|
28927
29125
|
...getExecuteWithdrawalMulticallContractConfig({
|
|
28928
|
-
vaultAddress: vaultAddress$
|
|
29126
|
+
vaultAddress: vaultAddress$3,
|
|
28929
29127
|
multicallCalldatas
|
|
28930
29128
|
}),
|
|
28931
29129
|
account: simulatedAccount,
|
|
@@ -30093,8 +30291,8 @@ function encodeFulfillWithdrawalsFunctionData({ sharesToFulfill, maxAssetsReceiv
|
|
|
30093
30291
|
|
|
30094
30292
|
//#endregion
|
|
30095
30293
|
//#region src/hypoVault/requestDeposit/requestDeposit.ts
|
|
30096
|
-
const getRequestDepositContractConfig = ({ vaultAddress: vaultAddress$
|
|
30097
|
-
address: vaultAddress$
|
|
30294
|
+
const getRequestDepositContractConfig = ({ vaultAddress: vaultAddress$3, assets }) => ({
|
|
30295
|
+
address: vaultAddress$3,
|
|
30098
30296
|
abi: HypoVaultAbi,
|
|
30099
30297
|
functionName: "requestDeposit",
|
|
30100
30298
|
args: [assets]
|
|
@@ -30106,19 +30304,19 @@ function encodeRequestDepositFunctionData({ assets }) {
|
|
|
30106
30304
|
args: [assets]
|
|
30107
30305
|
});
|
|
30108
30306
|
}
|
|
30109
|
-
function simulateRequestDeposit({ viemClient, vaultAddress: vaultAddress$
|
|
30307
|
+
function simulateRequestDeposit({ viemClient, vaultAddress: vaultAddress$3, assets, account }) {
|
|
30110
30308
|
return simulateContract(viemClient, {
|
|
30111
30309
|
...getRequestDepositContractConfig({
|
|
30112
|
-
vaultAddress: vaultAddress$
|
|
30310
|
+
vaultAddress: vaultAddress$3,
|
|
30113
30311
|
assets
|
|
30114
30312
|
}),
|
|
30115
30313
|
account
|
|
30116
30314
|
});
|
|
30117
30315
|
}
|
|
30118
|
-
function requestDeposit({ walletClient, vaultAddress: vaultAddress$
|
|
30316
|
+
function requestDeposit({ walletClient, vaultAddress: vaultAddress$3, assets, account }) {
|
|
30119
30317
|
return writeContract(walletClient, {
|
|
30120
30318
|
...getRequestDepositContractConfig({
|
|
30121
|
-
vaultAddress: vaultAddress$
|
|
30319
|
+
vaultAddress: vaultAddress$3,
|
|
30122
30320
|
assets
|
|
30123
30321
|
}),
|
|
30124
30322
|
account
|
|
@@ -30129,16 +30327,16 @@ function requestDeposit({ walletClient, vaultAddress: vaultAddress$1, assets, ac
|
|
|
30129
30327
|
//#region src/hypoVault/requestDeposit/hooks/use-request-deposit.ts
|
|
30130
30328
|
const APPROVAL_SYNC_POLL_INTERVAL_MS = 1200;
|
|
30131
30329
|
const APPROVAL_SYNC_MAX_ATTEMPTS = 20;
|
|
30132
|
-
const useRequestDeposit = ({ chainId, vaultAddress: vaultAddress$
|
|
30330
|
+
const useRequestDeposit = ({ chainId, vaultAddress: vaultAddress$3, assets, tokenAddress, simulationAccount, onWaitSuccess }) => {
|
|
30133
30331
|
const { address: account } = useAccount();
|
|
30134
30332
|
const simulatedAccount = simulationAccount ?? account;
|
|
30135
|
-
const canReadAllowance = simulatedAccount != null && simulatedAccount !== zeroAddress && tokenAddress !== zeroAddress && vaultAddress$
|
|
30333
|
+
const canReadAllowance = simulatedAccount != null && simulatedAccount !== zeroAddress && tokenAddress !== zeroAddress && vaultAddress$3 !== zeroAddress;
|
|
30136
30334
|
const allowanceRead = useReadContract({
|
|
30137
30335
|
chainId,
|
|
30138
30336
|
address: canReadAllowance ? tokenAddress : void 0,
|
|
30139
30337
|
abi: Erc20Abi,
|
|
30140
30338
|
functionName: "allowance",
|
|
30141
|
-
args: canReadAllowance ? [simulatedAccount, vaultAddress$
|
|
30339
|
+
args: canReadAllowance ? [simulatedAccount, vaultAddress$3] : void 0,
|
|
30142
30340
|
query: { enabled: canReadAllowance }
|
|
30143
30341
|
});
|
|
30144
30342
|
const allowanceKnown = allowanceRead.data !== void 0;
|
|
@@ -30152,7 +30350,7 @@ const useRequestDeposit = ({ chainId, vaultAddress: vaultAddress$1, assets, toke
|
|
|
30152
30350
|
address: tokenAddress,
|
|
30153
30351
|
abi: Erc20Abi,
|
|
30154
30352
|
functionName: "approve",
|
|
30155
|
-
args: [vaultAddress$
|
|
30353
|
+
args: [vaultAddress$3, maxUint256],
|
|
30156
30354
|
account,
|
|
30157
30355
|
query: {
|
|
30158
30356
|
enabled: allowanceKnown && tokenNeedsApproval && assets > 0n && account != null && canApproveForSimulatedAccount,
|
|
@@ -30171,12 +30369,12 @@ const useRequestDeposit = ({ chainId, vaultAddress: vaultAddress$1, assets, toke
|
|
|
30171
30369
|
const simulate = useSimulateContract({
|
|
30172
30370
|
chainId,
|
|
30173
30371
|
...getRequestDepositContractConfig({
|
|
30174
|
-
vaultAddress: vaultAddress$
|
|
30372
|
+
vaultAddress: vaultAddress$3,
|
|
30175
30373
|
assets
|
|
30176
30374
|
}),
|
|
30177
30375
|
account: simulatedAccount,
|
|
30178
30376
|
query: {
|
|
30179
|
-
enabled: allowanceKnown && !tokenNeedsApproval && assets > 0n && vaultAddress$
|
|
30377
|
+
enabled: allowanceKnown && !tokenNeedsApproval && assets > 0n && vaultAddress$3 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress,
|
|
30180
30378
|
retry: false
|
|
30181
30379
|
}
|
|
30182
30380
|
});
|
|
@@ -30435,49 +30633,49 @@ function encodeRequestWithdrawalMulticallFunctionData({ multicallCalldatas }) {
|
|
|
30435
30633
|
args: [multicallCalldatas]
|
|
30436
30634
|
});
|
|
30437
30635
|
}
|
|
30438
|
-
const getRequestWithdrawalContractConfig = ({ vaultAddress: vaultAddress$
|
|
30439
|
-
address: vaultAddress$
|
|
30636
|
+
const getRequestWithdrawalContractConfig = ({ vaultAddress: vaultAddress$3, shares }) => ({
|
|
30637
|
+
address: vaultAddress$3,
|
|
30440
30638
|
abi: HypoVaultAbi,
|
|
30441
30639
|
functionName: "requestWithdrawal",
|
|
30442
30640
|
args: [shares]
|
|
30443
30641
|
});
|
|
30444
|
-
const getRequestWithdrawalMulticallContractConfig = ({ vaultAddress: vaultAddress$
|
|
30445
|
-
address: vaultAddress$
|
|
30642
|
+
const getRequestWithdrawalMulticallContractConfig = ({ vaultAddress: vaultAddress$3, multicallCalldatas }) => ({
|
|
30643
|
+
address: vaultAddress$3,
|
|
30446
30644
|
abi: HypoVaultAbi,
|
|
30447
30645
|
functionName: "multicall",
|
|
30448
30646
|
args: [multicallCalldatas]
|
|
30449
30647
|
});
|
|
30450
|
-
function simulateRequestWithdrawal({ viemClient, vaultAddress: vaultAddress$
|
|
30648
|
+
function simulateRequestWithdrawal({ viemClient, vaultAddress: vaultAddress$3, shares, account }) {
|
|
30451
30649
|
return simulateContract(viemClient, {
|
|
30452
30650
|
...getRequestWithdrawalContractConfig({
|
|
30453
|
-
vaultAddress: vaultAddress$
|
|
30651
|
+
vaultAddress: vaultAddress$3,
|
|
30454
30652
|
shares
|
|
30455
30653
|
}),
|
|
30456
30654
|
account
|
|
30457
30655
|
});
|
|
30458
30656
|
}
|
|
30459
|
-
function requestWithdrawal({ walletClient, vaultAddress: vaultAddress$
|
|
30657
|
+
function requestWithdrawal({ walletClient, vaultAddress: vaultAddress$3, shares, account }) {
|
|
30460
30658
|
return writeContract(walletClient, {
|
|
30461
30659
|
...getRequestWithdrawalContractConfig({
|
|
30462
|
-
vaultAddress: vaultAddress$
|
|
30660
|
+
vaultAddress: vaultAddress$3,
|
|
30463
30661
|
shares
|
|
30464
30662
|
}),
|
|
30465
30663
|
account
|
|
30466
30664
|
});
|
|
30467
30665
|
}
|
|
30468
|
-
function simulateRequestWithdrawalMulticall({ viemClient, vaultAddress: vaultAddress$
|
|
30666
|
+
function simulateRequestWithdrawalMulticall({ viemClient, vaultAddress: vaultAddress$3, multicallCalldatas, account }) {
|
|
30469
30667
|
return simulateContract(viemClient, {
|
|
30470
30668
|
...getRequestWithdrawalMulticallContractConfig({
|
|
30471
|
-
vaultAddress: vaultAddress$
|
|
30669
|
+
vaultAddress: vaultAddress$3,
|
|
30472
30670
|
multicallCalldatas
|
|
30473
30671
|
}),
|
|
30474
30672
|
account
|
|
30475
30673
|
});
|
|
30476
30674
|
}
|
|
30477
|
-
function requestWithdrawalMulticall({ walletClient, vaultAddress: vaultAddress$
|
|
30675
|
+
function requestWithdrawalMulticall({ walletClient, vaultAddress: vaultAddress$3, multicallCalldatas, account }) {
|
|
30478
30676
|
return writeContract(walletClient, {
|
|
30479
30677
|
...getRequestWithdrawalMulticallContractConfig({
|
|
30480
|
-
vaultAddress: vaultAddress$
|
|
30678
|
+
vaultAddress: vaultAddress$3,
|
|
30481
30679
|
multicallCalldatas
|
|
30482
30680
|
}),
|
|
30483
30681
|
account
|
|
@@ -30548,7 +30746,7 @@ function buildRequestWithdrawalCalldatas({ user, desiredAssets, requestAllAvaila
|
|
|
30548
30746
|
|
|
30549
30747
|
//#endregion
|
|
30550
30748
|
//#region src/hypoVault/requestWithdrawal/hooks/use-claim-vault-shares.ts
|
|
30551
|
-
const useClaimVaultShares = ({ chainId, vaultAddress: vaultAddress$
|
|
30749
|
+
const useClaimVaultShares = ({ chainId, vaultAddress: vaultAddress$3, queuedDeposits, depositEpochStates, currentDepositEpoch, simulationAccount, onWaitSuccess }) => {
|
|
30552
30750
|
const { address: account } = useAccount();
|
|
30553
30751
|
const simulatedAccount = simulationAccount ?? account;
|
|
30554
30752
|
const user = simulatedAccount ?? zeroAddress;
|
|
@@ -30563,11 +30761,11 @@ const useClaimVaultShares = ({ chainId, vaultAddress: vaultAddress$1, queuedDepo
|
|
|
30563
30761
|
depositEpochStates,
|
|
30564
30762
|
currentDepositEpoch
|
|
30565
30763
|
]);
|
|
30566
|
-
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$
|
|
30764
|
+
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$3 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
30567
30765
|
const simulate = useSimulateContract({
|
|
30568
30766
|
chainId,
|
|
30569
30767
|
...getRequestWithdrawalMulticallContractConfig({
|
|
30570
|
-
vaultAddress: vaultAddress$
|
|
30768
|
+
vaultAddress: vaultAddress$3,
|
|
30571
30769
|
multicallCalldatas
|
|
30572
30770
|
}),
|
|
30573
30771
|
account: simulatedAccount,
|
|
@@ -30640,7 +30838,7 @@ const useClaimVaultShares = ({ chainId, vaultAddress: vaultAddress$1, queuedDepo
|
|
|
30640
30838
|
|
|
30641
30839
|
//#endregion
|
|
30642
30840
|
//#region src/hypoVault/requestWithdrawal/hooks/use-request-withdrawal.ts
|
|
30643
|
-
const useRequestWithdrawal = ({ chainId, vaultAddress: vaultAddress$
|
|
30841
|
+
const useRequestWithdrawal = ({ chainId, vaultAddress: vaultAddress$3, desiredAssets, requestAllAvailableShares = false, sharePrice, walletShares, queuedDeposits, depositEpochStates, currentDepositEpoch, simulationAccount, onWaitSuccess }) => {
|
|
30644
30842
|
const { address: account } = useAccount();
|
|
30645
30843
|
const simulatedAccount = simulationAccount ?? account;
|
|
30646
30844
|
const user = simulatedAccount ?? zeroAddress;
|
|
@@ -30663,11 +30861,11 @@ const useRequestWithdrawal = ({ chainId, vaultAddress: vaultAddress$1, desiredAs
|
|
|
30663
30861
|
depositEpochStates,
|
|
30664
30862
|
currentDepositEpoch
|
|
30665
30863
|
]);
|
|
30666
|
-
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$
|
|
30864
|
+
const canSimulate = multicallCalldatas.length > 0 && vaultAddress$3 !== zeroAddress && simulatedAccount != null && simulatedAccount !== zeroAddress;
|
|
30667
30865
|
const simulate = useSimulateContract({
|
|
30668
30866
|
chainId,
|
|
30669
30867
|
...getRequestWithdrawalMulticallContractConfig({
|
|
30670
|
-
vaultAddress: vaultAddress$
|
|
30868
|
+
vaultAddress: vaultAddress$3,
|
|
30671
30869
|
multicallCalldatas
|
|
30672
30870
|
}),
|
|
30673
30871
|
account: simulatedAccount,
|
|
@@ -31191,7 +31389,7 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
31191
31389
|
//#endregion
|
|
31192
31390
|
//#region src/graphqlClient.ts
|
|
31193
31391
|
const chainToHypoVaultGraphQlAPI = {};
|
|
31194
|
-
for (const deployment$
|
|
31392
|
+
for (const deployment$3 of Object.values(CHAIN_DEPLOYMENTS)) chainToHypoVaultGraphQlAPI[deployment$3.chainId] = deployment$3.subgraphs.hypovault;
|
|
31195
31393
|
function getHypoVaultGraphQLClient(chainId) {
|
|
31196
31394
|
const apiUrl = chainToHypoVaultGraphQlAPI[chainId];
|
|
31197
31395
|
if (apiUrl === void 0) throw new Error(`Unsupported HypoVault subgraph chainId: ${chainId}`);
|
|
@@ -31205,7 +31403,7 @@ function parseTimestampSec(value) {
|
|
|
31205
31403
|
const parsed = Number(value);
|
|
31206
31404
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
31207
31405
|
}
|
|
31208
|
-
async function fetchFirstDepositTimestampForVault({ graphClient, vaultAddress: vaultAddress$
|
|
31406
|
+
async function fetchFirstDepositTimestampForVault({ graphClient, vaultAddress: vaultAddress$3 }) {
|
|
31209
31407
|
const response = await graphClient.request(`
|
|
31210
31408
|
query FirstVaultDepositTimestamp($hypoVault: String!) {
|
|
31211
31409
|
depositExecuteds(
|
|
@@ -31239,7 +31437,7 @@ async function fetchFirstDepositTimestampForVault({ graphClient, vaultAddress: v
|
|
|
31239
31437
|
}
|
|
31240
31438
|
}
|
|
31241
31439
|
}
|
|
31242
|
-
`, { hypoVault: vaultAddress$
|
|
31440
|
+
`, { hypoVault: vaultAddress$3.toLowerCase() });
|
|
31243
31441
|
const timestamps = [...response.depositExecuteds, ...response.depositsFulfilleds].map((event) => parseTimestampSec(event.blockTimestamp)).filter((timestamp) => timestamp !== null);
|
|
31244
31442
|
if (timestamps.length === 0) return null;
|
|
31245
31443
|
return Math.min(...timestamps);
|
|
@@ -31248,8 +31446,8 @@ async function fetchFirstDepositTimestampByVaultId({ chainId, vaultAddresses })
|
|
|
31248
31446
|
const endpoint = chainToHypoVaultGraphQlAPI[chainId];
|
|
31249
31447
|
if (endpoint === void 0 || vaultAddresses.length === 0) return {};
|
|
31250
31448
|
const graphClient = new GraphQLClient(endpoint);
|
|
31251
|
-
const entries = await Promise.all(vaultAddresses.map(async (vaultAddress$
|
|
31252
|
-
const vaultAddressLower = vaultAddress$
|
|
31449
|
+
const entries = await Promise.all(vaultAddresses.map(async (vaultAddress$3) => {
|
|
31450
|
+
const vaultAddressLower = vaultAddress$3.toLowerCase();
|
|
31253
31451
|
const timestamp = await fetchFirstDepositTimestampForVault({
|
|
31254
31452
|
graphClient,
|
|
31255
31453
|
vaultAddress: vaultAddressLower
|
|
@@ -31371,27 +31569,27 @@ function getStaleOracleStateOverrideForAccountant(accountantAddress) {
|
|
|
31371
31569
|
//#endregion
|
|
31372
31570
|
//#region src/hypoVault/sharePrice/strategies.ts
|
|
31373
31571
|
const DEFAULT_MANAGER_INPUT = "0x";
|
|
31374
|
-
function buildVaultStrategyKey(chainId, vaultAddress$
|
|
31375
|
-
return `${chainId}:${vaultAddress$
|
|
31572
|
+
function buildVaultStrategyKey(chainId, vaultAddress$3) {
|
|
31573
|
+
return `${chainId}:${vaultAddress$3.toLowerCase()}`;
|
|
31376
31574
|
}
|
|
31377
31575
|
function resolveChainWethAddress(chainId) {
|
|
31378
|
-
let deployment$
|
|
31576
|
+
let deployment$3;
|
|
31379
31577
|
try {
|
|
31380
|
-
deployment$
|
|
31578
|
+
deployment$3 = requireChainDeployment(chainId);
|
|
31381
31579
|
} catch {
|
|
31382
31580
|
return void 0;
|
|
31383
31581
|
}
|
|
31384
|
-
const wethVaultAddress = deployment$
|
|
31582
|
+
const wethVaultAddress = deployment$3.hypovault.vaults.wethPlpVault;
|
|
31385
31583
|
return getHypoVaultConfigForVault(wethVaultAddress, chainId)?.addresses?.underlyingToken;
|
|
31386
31584
|
}
|
|
31387
|
-
function getPlpManagerAddress(chainId, vaultAddress$
|
|
31388
|
-
return getHypoVaultConfigForVault(vaultAddress$
|
|
31585
|
+
function getPlpManagerAddress(chainId, vaultAddress$3) {
|
|
31586
|
+
return getHypoVaultConfigForVault(vaultAddress$3, chainId)?.addresses?.hypoVaultManagerWithMerkleVerification ?? null;
|
|
31389
31587
|
}
|
|
31390
|
-
async function getPlpPoolInfosAtBlock({ chainId, client, vaultAddress: vaultAddress$
|
|
31588
|
+
async function getPlpPoolInfosAtBlock({ chainId, client, vaultAddress: vaultAddress$3, blockNumber }) {
|
|
31391
31589
|
return resolveVaultPoolInfosAtBlock({
|
|
31392
31590
|
viemClient: client,
|
|
31393
31591
|
chainId,
|
|
31394
|
-
vaultAddress: vaultAddress$
|
|
31592
|
+
vaultAddress: vaultAddress$3,
|
|
31395
31593
|
blockNumber
|
|
31396
31594
|
});
|
|
31397
31595
|
}
|
|
@@ -31399,27 +31597,27 @@ function createPlpManagerInputStrategy(minBlock) {
|
|
|
31399
31597
|
return {
|
|
31400
31598
|
enabledMetrics: ["nav"],
|
|
31401
31599
|
resolveCandidates: async ({ chainId, vault: vault$2 }) => {
|
|
31402
|
-
const vaultAddress$
|
|
31403
|
-
const poolInfos = getVaultCandidatePoolInfos(vaultAddress$
|
|
31600
|
+
const vaultAddress$3 = vault$2.id;
|
|
31601
|
+
const poolInfos = getVaultCandidatePoolInfos(vaultAddress$3, chainId);
|
|
31404
31602
|
if (poolInfos.length === 0) return [];
|
|
31405
31603
|
return resolveVaultHistoricalCandidatesByPool({
|
|
31406
31604
|
chainId,
|
|
31407
|
-
vaultAddress: vaultAddress$
|
|
31408
|
-
managerAddress: getPlpManagerAddress(chainId, vaultAddress$
|
|
31605
|
+
vaultAddress: vaultAddress$3,
|
|
31606
|
+
managerAddress: getPlpManagerAddress(chainId, vaultAddress$3),
|
|
31409
31607
|
poolInfos
|
|
31410
31608
|
});
|
|
31411
31609
|
},
|
|
31412
31610
|
recoverCandidates: async ({ chainId, client, vault: vault$2, blockNumber, fromBlock, candidates }) => {
|
|
31413
|
-
const vaultAddress$
|
|
31611
|
+
const vaultAddress$3 = vault$2.id;
|
|
31414
31612
|
return recoverVaultCandidateTokenIdsByPool({
|
|
31415
31613
|
viemClient: client,
|
|
31416
31614
|
chainId,
|
|
31417
|
-
vaultAddress: vaultAddress$
|
|
31615
|
+
vaultAddress: vaultAddress$3,
|
|
31418
31616
|
candidatesByPool: candidates,
|
|
31419
31617
|
poolInfos: await getPlpPoolInfosAtBlock({
|
|
31420
31618
|
chainId,
|
|
31421
31619
|
client,
|
|
31422
|
-
vaultAddress: vaultAddress$
|
|
31620
|
+
vaultAddress: vaultAddress$3,
|
|
31423
31621
|
blockNumber
|
|
31424
31622
|
}),
|
|
31425
31623
|
blockNumber,
|
|
@@ -31427,7 +31625,7 @@ function createPlpManagerInputStrategy(minBlock) {
|
|
|
31427
31625
|
});
|
|
31428
31626
|
},
|
|
31429
31627
|
managerInputProvider: async ({ chainId, client, vault: vault$2, blockNumber, candidates }) => {
|
|
31430
|
-
const vaultAddress$
|
|
31628
|
+
const vaultAddress$3 = vault$2.id;
|
|
31431
31629
|
if (minBlock !== void 0 && blockNumber < minBlock) throw new VaultApyPreInceptionBlockError({
|
|
31432
31630
|
blockNumber,
|
|
31433
31631
|
minBlockNumber: minBlock,
|
|
@@ -31436,20 +31634,20 @@ function createPlpManagerInputStrategy(minBlock) {
|
|
|
31436
31634
|
const poolInfos = await getPlpPoolInfosAtBlock({
|
|
31437
31635
|
chainId,
|
|
31438
31636
|
client,
|
|
31439
|
-
vaultAddress: vaultAddress$
|
|
31637
|
+
vaultAddress: vaultAddress$3,
|
|
31440
31638
|
blockNumber
|
|
31441
31639
|
});
|
|
31442
31640
|
if (poolInfos.length === 0) return DEFAULT_MANAGER_INPUT;
|
|
31443
31641
|
const tokenIds = candidates === void 0 ? await resolveVaultTokenIdsByPool({
|
|
31444
31642
|
viemClient: client,
|
|
31445
31643
|
chainId,
|
|
31446
|
-
vaultAddress: vaultAddress$
|
|
31447
|
-
managerAddress: getPlpManagerAddress(chainId, vaultAddress$
|
|
31644
|
+
vaultAddress: vaultAddress$3,
|
|
31645
|
+
managerAddress: getPlpManagerAddress(chainId, vaultAddress$3),
|
|
31448
31646
|
poolInfos,
|
|
31449
31647
|
verificationBlockNumber: blockNumber
|
|
31450
31648
|
}) : await verifyVaultOpenTokenIdsAtBlock({
|
|
31451
31649
|
viemClient: client,
|
|
31452
|
-
vaultAddress: vaultAddress$
|
|
31650
|
+
vaultAddress: vaultAddress$3,
|
|
31453
31651
|
candidatesByPool: poolInfos.map((poolInfo) => {
|
|
31454
31652
|
const candidate = candidates.find((item) => item.poolAddress.toLowerCase() === poolInfo.pool.toLowerCase());
|
|
31455
31653
|
if (candidate === void 0) throw new Error(`Missing token-id candidates for authorized pool ${poolInfo.pool}`);
|
|
@@ -31493,16 +31691,16 @@ const strategyOverridesByVaultKey = {
|
|
|
31493
31691
|
[buildVaultStrategyKey(SEPOLIA_CHAIN_ID, SepoliaUSDCPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(SEPOLIA_PLP_POOL_MIN_BLOCK),
|
|
31494
31692
|
[buildVaultStrategyKey(SEPOLIA_CHAIN_ID, SepoliaWETHPLPVaultPoolInfos.vaultAddress)]: createPlpManagerInputStrategy(SEPOLIA_PLP_POOL_MIN_BLOCK)
|
|
31495
31693
|
};
|
|
31496
|
-
function getVaultApyStrategy({ chainId, vaultAddress: vaultAddress$
|
|
31497
|
-
const key = buildVaultStrategyKey(chainId, vaultAddress$
|
|
31694
|
+
function getVaultApyStrategy({ chainId, vaultAddress: vaultAddress$3 }) {
|
|
31695
|
+
const key = buildVaultStrategyKey(chainId, vaultAddress$3);
|
|
31498
31696
|
return strategyOverridesByVaultKey[key] ?? defaultStrategy;
|
|
31499
31697
|
}
|
|
31500
|
-
function setVaultApyStrategyOverride({ chainId, vaultAddress: vaultAddress$
|
|
31501
|
-
const key = buildVaultStrategyKey(chainId, vaultAddress$
|
|
31698
|
+
function setVaultApyStrategyOverride({ chainId, vaultAddress: vaultAddress$3, strategy }) {
|
|
31699
|
+
const key = buildVaultStrategyKey(chainId, vaultAddress$3);
|
|
31502
31700
|
strategyOverridesByVaultKey[key] = strategy;
|
|
31503
31701
|
}
|
|
31504
|
-
function clearVaultApyStrategyOverride({ chainId, vaultAddress: vaultAddress$
|
|
31505
|
-
const key = buildVaultStrategyKey(chainId, vaultAddress$
|
|
31702
|
+
function clearVaultApyStrategyOverride({ chainId, vaultAddress: vaultAddress$3 }) {
|
|
31703
|
+
const key = buildVaultStrategyKey(chainId, vaultAddress$3);
|
|
31506
31704
|
delete strategyOverridesByVaultKey[key];
|
|
31507
31705
|
}
|
|
31508
31706
|
|
|
@@ -31522,12 +31720,12 @@ function getAssetsDepositedFromDepositEpochState(value) {
|
|
|
31522
31720
|
return null;
|
|
31523
31721
|
}
|
|
31524
31722
|
async function fetchVaultSharePriceSnapshot({ client, vault: vault$2, chainId, windowLabel, blockNumber, readContractFn, candidates, includeTokenIdsInDiagnostics = false }) {
|
|
31525
|
-
const vaultAddress$
|
|
31723
|
+
const vaultAddress$3 = vault$2.id;
|
|
31526
31724
|
const accountantAddress = vault$2.accountant;
|
|
31527
31725
|
const underlyingTokenAddress = vault$2.underlyingToken.id;
|
|
31528
31726
|
const strategy = getVaultApyStrategy({
|
|
31529
31727
|
chainId,
|
|
31530
|
-
vaultAddress: vaultAddress$
|
|
31728
|
+
vaultAddress: vaultAddress$3
|
|
31531
31729
|
});
|
|
31532
31730
|
const managerInputProviderResult = await strategy.managerInputProvider({
|
|
31533
31731
|
chainId,
|
|
@@ -31559,7 +31757,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault: vault$2, chainId, w
|
|
|
31559
31757
|
readWithContext({
|
|
31560
31758
|
callName: "depositEpoch",
|
|
31561
31759
|
request: {
|
|
31562
|
-
address: vaultAddress$
|
|
31760
|
+
address: vaultAddress$3,
|
|
31563
31761
|
abi: HypoVaultAbi,
|
|
31564
31762
|
functionName: "depositEpoch",
|
|
31565
31763
|
blockNumber
|
|
@@ -31568,7 +31766,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault: vault$2, chainId, w
|
|
|
31568
31766
|
readWithContext({
|
|
31569
31767
|
callName: "reservedWithdrawalAssets",
|
|
31570
31768
|
request: {
|
|
31571
|
-
address: vaultAddress$
|
|
31769
|
+
address: vaultAddress$3,
|
|
31572
31770
|
abi: HypoVaultAbi,
|
|
31573
31771
|
functionName: "reservedWithdrawalAssets",
|
|
31574
31772
|
blockNumber
|
|
@@ -31577,7 +31775,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault: vault$2, chainId, w
|
|
|
31577
31775
|
readWithContext({
|
|
31578
31776
|
callName: "totalSupply",
|
|
31579
31777
|
request: {
|
|
31580
|
-
address: vaultAddress$
|
|
31778
|
+
address: vaultAddress$3,
|
|
31581
31779
|
abi: HypoVaultAbi,
|
|
31582
31780
|
functionName: "totalSupply",
|
|
31583
31781
|
blockNumber
|
|
@@ -31589,7 +31787,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault: vault$2, chainId, w
|
|
|
31589
31787
|
const depositEpochStateRaw = await readWithContext({
|
|
31590
31788
|
callName: "depositEpochState",
|
|
31591
31789
|
request: {
|
|
31592
|
-
address: vaultAddress$
|
|
31790
|
+
address: vaultAddress$3,
|
|
31593
31791
|
abi: HypoVaultAbi,
|
|
31594
31792
|
functionName: "depositEpochState",
|
|
31595
31793
|
args: [depositEpoch],
|
|
@@ -31608,7 +31806,7 @@ async function fetchVaultSharePriceSnapshot({ client, vault: vault$2, chainId, w
|
|
|
31608
31806
|
abi: PanopticVaultAccountantAbi,
|
|
31609
31807
|
functionName: "computeNAV",
|
|
31610
31808
|
args: [
|
|
31611
|
-
vaultAddress$
|
|
31809
|
+
vaultAddress$3,
|
|
31612
31810
|
underlyingTokenAddress,
|
|
31613
31811
|
managerInput
|
|
31614
31812
|
],
|
|
@@ -31766,12 +31964,12 @@ function deriveVaultApyTimeseriesFromSharePrices(sharePricePoints) {
|
|
|
31766
31964
|
const sorted = [...sharePricePoints].sort((a, b) => a.timestampSec - b.timestampSec);
|
|
31767
31965
|
const points = [];
|
|
31768
31966
|
for (let i = 1; i < sorted.length; i += 1) {
|
|
31769
|
-
const previous = sorted[i - 1];
|
|
31967
|
+
const previous$1 = sorted[i - 1];
|
|
31770
31968
|
const current = sorted[i];
|
|
31771
|
-
const days = (current.timestampSec - previous.timestampSec) / SECONDS_PER_DAY$1;
|
|
31969
|
+
const days = (current.timestampSec - previous$1.timestampSec) / SECONDS_PER_DAY$1;
|
|
31772
31970
|
const apyPct = calculateAnnualizedApyPct({
|
|
31773
31971
|
currentSharePrice: new Decimal(current.sharePrice),
|
|
31774
|
-
previousSharePrice: new Decimal(previous.sharePrice),
|
|
31972
|
+
previousSharePrice: new Decimal(previous$1.sharePrice),
|
|
31775
31973
|
days
|
|
31776
31974
|
});
|
|
31777
31975
|
if (apyPct === null || !Number.isFinite(apyPct)) continue;
|
|
@@ -32324,7 +32522,7 @@ function encodeApproveFunctionData({ spender, amount: amount$1 }) {
|
|
|
32324
32522
|
}
|
|
32325
32523
|
|
|
32326
32524
|
//#endregion
|
|
32327
|
-
//#region src/rpc.ts
|
|
32525
|
+
//#region src/rpc/providers.ts
|
|
32328
32526
|
const alchemyChains = {
|
|
32329
32527
|
1: "eth-mainnet",
|
|
32330
32528
|
137: "polygon-mainnet",
|
|
@@ -32593,5 +32791,5 @@ async function getIrmCurve(params) {
|
|
|
32593
32791
|
}
|
|
32594
32792
|
|
|
32595
32793
|
//#endregion
|
|
32596
|
-
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, getAaveHoldings, getAlchemyRpcUrl, getAlchemyWsRpcUrl, getCancelDepositContractConfig, getChainDeployment, getEthUsdcMarket, getExecuteWithdrawalContractConfig, getExecuteWithdrawalMulticallContractConfig, getHypoVaultConfigForVault, getHypoVaultGraphQLClient, getIrmCurrent, getIrmCurve, getLendingAllocationRows, getMainnetV3AuthorizationArtifactsAtBlock, getMainnetV3AuthorizationGenerations, getMainnetVaultManagerRootAtBlock, getMainnetVaultManagerRootHistory, getMainnetVaultPoolConfigurationAtBlock, getMainnetVaultPoolConfigurationHistory, getMinQueuedDepositEpoch, getMorphoHoldings, getProofsFromDigests, getProofsUsingTree, getRequestDepositContractConfig, getRequestWithdrawalContractConfig, getRequestWithdrawalMulticallContractConfig, getSpyUsdgMarket, getStaleOracleOverrideBytecodeForAccountant, getStaleOracleStateOverrideForAccountant, getStkAaveHoldings, 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, useErc20Balance, useExecuteWithdrawal, useRequestDeposit, useRequestWithdrawal, utilizationBpsToWad, utilizationPctToWad, validateVaultSignedTransactionFeeCaps, verifyVaultOpenTokenIdsAtBlock };
|
|
32794
|
+
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_30BPS_MARKET, ROBINHOOD_SPY_USDG_30BPS_PANOPTIC_POOL_ADDRESSES, ROBINHOOD_SPY_USDG_30BPS_POOL_DEPLOYMENT_BLOCK, ROBINHOOD_SPY_USDG_30BPS_POOL_INFO, ROBINHOOD_SPY_USDG_5BPS_MARKET, ROBINHOOD_SPY_USDG_5BPS_PANOPTIC_POOL_ADDRESSES, ROBINHOOD_SPY_USDG_5BPS_POOL_DEPLOYMENT_BLOCK, ROBINHOOD_SPY_USDG_5BPS_POOL_INFO, ROBINHOOD_SPY_USDG_MARKET, ROBINHOOD_SPY_USDG_POOL_DEPLOYMENT_BLOCK, ROBINHOOD_SPY_USDG_POOL_INFO, ROBINHOOD_USDG_30BPS_MANAGE_ROOT, ROBINHOOD_USDG_30BPS_POOL_HASH, ROBINHOOD_USDG_5BPS_POOL_HASH, ROBINHOOD_USDG_PLP_30BPS_COMPILED_POOL_POLICY, ROBINHOOD_USDG_PLP_30BPS_POOL_POLICY, ROBINHOOD_USDG_PLP_5BPS_COMPILED_POOL_POLICY, ROBINHOOD_USDG_PLP_5BPS_POOL_POLICY, ROBINHOOD_USDG_PLP_COMPILED_POOL_POLICY, ROBINHOOD_USDG_PLP_POOL_POLICY, ROBINHOOD_USDG_VAULT_DEPLOYMENT_BLOCK, RescueDistributorAbi, RobinhoodUSDGPLP30bpsStrategistLeaves, RobinhoodUSDGPLP30bpsVaultPoolInfos, RobinhoodUSDGPLP5bpsStrategistLeaves, RobinhoodUSDGPLP5bpsVaultPoolInfos, 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, getAaveHoldings, getAlchemyRpcUrl, getAlchemyWsRpcUrl, getCancelDepositContractConfig, getChainDeployment, getEthUsdcMarket, getExecuteWithdrawalContractConfig, getExecuteWithdrawalMulticallContractConfig, getHypoVaultConfigForVault, getHypoVaultGraphQLClient, getIrmCurrent, getIrmCurve, getLendingAllocationRows, getMainnetV3AuthorizationArtifactsAtBlock, getMainnetV3AuthorizationGenerations, getMainnetVaultManagerRootAtBlock, getMainnetVaultManagerRootHistory, getMainnetVaultPoolConfigurationAtBlock, getMainnetVaultPoolConfigurationHistory, getMinQueuedDepositEpoch, getMorphoHoldings, getProofsFromDigests, getProofsUsingTree, getRequestDepositContractConfig, getRequestWithdrawalContractConfig, getRequestWithdrawalMulticallContractConfig, getRobinhoodSpyUsdgAuthorizationGenerations, getSpyUsdgMarket, getStaleOracleOverrideBytecodeForAccountant, getStaleOracleStateOverrideForAccountant, getStkAaveHoldings, getVaultApyErrorMessage, getVaultApyStrategy, getVaultCandidatePoolInfos, getVaultDeltaHedgeHistoricalFeeQuote, getVaultDeltaHedgeInitialFeeQuote, getVaultManagerRootAtBlock, getVaultManagerRootHistory, getVaultPoolConfigurationAtBlock, getVaultPoolConfigurationHistory, getVaultPoolInfos, getVaultTransactionFeeQuote, getVaultTransactionReplacementFeeQuote, hashRobinhoodSpyUsdgPoolInfos, 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, resolveRobinhoodSpyUsdgAuthorizationArtifacts, resolveRobinhoodSpyUsdgAuthorizationState, resolveVaultDisplayName, resolveVaultHistoricalCandidatesByPool, resolveVaultPoolInfosAtBlock, resolveVaultTokenIdsByPool, riskEngineAbi, semiFungiblePositionManagerV4Abi as semiFungiblePositionManagerAbi, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi, setVaultApyStrategyOverride, simulateCancelDeposit, simulateExecuteWithdrawal, simulateExecuteWithdrawalMulticall, simulateRequestDeposit, simulateRequestWithdrawal, simulateRequestWithdrawalMulticall, statusForVaultSharePriceSnapshot, useCancelDeposit, useClaimVaultShares, useErc20Balance, useExecuteWithdrawal, useRequestDeposit, useRequestWithdrawal, utilizationBpsToWad, utilizationPctToWad, validateVaultSignedTransactionFeeCaps, verifyVaultOpenTokenIdsAtBlock };
|
|
32597
32795
|
//# sourceMappingURL=index.js.map
|