@pendle/core-v2 2.22.0 → 2.22.2
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/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.json +1027 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.json +1166 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.json +1171 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAWethHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearMath.sol/LinearMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearPreview.sol/LinearPreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileLpHelper.sol/CamelotV1VolatileLpHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatilePreview.sol/CamelotV1VolatilePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/GLPPreviewHelper.sol/GLPPreviewHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.json +961 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaLpHelper.sol/ThenaLpHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaMath.sol/ThenaMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/IThenaSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/ThenaPreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrBNB.sol/IAnkrBNB.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrBNB.sol/IAnkrBNB.json +62 -0
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrLiquidStaking.sol/IAnkrLiquidStaking.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrLiquidStaking.sol/IAnkrLiquidStaking.json +108 -0
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IERC4626LinearPool.sol/IERC4626LinearPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/BinanceEth/IWBETH.sol/IWBETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotFactory.sol/ICamelotFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTFactory.sol/ICamelotNFTFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTHandler.sol/ICamelotNFTHandler.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPoolFactory.sol/ICamelotNitroPoolFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotPair.sol/ICamelotPair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotRouter.sol/ICamelotRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotYieldBooster.sol/ICamelotYieldBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/IXGrail.sol/IXGrail.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICrvDepositor.sol/ICrvDepositor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICvxCrv.sol/ICvxCrv.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Frax/IFrxEthMinter.sol/IFrxEthMinter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IGMXVault.sol/IGMXVault.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IVaultPriceFeed.sol/IVaultPriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPtOracle.sol/IPPtOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPendlePreviewHelper.sol/IPendlePreviewHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateLP.sol/IStargateLP.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateStaking.sol/IStargateStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISwETH.sol/ISwETH.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ISwETH.sol/ISwETH.json +44 -0
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaFactory.sol/IThenaFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaGaugeV2.sol/IThenaGaugeV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaPair.sol/IThenaPair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaRouter.sol/IThenaRouter.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PtAndLpToAsset.sol/PtAndLpToAsset.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendlePtUsdChainlinkOracle.sol/PendlePtUsdChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.json +160 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +18 -2
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.json +76 -118
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberInputScalingHelper.sol/KyberInputScalingHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol/ScalingDataLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol/ScalingDataLib.json +2 -2
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol +147 -0
- package/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol +1 -9
- package/contracts/oracles/PendleLpOracleLib.sol +21 -40
- package/contracts/oracles/PendlePtOracleLib.sol +33 -28
- package/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol +110 -118
- package/contracts/router/swap-aggregator/kyberswap/KyberInputScalingHelper.sol +22 -21
- package/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol +22 -2
- package/deployments/1-core.json +4 -3
- package/deployments/1-markets/SWETH-DEC2024.json +12 -0
- package/deployments/42161-core.json +4 -3
- package/deployments/42161-markets/WSTETH-ARBITRUM-DEC2023.json +10 -0
- package/deployments/56-core.json +2 -2
- package/package.json +1 -1
- package/typechain-types/BotActionCallback.ts +900 -0
- package/typechain-types/BotActionHelper.ts +950 -0
- package/typechain-types/BotDecisionHelper.ts +561 -0
- package/typechain-types/BotDecisionHelperBase.ts +484 -0
- package/typechain-types/BotDecisionLib.ts +335 -0
- package/typechain-types/{PendleCamelotV1RouterHelper.ts → CamelotV1LpHelper.ts} +75 -5
- package/typechain-types/{CamelotV1PreviewHelper.ts → CamelotV1Preview.ts} +23 -63
- package/typechain-types/IAnkrBNB.ts +150 -0
- package/typechain-types/IAnkrLiquidStaking.ts +253 -0
- package/typechain-types/IBotDecisionHelper.ts +452 -0
- package/typechain-types/ICamelotSY.ts +100 -0
- package/typechain-types/IExecutorHelper.ts +310 -331
- package/typechain-types/ILongYieldDecisionHelper.ts +486 -0
- package/typechain-types/ILongYieldTradingBot.ts +878 -0
- package/typechain-types/IPExternalRewardDistributor.ts +192 -0
- package/typechain-types/IPMarketFactoryV2.ts +253 -0
- package/typechain-types/IShortYieldDecisionHelper.ts +452 -0
- package/typechain-types/IShortYieldTradingBot.ts +770 -0
- package/typechain-types/ISwETH.ts +123 -0
- package/typechain-types/ITradingBotBase.ts +569 -0
- package/typechain-types/LongYieldActionHelper.ts +900 -0
- package/typechain-types/LongYieldDecisionHelper.ts +601 -0
- package/typechain-types/LongYieldTradingBot.ts +1364 -0
- package/typechain-types/MarketExtLib.ts +81 -0
- package/typechain-types/PendleAnkrBNBSY.ts +1235 -0
- package/typechain-types/PendleAuraWethVethSY.ts +1511 -0
- package/typechain-types/PendleAuraWstethAnkreth.ts +1511 -0
- package/typechain-types/PendleBinanceEth.ts +1229 -0
- package/typechain-types/PendleCamelotV1SY.ts +245 -0
- package/typechain-types/PendleExternalRewardDistributor.ts +546 -0
- package/typechain-types/PendleGaugeV2.ts +225 -0
- package/typechain-types/PendleMarketFactoryV2.ts +930 -0
- package/typechain-types/PendleMarketV2.ts +1311 -0
- package/typechain-types/PendleSwETH.ts +1216 -0
- package/typechain-types/ShortYieldActionHelper.ts +856 -0
- package/typechain-types/ShortYieldDecisionHelper.ts +601 -0
- package/typechain-types/ShortYieldTradingBot.ts +1212 -0
- package/typechain-types/SwETHSY.ts +1216 -0
- package/typechain-types/TradingBotBase.ts +856 -0
- package/typechain-types/TradingBotOffchain.ts +568 -0
- package/typechain-types/factories/BotActionCallback__factory.ts +830 -0
- package/typechain-types/factories/BotActionHelper__factory.ts +947 -0
- package/typechain-types/factories/BotDecisionHelperBase__factory.ts +808 -0
- package/typechain-types/factories/BotDecisionHelper__factory.ts +1192 -0
- package/typechain-types/factories/BotDecisionLib__factory.ts +642 -0
- package/typechain-types/factories/{PendleCamelotV1RouterHelper__factory.ts → CamelotV1LpHelper__factory.ts} +60 -12
- package/typechain-types/factories/CamelotV1Preview__factory.ts +309 -0
- package/typechain-types/factories/IAnkrBNB__factory.ts +74 -0
- package/typechain-types/factories/IAnkrLiquidStaking__factory.ts +123 -0
- package/typechain-types/factories/IBotDecisionHelper__factory.ts +667 -0
- package/typechain-types/factories/ICamelotSY__factory.ts +49 -0
- package/typechain-types/factories/IExecutorHelper__factory.ts +74 -116
- package/typechain-types/factories/ILongYieldDecisionHelper__factory.ts +690 -0
- package/typechain-types/factories/ILongYieldTradingBot__factory.ts +996 -0
- package/typechain-types/factories/IPExternalRewardDistributor__factory.ts +128 -0
- package/typechain-types/factories/IPMarketFactoryV2__factory.ts +181 -0
- package/typechain-types/factories/IShortYieldDecisionHelper__factory.ts +671 -0
- package/typechain-types/factories/IShortYieldTradingBot__factory.ts +977 -0
- package/typechain-types/factories/ISwETH__factory.ts +53 -0
- package/typechain-types/factories/ITradingBotBase__factory.ts +530 -0
- package/typechain-types/factories/LongYieldActionHelper__factory.ts +834 -0
- package/typechain-types/factories/LongYieldDecisionHelper__factory.ts +1272 -0
- package/typechain-types/factories/LongYieldTradingBot__factory.ts +1637 -0
- package/typechain-types/factories/MarketExtLib__factory.ts +74 -0
- package/typechain-types/factories/PendleAnkrBNBSY__factory.ts +1100 -0
- package/typechain-types/factories/PendleAuraWethVethSY__factory.ts +1231 -0
- package/typechain-types/factories/PendleAuraWstethAnkreth__factory.ts +1244 -0
- package/typechain-types/factories/PendleBinanceEth__factory.ts +1052 -0
- package/typechain-types/factories/PendleCamelotV1SY__factory.ts +156 -9
- package/typechain-types/factories/PendleExternalRewardDistributor__factory.ts +414 -0
- package/typechain-types/factories/PendleGaugeV2__factory.ts +140 -0
- package/typechain-types/factories/PendleLpGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactoryV2__factory.ts +770 -0
- package/typechain-types/factories/PendleMarketV2__factory.ts +1290 -0
- package/typechain-types/factories/PendlePtGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePtOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleSwETH__factory.ts +1022 -0
- package/typechain-types/factories/PendleSwap__factory.ts +17 -1
- package/typechain-types/factories/ShortYieldActionHelper__factory.ts +784 -0
- package/typechain-types/factories/ShortYieldDecisionHelper__factory.ts +1272 -0
- package/typechain-types/factories/ShortYieldTradingBot__factory.ts +1445 -0
- package/typechain-types/factories/SwETHSY__factory.ts +1022 -0
- package/typechain-types/factories/TradingBotBase__factory.ts +780 -0
- package/typechain-types/factories/TradingBotOffchain__factory.ts +1133 -0
- package/typechain-types/hardhat.d.ts +216 -0
- package/typechain-types/index.ts +48 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IHashflow.sol/IHashflow.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IHashflow.sol/IHashflow.json +0 -101
- package/contracts/router/swap-aggregator/kyberswap/IHashflow.sol +0 -30
- package/typechain-types/IPVotingEscrowSidechain.ts +0 -155
- package/typechain-types/PendleCamelotRewardHelper.ts +0 -347
- package/typechain-types/factories/CamelotV1PreviewHelper__factory.ts +0 -400
- package/typechain-types/factories/IPVotingEscrowSidechain__factory.ts +0 -112
- package/typechain-types/factories/PendleCamelotRewardHelper__factory.ts +0 -317
- /package/deployments/1-markets/{APE-JUNE-29.json → deprecated/APE-JUNE-29.json} +0 -0
- /package/deployments/1-markets/{STETH-JUNE29.json → deprecated/STETH-JUNE29.json} +0 -0
|
@@ -3,34 +3,42 @@ pragma solidity 0.8.17;
|
|
|
3
3
|
|
|
4
4
|
import "./PendlePtOracleLib.sol";
|
|
5
5
|
|
|
6
|
-
// Reference: https://file.notion.so/f/s/15d1406b-0d81-41a4-8ac3-9b56e30fdf50/LP_Oracle_Doc.pdf?id=201fc56f-959b-4836-9511-73852e166816&table=block&spaceId=33abd05a-56a2-4ce6-8673-929c5984a0fd&expirationTimestamp=1683863581610&signature=IY3jlxvXkWRJZhsccYpQdQaKlm1_NUIb1ypDmuaR7hI&downloadName=LP_Oracle_Doc.pdf
|
|
7
|
-
|
|
8
6
|
library PendleLpOracleLib {
|
|
9
7
|
using PendlePtOracleLib for IPMarket;
|
|
10
|
-
using PYIndexLib for PYIndex;
|
|
11
8
|
using Math for uint256;
|
|
12
9
|
using Math for int256;
|
|
13
10
|
using MarketMathCore for MarketState;
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
|
-
|
|
13
|
+
* This function returns the approximated twap rate LP/asset on market, but take into account the current rate of SY
|
|
14
|
+
This is to account for special cases where underlying asset becomes insolvent and has decreasing exchangeRate
|
|
17
15
|
* @param market market to get rate from
|
|
18
16
|
* @param duration twap duration
|
|
19
|
-
*
|
|
20
17
|
*/
|
|
21
|
-
function getLpToAssetRate(
|
|
18
|
+
function getLpToAssetRate(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
19
|
+
(uint256 syIndex, uint256 pyIndex) = PendlePtOracleLib.getSYandPYIndexCurrent(market);
|
|
20
|
+
uint256 lpToAssetRateRaw = _getLpToAssetRateRaw(market, duration, pyIndex);
|
|
21
|
+
return (lpToAssetRateRaw * syIndex) / pyIndex;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _getLpToAssetRateRaw(
|
|
22
25
|
IPMarket market,
|
|
23
|
-
uint32 duration
|
|
24
|
-
|
|
26
|
+
uint32 duration,
|
|
27
|
+
uint256 pyIndex
|
|
28
|
+
) private view returns (uint256 lpToAssetRateRaw) {
|
|
25
29
|
MarketState memory state = market.readState(address(0));
|
|
26
|
-
|
|
30
|
+
|
|
31
|
+
MarketPreCompute memory comp = state.getMarketPreCompute(
|
|
32
|
+
PYIndex.wrap(pyIndex),
|
|
33
|
+
block.timestamp
|
|
34
|
+
);
|
|
27
35
|
|
|
28
36
|
int256 totalHypotheticalAsset;
|
|
29
37
|
if (state.expiry <= block.timestamp) {
|
|
30
38
|
// 1 PT = 1 Asset post-expiry
|
|
31
39
|
totalHypotheticalAsset = state.totalPt + comp.totalAsset;
|
|
32
40
|
} else {
|
|
33
|
-
(int256 rateOracle, int256 rateHypTrade) =
|
|
41
|
+
(int256 rateOracle, int256 rateHypTrade) = _getPtRatesRaw(market, state, duration);
|
|
34
42
|
int256 cParam = LogExpMath.exp(
|
|
35
43
|
comp.rateScalar.mulDown((rateOracle - comp.rateAnchor))
|
|
36
44
|
);
|
|
@@ -45,46 +53,19 @@ library PendleLpOracleLib {
|
|
|
45
53
|
(state.totalPt + tradeSize).divDown(rateOracle);
|
|
46
54
|
}
|
|
47
55
|
|
|
48
|
-
|
|
56
|
+
lpToAssetRateRaw = totalHypotheticalAsset.divDown(state.totalLp).Uint();
|
|
49
57
|
}
|
|
50
58
|
|
|
51
|
-
function
|
|
52
|
-
IPMarket market,
|
|
53
|
-
MarketState memory state
|
|
54
|
-
) private view returns (MarketPreCompute memory) {
|
|
55
|
-
return state.getMarketPreCompute(_getPYIndexCurrent(market), block.timestamp);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _getPYIndexCurrent(IPMarket market) private view returns (PYIndex) {
|
|
59
|
-
(IStandardizedYield SY, , IPYieldToken YT) = market.readTokens();
|
|
60
|
-
uint256 ytIndex = YT.pyIndexStored();
|
|
61
|
-
uint256 pyIndexCurrent;
|
|
62
|
-
if (YT.doCacheIndexSameBlock() && YT.pyIndexLastUpdatedBlock() == block.number) {
|
|
63
|
-
pyIndexCurrent = ytIndex;
|
|
64
|
-
} else {
|
|
65
|
-
uint256 syIndex = SY.exchangeRate();
|
|
66
|
-
pyIndexCurrent = Math.max(syIndex, ytIndex);
|
|
67
|
-
}
|
|
68
|
-
return PYIndex.wrap(pyIndexCurrent);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function _getPtRates(
|
|
59
|
+
function _getPtRatesRaw(
|
|
72
60
|
IPMarket market,
|
|
73
61
|
MarketState memory state,
|
|
74
62
|
uint32 duration
|
|
75
63
|
) private view returns (int256 rateOracle, int256 rateHypTrade) {
|
|
76
|
-
rateOracle = Math.IONE.divDown(market.
|
|
64
|
+
rateOracle = Math.IONE.divDown(market.getPtToAssetRateRaw(duration).Int());
|
|
77
65
|
int256 rateLastTrade = MarketMathCore._getExchangeRateFromImpliedRate(
|
|
78
66
|
state.lastLnImpliedRate,
|
|
79
67
|
state.expiry - block.timestamp
|
|
80
68
|
);
|
|
81
69
|
rateHypTrade = (rateLastTrade + rateOracle) / 2;
|
|
82
70
|
}
|
|
83
|
-
|
|
84
|
-
function _calcLpPrice(
|
|
85
|
-
int256 totalHypotheticalAsset,
|
|
86
|
-
int256 totalLp
|
|
87
|
-
) private pure returns (int256) {
|
|
88
|
-
return totalHypotheticalAsset.divDown(totalLp);
|
|
89
|
-
}
|
|
90
71
|
}
|
|
@@ -6,28 +6,48 @@ import "../core/libraries/math/Math.sol";
|
|
|
6
6
|
|
|
7
7
|
library PendlePtOracleLib {
|
|
8
8
|
using Math for uint256;
|
|
9
|
+
using Math for int256;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
|
-
* This function returns the twap rate PT/Asset on market
|
|
12
|
+
* This function returns the twap rate PT/Asset on market, but take into account the current rate of SY
|
|
13
|
+
This is to account for special cases where underlying asset becomes insolvent and has decreasing exchangeRate
|
|
12
14
|
* @param market market to get rate from
|
|
13
15
|
* @param duration twap duration
|
|
14
16
|
*/
|
|
15
|
-
function getPtToAssetRate(IPMarket market, uint32 duration)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function getPtToAssetRate(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
18
|
+
(uint256 syIndex, uint256 pyIndex) = getSYandPYIndexCurrent(market);
|
|
19
|
+
return (getPtToAssetRateRaw(market,duration) * syIndex) / pyIndex;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getPtToAssetRateRaw(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
20
23
|
uint256 expiry = market.expiry();
|
|
24
|
+
|
|
21
25
|
if (expiry <= block.timestamp) {
|
|
22
|
-
return
|
|
26
|
+
return Math.ONE;
|
|
27
|
+
} else {
|
|
28
|
+
uint256 lnImpliedRate = _getMarketLnImpliedRate(market, duration);
|
|
29
|
+
uint256 timeToExpiry = expiry - block.timestamp;
|
|
30
|
+
uint256 assetToPtRate =
|
|
31
|
+
MarketMathCore._getExchangeRateFromImpliedRate(lnImpliedRate, timeToExpiry).Uint();
|
|
32
|
+
return Math.ONE.divDown(assetToPtRate);
|
|
23
33
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getSYandPYIndexCurrent(IPMarket market)
|
|
37
|
+
internal
|
|
38
|
+
view
|
|
39
|
+
returns (uint256 syIndex, uint256 pyIndex)
|
|
40
|
+
{
|
|
41
|
+
(IStandardizedYield SY, , IPYieldToken YT) = market.readTokens();
|
|
29
42
|
|
|
30
|
-
|
|
43
|
+
syIndex = SY.exchangeRate();
|
|
44
|
+
uint256 pyIndexStored = YT.pyIndexStored();
|
|
45
|
+
|
|
46
|
+
if (YT.doCacheIndexSameBlock() && YT.pyIndexLastUpdatedBlock() == block.number) {
|
|
47
|
+
pyIndex = pyIndexStored;
|
|
48
|
+
} else {
|
|
49
|
+
pyIndex = Math.max(syIndex, pyIndexStored);
|
|
50
|
+
}
|
|
31
51
|
}
|
|
32
52
|
|
|
33
53
|
function _getMarketLnImpliedRate(IPMarket market, uint32 duration)
|
|
@@ -41,19 +61,4 @@ library PendlePtOracleLib {
|
|
|
41
61
|
uint216[] memory lnImpliedRateCumulative = market.observe(durations);
|
|
42
62
|
return (lnImpliedRateCumulative[1] - lnImpliedRateCumulative[0]) / duration;
|
|
43
63
|
}
|
|
44
|
-
|
|
45
|
-
function _getPtToAssetRatePostExpiry(IPMarket market) private view returns (uint256) {
|
|
46
|
-
(IStandardizedYield SY, , IPYieldToken YT) = market.readTokens();
|
|
47
|
-
|
|
48
|
-
uint256 syIndex = SY.exchangeRate();
|
|
49
|
-
uint256 pyIndexCurrent;
|
|
50
|
-
|
|
51
|
-
if (YT.doCacheIndexSameBlock() && YT.pyIndexLastUpdatedBlock() == block.number) {
|
|
52
|
-
pyIndexCurrent = YT.pyIndexStored();
|
|
53
|
-
} else {
|
|
54
|
-
pyIndexCurrent = Math.max(syIndex, YT.pyIndexStored());
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return syIndex.divDown(pyIndexCurrent);
|
|
58
|
-
}
|
|
59
64
|
}
|
|
@@ -23,7 +23,6 @@ interface IExecutorHelper {
|
|
|
23
23
|
address tokenOut;
|
|
24
24
|
address recipient;
|
|
25
25
|
uint256 collectAmount; // amount that should be transferred to the pool
|
|
26
|
-
uint256 limitReturnAmount;
|
|
27
26
|
uint32 swapFee;
|
|
28
27
|
uint32 feePrecision;
|
|
29
28
|
uint32 tokenWeightInput;
|
|
@@ -36,7 +35,6 @@ interface IExecutorHelper {
|
|
|
36
35
|
uint8 tokenIndexFrom;
|
|
37
36
|
uint8 tokenIndexTo;
|
|
38
37
|
uint256 dx;
|
|
39
|
-
uint256 minDy;
|
|
40
38
|
uint256 poolLength;
|
|
41
39
|
address poolLp;
|
|
42
40
|
bool isSaddle; // true: saddle, false: stable
|
|
@@ -49,20 +47,18 @@ interface IExecutorHelper {
|
|
|
49
47
|
int128 tokenIndexFrom;
|
|
50
48
|
int128 tokenIndexTo;
|
|
51
49
|
uint256 dx;
|
|
52
|
-
uint256 minDy;
|
|
53
50
|
bool usePoolUnderlying;
|
|
54
51
|
bool useTriCrypto;
|
|
55
52
|
}
|
|
56
53
|
|
|
57
|
-
struct
|
|
54
|
+
struct UniswapV3KSElastic {
|
|
58
55
|
address recipient;
|
|
59
56
|
address pool;
|
|
60
57
|
address tokenIn;
|
|
61
58
|
address tokenOut;
|
|
62
59
|
uint256 swapAmount;
|
|
63
|
-
uint256 limitReturnAmount;
|
|
64
60
|
uint160 sqrtPriceLimitX96;
|
|
65
|
-
bool isUniV3; // true = UniV3, false =
|
|
61
|
+
bool isUniV3; // true = UniV3, false = KSElastic
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
struct BalancerV2 {
|
|
@@ -71,7 +67,6 @@ interface IExecutorHelper {
|
|
|
71
67
|
address assetIn;
|
|
72
68
|
address assetOut;
|
|
73
69
|
uint256 amount;
|
|
74
|
-
uint256 limit;
|
|
75
70
|
}
|
|
76
71
|
|
|
77
72
|
struct DODO {
|
|
@@ -80,7 +75,6 @@ interface IExecutorHelper {
|
|
|
80
75
|
address tokenFrom;
|
|
81
76
|
address tokenTo;
|
|
82
77
|
uint256 amount;
|
|
83
|
-
uint256 minReceiveQuote;
|
|
84
78
|
address sellHelper;
|
|
85
79
|
bool isSellBase;
|
|
86
80
|
bool isVersion2;
|
|
@@ -91,7 +85,6 @@ interface IExecutorHelper {
|
|
|
91
85
|
address tokenIn;
|
|
92
86
|
address tokenOut;
|
|
93
87
|
uint256 amount;
|
|
94
|
-
uint256 minOut;
|
|
95
88
|
address receiver;
|
|
96
89
|
}
|
|
97
90
|
|
|
@@ -102,7 +95,6 @@ interface IExecutorHelper {
|
|
|
102
95
|
bytes32 sourceCurrencyKey;
|
|
103
96
|
uint256 sourceAmount;
|
|
104
97
|
bytes32 destinationCurrencyKey;
|
|
105
|
-
uint256 minAmount;
|
|
106
98
|
bool useAtomicExchange;
|
|
107
99
|
}
|
|
108
100
|
|
|
@@ -112,7 +104,6 @@ interface IExecutorHelper {
|
|
|
112
104
|
address tokenOut;
|
|
113
105
|
address recipient;
|
|
114
106
|
uint256 collectAmount; // amount that should be transferred to the pool
|
|
115
|
-
uint256 limitReturnAmount;
|
|
116
107
|
}
|
|
117
108
|
|
|
118
109
|
struct PSM {
|
|
@@ -129,111 +120,112 @@ interface IExecutorHelper {
|
|
|
129
120
|
bool isWrapping;
|
|
130
121
|
}
|
|
131
122
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
function
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
uint256
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
uint256
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
uint256
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
uint256
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
uint256
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
uint256
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
123
|
+
struct Maverick {
|
|
124
|
+
address pool;
|
|
125
|
+
address tokenIn;
|
|
126
|
+
address tokenOut;
|
|
127
|
+
address recipient;
|
|
128
|
+
uint256 swapAmount;
|
|
129
|
+
uint256 sqrtPriceLimitD18;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function executeUniswap(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
133
|
+
external
|
|
134
|
+
payable
|
|
135
|
+
returns (uint256);
|
|
136
|
+
|
|
137
|
+
function executeStableSwap(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
138
|
+
external
|
|
139
|
+
payable
|
|
140
|
+
returns (uint256);
|
|
141
|
+
|
|
142
|
+
function executeCurve(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
143
|
+
external
|
|
144
|
+
payable
|
|
145
|
+
returns (uint256);
|
|
146
|
+
|
|
147
|
+
function executeKSClassic(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
148
|
+
external
|
|
149
|
+
payable
|
|
150
|
+
returns (uint256);
|
|
151
|
+
|
|
152
|
+
function executeUniV3KSElastic(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
153
|
+
external
|
|
154
|
+
payable
|
|
155
|
+
returns (uint256);
|
|
156
|
+
|
|
157
|
+
function executeRfq(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
158
|
+
external
|
|
159
|
+
payable
|
|
160
|
+
returns (uint256);
|
|
161
|
+
|
|
162
|
+
function executeBalV2(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
163
|
+
external
|
|
164
|
+
payable
|
|
165
|
+
returns (uint256);
|
|
166
|
+
|
|
167
|
+
function executeDODO(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
168
|
+
external
|
|
169
|
+
payable
|
|
170
|
+
returns (uint256);
|
|
171
|
+
|
|
172
|
+
function executeVelodrome(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
173
|
+
external
|
|
174
|
+
payable
|
|
175
|
+
returns (uint256);
|
|
176
|
+
|
|
177
|
+
function executeGMX(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
178
|
+
external
|
|
179
|
+
payable
|
|
180
|
+
returns (uint256);
|
|
181
|
+
|
|
182
|
+
function executePlatypus(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
183
|
+
external
|
|
184
|
+
payable
|
|
185
|
+
returns (uint256);
|
|
186
|
+
|
|
187
|
+
function executeWrappedstETH(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
188
|
+
external
|
|
189
|
+
payable
|
|
190
|
+
returns (uint256);
|
|
191
|
+
|
|
192
|
+
function executeStEth(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
193
|
+
external
|
|
194
|
+
payable
|
|
195
|
+
returns (uint256);
|
|
196
|
+
|
|
197
|
+
function executeSynthetix(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
198
|
+
external
|
|
199
|
+
payable
|
|
200
|
+
returns (uint256);
|
|
201
|
+
|
|
202
|
+
function executeHashflow(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
203
|
+
external
|
|
204
|
+
payable
|
|
205
|
+
returns (uint256);
|
|
206
|
+
|
|
207
|
+
function executePSM(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
208
|
+
external
|
|
209
|
+
payable
|
|
210
|
+
returns (uint256);
|
|
211
|
+
|
|
212
|
+
function executeFrax(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
213
|
+
external
|
|
214
|
+
payable
|
|
215
|
+
returns (uint256);
|
|
216
|
+
|
|
217
|
+
function executeCamelot(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
218
|
+
external
|
|
219
|
+
payable
|
|
220
|
+
returns (uint256);
|
|
221
|
+
|
|
222
|
+
function executeKyberLimitOrder(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
223
|
+
external
|
|
224
|
+
payable
|
|
225
|
+
returns (uint256);
|
|
226
|
+
|
|
227
|
+
function executeMaverick(bytes memory data, uint256 flagsAndPrevAmountOut)
|
|
228
|
+
external
|
|
229
|
+
payable
|
|
230
|
+
returns (uint256);
|
|
239
231
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
pragma solidity 0.8.17;
|
|
4
4
|
import "./IMetaAggregationRouterV2.sol";
|
|
5
|
-
import "./IHashflow.sol";
|
|
6
5
|
import "./IExecutorHelper.sol";
|
|
7
6
|
import "./ScalingDataLib.sol";
|
|
8
7
|
|
|
@@ -22,7 +21,7 @@ abstract contract KyberInputScalingHelper {
|
|
|
22
21
|
|
|
23
22
|
struct Swap {
|
|
24
23
|
bytes data;
|
|
25
|
-
|
|
24
|
+
bytes32 selectorAndFlags; // [selector (32 bits) + flags (224 bits)]; selector is 4 most significant bytes; flags are stored in 4 least significant bytes.
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
struct SimpleSwapData {
|
|
@@ -37,7 +36,6 @@ abstract contract KyberInputScalingHelper {
|
|
|
37
36
|
Swap[][] swapSequences;
|
|
38
37
|
address tokenIn;
|
|
39
38
|
address tokenOut;
|
|
40
|
-
uint256 minTotalAmountOut;
|
|
41
39
|
address to;
|
|
42
40
|
uint256 deadline;
|
|
43
41
|
bytes positiveSlippageData;
|
|
@@ -156,7 +154,6 @@ abstract contract KyberInputScalingHelper {
|
|
|
156
154
|
uint256 newAmount
|
|
157
155
|
) internal pure returns (bytes memory) {
|
|
158
156
|
SwapExecutorDescription memory executorDesc = abi.decode(data, (SwapExecutorDescription));
|
|
159
|
-
executorDesc.minTotalAmountOut = (executorDesc.minTotalAmountOut * newAmount) / oldAmount;
|
|
160
157
|
executorDesc.positiveSlippageData = _scaledPositiveSlippageFeeData(
|
|
161
158
|
executorDesc.positiveSlippageData,
|
|
162
159
|
oldAmount,
|
|
@@ -166,44 +163,48 @@ abstract contract KyberInputScalingHelper {
|
|
|
166
163
|
uint256 nSequences = executorDesc.swapSequences.length;
|
|
167
164
|
for (uint256 i = 0; i < nSequences; ) {
|
|
168
165
|
Swap memory swap = executorDesc.swapSequences[i][0];
|
|
169
|
-
bytes4 functionSelector = swap.
|
|
166
|
+
bytes4 functionSelector = bytes4(swap.selectorAndFlags);
|
|
170
167
|
|
|
171
|
-
if (functionSelector == IExecutorHelper.
|
|
168
|
+
if (functionSelector == IExecutorHelper.executeUniswap.selector) {
|
|
172
169
|
swap.data = ScalingDataLib.newUniSwap(swap.data, oldAmount, newAmount);
|
|
173
170
|
} else if (functionSelector == IExecutorHelper.executeStableSwap.selector) {
|
|
174
171
|
swap.data = ScalingDataLib.newStableSwap(swap.data, oldAmount, newAmount);
|
|
175
|
-
} else if (functionSelector == IExecutorHelper.
|
|
172
|
+
} else if (functionSelector == IExecutorHelper.executeCurve.selector) {
|
|
176
173
|
swap.data = ScalingDataLib.newCurveSwap(swap.data, oldAmount, newAmount);
|
|
177
|
-
} else if (functionSelector == IExecutorHelper.
|
|
174
|
+
} else if (functionSelector == IExecutorHelper.executeKSClassic.selector) {
|
|
178
175
|
swap.data = ScalingDataLib.newKyberDMM(swap.data, oldAmount, newAmount);
|
|
179
|
-
} else if (functionSelector == IExecutorHelper.
|
|
176
|
+
} else if (functionSelector == IExecutorHelper.executeUniV3KSElastic.selector) {
|
|
180
177
|
swap.data = ScalingDataLib.newUniV3ProMM(swap.data, oldAmount, newAmount);
|
|
181
|
-
} else if (functionSelector == IExecutorHelper.
|
|
178
|
+
} else if (functionSelector == IExecutorHelper.executeRfq.selector) {
|
|
182
179
|
revert("InputScalingHelper: Can not scale RFQ swap");
|
|
183
|
-
} else if (functionSelector == IExecutorHelper.
|
|
180
|
+
} else if (functionSelector == IExecutorHelper.executeBalV2.selector) {
|
|
184
181
|
swap.data = ScalingDataLib.newBalancerV2(swap.data, oldAmount, newAmount);
|
|
185
|
-
} else if (functionSelector == IExecutorHelper.
|
|
182
|
+
} else if (functionSelector == IExecutorHelper.executeWrappedstETH.selector) {
|
|
186
183
|
swap.data = ScalingDataLib.newWrappedstETHSwap(swap.data, oldAmount, newAmount);
|
|
187
|
-
} else if (functionSelector == IExecutorHelper.
|
|
184
|
+
} else if (functionSelector == IExecutorHelper.executeStEth.selector) {
|
|
185
|
+
swap.data = ScalingDataLib.newStETHSwap(swap.data, oldAmount, newAmount);
|
|
186
|
+
} else if (functionSelector == IExecutorHelper.executeDODO.selector) {
|
|
188
187
|
swap.data = ScalingDataLib.newDODO(swap.data, oldAmount, newAmount);
|
|
189
|
-
} else if (functionSelector == IExecutorHelper.
|
|
188
|
+
} else if (functionSelector == IExecutorHelper.executeVelodrome.selector) {
|
|
190
189
|
swap.data = ScalingDataLib.newVelodrome(swap.data, oldAmount, newAmount);
|
|
191
|
-
} else if (functionSelector == IExecutorHelper.
|
|
190
|
+
} else if (functionSelector == IExecutorHelper.executeGMX.selector) {
|
|
192
191
|
swap.data = ScalingDataLib.newGMX(swap.data, oldAmount, newAmount);
|
|
193
|
-
} else if (functionSelector == IExecutorHelper.
|
|
192
|
+
} else if (functionSelector == IExecutorHelper.executeSynthetix.selector) {
|
|
194
193
|
swap.data = ScalingDataLib.newSynthetix(swap.data, oldAmount, newAmount);
|
|
195
|
-
} else if (functionSelector == IExecutorHelper.
|
|
194
|
+
} else if (functionSelector == IExecutorHelper.executeHashflow.selector) {
|
|
196
195
|
revert("InputScalingHelper: Can not scale RFQ swap");
|
|
197
|
-
} else if (functionSelector == IExecutorHelper.
|
|
196
|
+
} else if (functionSelector == IExecutorHelper.executeCamelot.selector) {
|
|
198
197
|
swap.data = ScalingDataLib.newCamelot(swap.data, oldAmount, newAmount);
|
|
199
198
|
} else if (functionSelector == IExecutorHelper.executeKyberLimitOrder.selector) {
|
|
200
199
|
revert("InputScalingHelper: Can not scale RFQ swap");
|
|
201
|
-
} else if (functionSelector == IExecutorHelper.
|
|
200
|
+
} else if (functionSelector == IExecutorHelper.executePSM.selector) {
|
|
202
201
|
swap.data = ScalingDataLib.newPSM(swap.data, oldAmount, newAmount);
|
|
203
|
-
} else if (functionSelector == IExecutorHelper.
|
|
202
|
+
} else if (functionSelector == IExecutorHelper.executeFrax.selector) {
|
|
204
203
|
swap.data = ScalingDataLib.newFrax(swap.data, oldAmount, newAmount);
|
|
205
|
-
} else if (functionSelector == IExecutorHelper.
|
|
204
|
+
} else if (functionSelector == IExecutorHelper.executePlatypus.selector) {
|
|
206
205
|
swap.data = ScalingDataLib.newPlatypus(swap.data, oldAmount, newAmount);
|
|
206
|
+
} else if (functionSelector == IExecutorHelper.executeMaverick.selector) {
|
|
207
|
+
swap.data = ScalingDataLib.newMaverick(swap.data, oldAmount, newAmount);
|
|
207
208
|
} else revert("AggregationExecutor: Dex type not supported");
|
|
208
209
|
unchecked {
|
|
209
210
|
++i;
|
|
@@ -52,9 +52,9 @@ library ScalingDataLib {
|
|
|
52
52
|
uint256 oldAmount,
|
|
53
53
|
uint256 newAmount
|
|
54
54
|
) internal pure returns (bytes memory) {
|
|
55
|
-
IExecutorHelper.
|
|
55
|
+
IExecutorHelper.UniswapV3KSElastic memory uniSwapV3ProMM = abi.decode(
|
|
56
56
|
data,
|
|
57
|
-
(IExecutorHelper.
|
|
57
|
+
(IExecutorHelper.UniswapV3KSElastic)
|
|
58
58
|
);
|
|
59
59
|
uniSwapV3ProMM.swapAmount = (uniSwapV3ProMM.swapAmount * newAmount) / oldAmount;
|
|
60
60
|
|
|
@@ -163,4 +163,24 @@ library ScalingDataLib {
|
|
|
163
163
|
frax.collectAmount = (frax.collectAmount * newAmount) / oldAmount;
|
|
164
164
|
return abi.encode(frax);
|
|
165
165
|
}
|
|
166
|
+
|
|
167
|
+
function newStETHSwap(
|
|
168
|
+
bytes memory data,
|
|
169
|
+
uint256 oldAmount,
|
|
170
|
+
uint256 newAmount
|
|
171
|
+
) internal pure returns (bytes memory) {
|
|
172
|
+
uint256 amount = abi.decode(data, (uint256));
|
|
173
|
+
amount = (amount * newAmount) / oldAmount;
|
|
174
|
+
return abi.encode(amount);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function newMaverick(
|
|
178
|
+
bytes memory data,
|
|
179
|
+
uint256 oldAmount,
|
|
180
|
+
uint256 newAmount
|
|
181
|
+
) internal pure returns (bytes memory) {
|
|
182
|
+
IExecutorHelper.Maverick memory maverick = abi.decode(data, (IExecutorHelper.Maverick));
|
|
183
|
+
maverick.swapAmount = (maverick.swapAmount * newAmount) / oldAmount;
|
|
184
|
+
return abi.encode(maverick);
|
|
185
|
+
}
|
|
166
186
|
}
|
package/deployments/1-core.json
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"initialFeeRateRoot": "999500333083533",
|
|
13
13
|
"initialReserveFeePercent": "80",
|
|
14
14
|
"initialPendlePerSec": "826719576719576719",
|
|
15
|
-
"safeWaitTime": 15000
|
|
15
|
+
"safeWaitTime": 15000,
|
|
16
|
+
"sySwapper": "0xd965c925Fd933029F8e5b7AD0C13bC875a026b09"
|
|
16
17
|
},
|
|
17
18
|
"baseCodeSplitter": "0x35878C2Cff38cC4032E85283183428170BA618A2",
|
|
18
19
|
"PENDLE": "0x808507121b80c02388fad14726482e061b8da827",
|
|
@@ -22,9 +23,9 @@
|
|
|
22
23
|
"bulkSellerOffchain": "0x9ACc60F915dFcd190D270fc92567aE71776bd320",
|
|
23
24
|
"router": "0x0000000001e4ef00d069e71d6ba041b0a16f7ea0",
|
|
24
25
|
"routerStatic": "0x263833d47eA3fA4a30f269323aba6a107f9eB14C",
|
|
25
|
-
"pendleSwap": "
|
|
26
|
+
"pendleSwap": "0x10115a984d69b0a832239a26d1841f10a59e45d8",
|
|
26
27
|
"routerHelper": "0x462206b11d185ef6F64B41D344325401C37EC335",
|
|
27
|
-
"ptOracle": "
|
|
28
|
+
"ptOracle": "0x14030836AEc15B2ad48bB097bd57032559339c92",
|
|
28
29
|
"vePendle": "0x4f30A9D41B80ecC5B94306AB4364951AE3170210",
|
|
29
30
|
"senderEndpoint": "0x07b1014c88f14C9E910092526db57A20052E989F",
|
|
30
31
|
"votingController": "0x44087E105137a5095c008AaB6a6530182821F2F0",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY swETH",
|
|
3
|
+
"symbol": "SY-swETH",
|
|
4
|
+
"expiry": 1735171200,
|
|
5
|
+
"scalarRoot": "71979373279000000000",
|
|
6
|
+
"initialRateAnchor": "1058544507000000000",
|
|
7
|
+
"doCacheIndex": true,
|
|
8
|
+
"SY": "0xaa68CA9C69a4ff22203cE189Ce4448d7401875E8",
|
|
9
|
+
"PT": "0x330c4DD05dB16db6323505262C57CFdE5f0A78Ea",
|
|
10
|
+
"YT": "0x3199c7c3c972a8da5F9faD2A838383f827b735F1",
|
|
11
|
+
"market": "0x0e1C5509B503358eA1Dac119C1D413e28Cc4b303"
|
|
12
|
+
}
|