@pendle/core-v2 1.3.0-mainnet → 1.3.0-testnet
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/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- 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/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- 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/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +3 -3
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.json +39 -0
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +3 -3
- 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/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- 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/BulkSeller.sol/BulkSeller.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- 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/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- 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/PYIndex.sol/PYIndexLib.json +2 -2
- 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/SYUtils.sol/SYUtils.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +1 -41
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSY.sol/PendleAuraWethAnkrethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSY.sol/PendleAuraWethAnkrethSY.json +1192 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +2 -41
- 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/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +2 -2
- 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/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.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/StablePoolUserData.sol/StablePoolUserData.json +2 -2
- 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/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +2 -2
- 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/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +2 -2
- 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/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +2 -2
- 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/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +2 -2
- 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 +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/GLPPreviewHelper.sol/GLPPreviewHelper.json +50 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.json +1163 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.json +974 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
- 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/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.json +66 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.json +476 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.json +590 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.json +1017 -0
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.json +2 -2
- 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/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +50 -2
- 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/StringLib.sol/StringLib.json +2 -2
- 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/LogExpMath.sol/LogExpMath.json +2 -2
- package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.json +2 -2
- 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/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/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/GMX/IGMXVault.sol/IGMXVault.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IAToken.sol/IAToken.json → GMX/IGMXVault.sol/IGMXVault.json} +130 -74
- package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IREDACTEDStaking.sol/IREDACTEDStaking.json → GMX/IGlpManager.sol/IGlpManager.json} +24 -47
- package/build/artifacts/contracts/interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IWAvax.sol/IWAvax.json → GMX/IRewardRouterV2.sol/IRewardRouterV2.json} +86 -137
- package/build/artifacts/contracts/interfaces/GMX/IVaultPriceFeed.sol/IVaultPriceFeed.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/GMX/IVaultPriceFeed.sol/IVaultPriceFeed.json +45 -0
- package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.json +48 -0
- 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 +4 -0
- package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.json +93 -0
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.json +87 -0
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.json +19 -0
- 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/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +338 -16
- package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.json +307 -0
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.json +269 -0
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.json +1260 -0
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +105 -224
- package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.json +273 -0
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.json +56 -12
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPActionSwapPTYT.sol/IPActionSwapPTYT.json → IPActionStorageStatic.sol/IPActionStorageStatic.json} +70 -76
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +52 -8
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +231 -8
- package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.json +40 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +675 -241
- 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/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 +4 -0
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.json +40 -0
- package/build/artifacts/contracts/interfaces/IPLiquidityMigrator.sol/IPLiquidityMigrator.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPLiquidityMigrator.sol/IPLiquidityMigrator.json +655 -0
- 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 +4 -0
- package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.json +55 -0
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.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/IPRouterStatic.sol/IPRouterStatic.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.json +2322 -0
- 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/IPVotingController.sol/IPVotingController.json +39 -0
- 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 +4 -0
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.json +679 -0
- 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/IStargateLPStaking.sol/IStargateLPStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
- 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/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.json +143 -0
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.json +256 -0
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.json +47 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +30 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +307 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +333 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +1397 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +310 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +228 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +93 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.json +10 -0
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +345 -62
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +107 -260
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +57 -18
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +54 -65
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +342 -44
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +76 -67
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.json +773 -0
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +4 -0
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.json +141 -0
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.json +1 -15
- 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/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- 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 +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.json +56 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwapArbitrum.sol/PendleSwapArbitrum.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwapArbitrum.sol/PendleSwapArbitrum.json +76 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwapEthereum.sol/PendleSwapEthereum.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwapEthereum.sol/PendleSwapEthereum.json +76 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IAggregationExecutor.sol/IAggregationExecutor.json +65 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IExecutorHelper1.sol/IExecutorHelper1.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IExecutorHelper1.sol/IExecutorHelper1.json +388 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IExecutorHelper2.sol/IExecutorHelper2.dbg.json +4 -0
- package/build/artifacts/contracts/router/{kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json → swap-aggregator/kyberswap/arbitrum/IExecutorHelper2.sol/IExecutorHelper2.json} +13 -8
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IHashflow.sol/IHashflow.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IHashflow.sol/IHashflow.json +101 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +215 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/KyberHelperArbitrum.sol/KyberHelperArbitrum.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/KyberHelperArbitrum.sol/KyberHelperArbitrum.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/ScaleDataHelperArbitrum.sol/ScaleDataHelperArbitrum.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/arbitrum/ScaleDataHelperArbitrum.sol/ScaleDataHelperArbitrum.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IAggregationExecutor.sol/IAggregationExecutor.json +65 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.json +388 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IHashflow.sol/IHashflow.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IHashflow.sol/IHashflow.json +101 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +215 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/KyberHelperEthereum.sol/KyberHelperEthereum.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/KyberHelperEthereum.sol/KyberHelperEthereum.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/ScaleDataHelperEthereum.sol/ScaleDataHelperEthereum.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ethereum/ScaleDataHelperEthereum.sol/ScaleDataHelperEthereum.json +10 -0
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +4 -5
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol +3 -6
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +7 -10
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +8 -10
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +10 -2
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +3 -5
- package/contracts/LiquidityMining/README.md +49 -46
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +9 -14
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +4 -10
- package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +23 -36
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +18 -24
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol +3 -4
- package/contracts/LiquidityMining/libraries/VeBalanceLib.sol +20 -26
- package/contracts/core/BulkSeller/BulkSeller.sol +1 -5
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +4 -5
- package/contracts/core/BulkSeller/BulkSellerMathCore.sol +20 -25
- package/contracts/core/Market/MarketMathCore.sol +23 -69
- package/contracts/core/Market/OracleLib.sol +4 -4
- package/contracts/core/Market/PendleGauge.sol +7 -20
- package/contracts/core/Market/PendleMarket.sol +5 -15
- package/contracts/core/Market/PendleMarketFactory.sol +3 -9
- package/contracts/core/RewardManager/RewardManager.sol +5 -7
- package/contracts/core/RewardManager/RewardManagerAbstract.sol +4 -4
- package/contracts/core/StandardizedYield/PYIndex.sol +7 -36
- package/contracts/core/StandardizedYield/SYBase.sol +20 -26
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +7 -19
- package/contracts/core/StandardizedYield/SYUtils.sol +4 -5
- package/contracts/core/StandardizedYield/StEthHelper.sol +16 -20
- package/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol +14 -24
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSY.sol +127 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +12 -20
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +12 -20
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +1 -5
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +28 -44
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +28 -47
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +6 -10
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +6 -10
- package/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol +13 -22
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol +20 -27
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol +20 -27
- package/contracts/core/StandardizedYield/implementations/Convex/README.md +4 -4
- package/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol +32 -40
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +10 -12
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +14 -18
- package/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol +32 -48
- package/contracts/core/StandardizedYield/implementations/GLP/GLPPreviewHelper.sol +141 -0
- package/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol +214 -0
- package/contracts/core/StandardizedYield/implementations/GLP/README.md +63 -0
- package/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol +112 -0
- package/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol +13 -23
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +13 -23
- package/contracts/core/YieldContracts/PendleYieldToken.sol +28 -44
- package/contracts/core/YieldContractsV2/InterestManagerYTV2.sol +114 -0
- package/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol +63 -0
- package/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol +200 -0
- package/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol +471 -0
- package/contracts/core/erc20/PendleERC20.sol +14 -44
- package/contracts/core/libraries/ArrayLib.sol +20 -9
- package/contracts/core/libraries/BaseSplitCodeFactory.sol +5 -7
- package/contracts/core/libraries/BoringOwnableUpgradeable.sol +1 -5
- package/contracts/core/libraries/Errors.sol +5 -2
- package/contracts/core/libraries/StringLib.sol +14 -20
- package/contracts/core/libraries/TokenHelper.sol +11 -26
- package/contracts/core/libraries/math/LogExpMath.sol +2 -2
- package/contracts/core/libraries/math/Math.sol +3 -15
- package/contracts/interfaces/Balancer/IComposableStable.sol +4 -14
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +4 -13
- package/contracts/interfaces/Balancer/IVault.sol +4 -6
- package/contracts/interfaces/ConvexCurve/IBooster.sol +4 -16
- package/contracts/interfaces/ConvexCurve/ICrvDepositor.sol +1 -5
- package/contracts/interfaces/ConvexCurve/IRewards.sol +1 -4
- package/contracts/interfaces/Curve/ICrvPool.sol +12 -11
- package/contracts/interfaces/Curve/ITriCrvPool.sol +4 -4
- package/contracts/interfaces/GMX/IGMXVault.sol +47 -0
- package/contracts/interfaces/GMX/IGlpManager.sol +12 -0
- package/contracts/interfaces/GMX/IRewardRouterV2.sol +43 -0
- package/contracts/interfaces/GMX/IVaultPriceFeed.sol +11 -0
- package/contracts/interfaces/IAddressProvider.sol +7 -0
- package/contracts/interfaces/IApeStaking.sol +3 -4
- package/contracts/interfaces/IDiamondCut.sol +36 -0
- package/contracts/interfaces/IDiamondLoupe.sol +40 -0
- package/contracts/interfaces/IERC4626.sol +3 -5
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +38 -16
- package/contracts/interfaces/IPActionInfoStatic.sol +43 -0
- package/contracts/interfaces/IPActionMarketAuxStatic.sol +34 -0
- package/contracts/interfaces/IPActionMarketCoreStatic.sol +335 -0
- package/contracts/interfaces/IPActionMintRedeem.sol +2 -55
- package/contracts/interfaces/IPActionMintRedeemStatic.sol +55 -0
- package/contracts/interfaces/IPActionMisc.sol +18 -4
- package/contracts/interfaces/IPActionStorageStatic.sol +24 -0
- package/contracts/interfaces/IPActionSwapPT.sol +1 -1
- package/contracts/interfaces/IPActionSwapYT.sol +28 -4
- package/contracts/interfaces/IPActionVePendleStatic.sol +9 -0
- package/contracts/interfaces/IPAllAction.sol +5 -3
- package/contracts/interfaces/IPBulkSellerSYCallback.sol +1 -5
- package/contracts/interfaces/IPFeeDistributor.sol +4 -3
- package/contracts/interfaces/IPGaugeController.sol +3 -9
- package/contracts/interfaces/IPInterestManagerYT.sol +3 -4
- package/contracts/interfaces/IPInterestManagerYTV2.sol +11 -0
- package/contracts/interfaces/IPLiquidityMigrator.sol +130 -0
- package/contracts/interfaces/IPMarket.sol +5 -16
- package/contracts/interfaces/IPMarketFactory.sol +3 -8
- package/contracts/interfaces/IPMarketSwapCallback.sol +1 -5
- package/contracts/interfaces/IPMiniDiamond.sol +12 -0
- package/contracts/interfaces/IPMsgReceiverApp.sol +1 -1
- package/contracts/interfaces/IPRouterStatic.sol +19 -0
- package/contracts/interfaces/IPVotingController.sol +11 -6
- package/contracts/interfaces/IPVotingEscrowMainchain.sol +8 -7
- package/contracts/interfaces/IPYieldToken.sol +4 -3
- package/contracts/interfaces/IPYieldTokenV2.sol +67 -0
- package/contracts/interfaces/IRewardManager.sol +4 -4
- package/contracts/interfaces/IStETH.sol +4 -3
- package/contracts/interfaces/IStandardizedYield.sol +10 -14
- package/contracts/interfaces/IStargateRouter.sol +1 -5
- package/contracts/offchain-helpers/AddressProvider.sol +16 -0
- package/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol +4 -1
- package/contracts/offchain-helpers/Broadcaster.sol +48 -0
- package/contracts/offchain-helpers/BulkSellerOffchain.sol +7 -11
- package/contracts/offchain-helpers/Multicall2.sol +14 -24
- package/contracts/offchain-helpers/PendleMulticall.sol +26 -0
- package/contracts/offchain-helpers/router-static/PendleRouterStatic.sol +19 -0
- package/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol +122 -0
- package/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol +165 -0
- package/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol +780 -0
- package/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol +158 -0
- package/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol +76 -0
- package/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol +55 -0
- package/contracts/offchain-helpers/router-static/base/StorageLayout.sol +21 -0
- package/contracts/router/ActionAddRemoveLiq.sol +118 -24
- package/contracts/router/ActionMintRedeem.sol +12 -202
- package/contracts/router/ActionMisc.sol +45 -19
- package/contracts/router/ActionSwapPT.sol +0 -5
- package/contracts/router/ActionSwapYT.sol +109 -13
- package/contracts/router/PendleRouter.sol +211 -72
- package/contracts/router/PendleRouterHelper.sol +315 -0
- package/contracts/router/{ActionCallback.sol → base/ActionBaseCallback.sol} +49 -49
- package/contracts/router/base/ActionBaseMintRedeem.sol +108 -64
- package/contracts/router/base/CallbackHelper.sol +136 -54
- package/contracts/router/base/MarketApproxLib.sol +243 -430
- package/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol +39 -0
- package/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol +68 -0
- package/contracts/router/swap-aggregator/IPSwapAggregator.sol +21 -0
- package/contracts/router/swap-aggregator/PendleSwapArbitrum.sol +45 -0
- package/contracts/router/swap-aggregator/PendleSwapEthereum.sol +44 -0
- package/contracts/router/swap-aggregator/kyberswap/arbitrum/IAggregationExecutor.sol +17 -0
- package/contracts/router/swap-aggregator/kyberswap/arbitrum/IExecutorHelper1.sol +195 -0
- package/contracts/router/swap-aggregator/kyberswap/arbitrum/IExecutorHelper2.sol +10 -0
- package/contracts/router/swap-aggregator/kyberswap/arbitrum/IHashflow.sol +30 -0
- package/contracts/router/swap-aggregator/kyberswap/arbitrum/IMetaAggregationRouterV2.sol +41 -0
- package/contracts/router/swap-aggregator/kyberswap/arbitrum/KyberHelperArbitrum.sol +200 -0
- package/contracts/router/swap-aggregator/kyberswap/arbitrum/ScaleDataHelperArbitrum.sol +135 -0
- package/contracts/router/swap-aggregator/kyberswap/ethereum/IAggregationExecutor.sol +17 -0
- package/contracts/router/swap-aggregator/kyberswap/ethereum/IExecutorHelperEthereum1.sol +191 -0
- package/contracts/router/swap-aggregator/kyberswap/ethereum/IHashflow.sol +30 -0
- package/contracts/router/swap-aggregator/kyberswap/ethereum/IMetaAggregationRouterV2.sol +41 -0
- package/contracts/router/swap-aggregator/kyberswap/ethereum/KyberHelperEthereum.sol +201 -0
- package/contracts/router/swap-aggregator/kyberswap/ethereum/ScaleDataHelperEthereum.sol +147 -0
- package/deployments/43113-core.json +31 -0
- package/deployments/43113-markets/APE-30-MARCH.json +10 -0
- package/deployments/43113-markets/USDC-FEB-2ND-2024.json +10 -0
- package/deployments/43113-markets/USDC-FEB-2ND.json +10 -0
- package/deployments/43113-markets/USDC-FEB-4TH.json +10 -0
- package/deployments/43113-markets/WETH-FEB-2ND.json +11 -0
- package/deployments/43113-markets/WETH-FEB-4TH.json +11 -0
- package/deployments/43113-offchain-helper.json +4 -0
- package/deployments/43113-testenv.json +22 -0
- package/deployments/80001-core.json +30 -0
- package/deployments/80001-markets/GLP-DEC-8TH.json +10 -0
- package/deployments/80001-markets/USDC-DEC-8TH.json +10 -0
- package/deployments/80001-markets/USDC-FEB-4TH.json +10 -0
- package/deployments/80001-markets/WETH-FEB-4TH.json +11 -0
- package/deployments/80001-offchain-helper.json +4 -0
- package/deployments/80001-testenv.json +22 -0
- package/package.json +10 -10
- package/typechain-types/ActionAddRemoveLiq.ts +203 -23
- package/typechain-types/ActionBaseCallback.ts +115 -0
- package/typechain-types/ActionInfoStatic.ts +310 -0
- package/typechain-types/ActionMarketAuxStatic.ts +350 -0
- package/typechain-types/ActionMarketCoreStatic.ts +1485 -0
- package/typechain-types/ActionMintRedeem.ts +29 -230
- package/typechain-types/ActionMintRedeemStatic.ts +461 -0
- package/typechain-types/ActionMisc.ts +77 -27
- package/typechain-types/ActionStorageStatic.ts +405 -0
- package/typechain-types/ActionSwapPT.ts +26 -31
- package/typechain-types/ActionSwapYT.ts +202 -21
- package/typechain-types/ActionVePendleStatic.ts +113 -0
- package/typechain-types/AddressProvider.ts +280 -0
- package/typechain-types/Broadcaster.ts +454 -0
- package/typechain-types/GLPPreviewHelper.ts +121 -0
- package/typechain-types/GMXPreviewHelper.ts +121 -0
- package/typechain-types/I1inchAggregationRouterV5.ts +257 -0
- package/typechain-types/IAddressProvider.ts +123 -0
- package/typechain-types/IAggregationExecutor.ts +182 -0
- package/typechain-types/IChainlinkAggregator.ts +246 -0
- package/typechain-types/IDiamondCut.ts +152 -0
- package/typechain-types/IDiamondLoupe.ts +190 -0
- package/typechain-types/IERC4626.ts +34 -0
- package/typechain-types/IExecutorHelper1.ts +643 -0
- package/typechain-types/IExecutorHelper2.ts +115 -0
- package/typechain-types/IExecutorHelperEthereum1.ts +643 -0
- package/typechain-types/IGMXVault.ts +494 -0
- package/typechain-types/IGlpManager.ts +165 -0
- package/typechain-types/IHashflow.ts +159 -0
- package/typechain-types/IKyberSwapAggregationRouterHelper.ts +109 -0
- package/typechain-types/IMetaAggregationRouter.ts +213 -0
- package/typechain-types/IMetaAggregationRouterV2.ts +221 -0
- package/typechain-types/IPActionAddRemoveLiq.ts +213 -14
- package/typechain-types/IPActionInfoStatic.ts +310 -0
- package/typechain-types/IPActionMarketAuxStatic.ts +350 -0
- package/typechain-types/IPActionMarketCoreStatic.ts +1485 -0
- package/typechain-types/IPActionMintRedeem.ts +29 -211
- package/typechain-types/IPActionMintRedeemStatic.ts +461 -0
- package/typechain-types/IPActionMisc.ts +77 -27
- package/typechain-types/IPActionStorageStatic.ts +328 -0
- package/typechain-types/IPActionSwapPT.ts +26 -12
- package/typechain-types/IPActionSwapYT.ts +168 -12
- package/typechain-types/IPActionVePendleStatic.ts +113 -0
- package/typechain-types/IPAllAction.ts +445 -227
- package/typechain-types/IPInterestManagerYTV2.ts +117 -0
- package/typechain-types/IPLiquidityMigrator.ts +565 -0
- package/typechain-types/IPMiniDiamond.ts +147 -0
- package/typechain-types/IPMsgReceiverApp.ts +5 -5
- package/typechain-types/IPRouterStatic.ts +2392 -509
- package/typechain-types/IPSwapAggregator.ts +126 -0
- package/typechain-types/IPVotingController.ts +96 -0
- package/typechain-types/IPYieldTokenV2.ts +901 -0
- package/typechain-types/IRewardRouterV2.ts +346 -0
- package/typechain-types/IStargateLP.ts +306 -0
- package/typechain-types/IStargateStaking.ts +232 -0
- package/typechain-types/ISwapAggregator.ts +124 -0
- package/typechain-types/IVaultPriceFeed.ts +114 -0
- package/typechain-types/InputScalingHelper.ts +108 -0
- package/typechain-types/InterestManagerYTV2.ts +157 -0
- package/typechain-types/PendleAura3EthSY.ts +0 -39
- package/typechain-types/PendleAuraCbethWstethSY.ts +0 -39
- package/typechain-types/PendleAuraWethAnkrethSY.ts +1523 -0
- package/typechain-types/PendleAuraWethWstethSY.ts +0 -39
- package/typechain-types/PendleGDaiSY.ts +1229 -0
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +4 -4
- package/typechain-types/PendleGlpSY.ts +1463 -0
- package/typechain-types/PendleMsgReceiverAppUpg.ts +5 -5
- package/typechain-types/PendleMulticall.ts +110 -0
- package/typechain-types/PendlePrincipalTokenV2.ts +614 -0
- package/typechain-types/PendlePtOracleBase.ts +139 -0
- package/typechain-types/PendleRouter.ts +109 -131
- package/typechain-types/PendleRouterHelper.ts +647 -0
- package/typechain-types/PendleRouterStatic.ts +57 -0
- package/typechain-types/PendleStargateLP.ts +1442 -0
- package/typechain-types/PendleSwapAggregator.ts +126 -0
- package/typechain-types/PendleSwapArbitrum.ts +126 -0
- package/typechain-types/PendleSwapEthereum.ts +126 -0
- package/typechain-types/PendleYieldContractFactoryV2.ts +801 -0
- package/typechain-types/PendleYieldTokenV2.ts +1298 -0
- package/typechain-types/PtFraxUsdcOracle.ts +176 -0
- package/typechain-types/PtStETHOracle.ts +163 -0
- package/typechain-types/RouterStatic.ts +92 -0
- package/typechain-types/SwapAggregator.ts +406 -0
- package/typechain-types/VotingControllerStorageUpg.ts +96 -0
- package/typechain-types/VotingEscrowPendleSidechain.ts +4 -5
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +346 -68
- package/typechain-types/factories/ActionBaseCallback__factory.ts +156 -0
- package/typechain-types/factories/ActionInfoStatic__factory.ts +360 -0
- package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +390 -0
- package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1454 -0
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +367 -0
- package/typechain-types/factories/ActionMintRedeem__factory.ts +108 -266
- package/typechain-types/factories/ActionMisc__factory.ts +56 -17
- package/typechain-types/factories/ActionStorageStatic__factory.ts +281 -0
- package/typechain-types/factories/ActionSwapPT__factory.ts +55 -71
- package/typechain-types/factories/ActionSwapYT__factory.ts +356 -48
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +155 -0
- package/typechain-types/factories/AddressProvider__factory.ts +196 -0
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
- package/typechain-types/factories/Broadcaster__factory.ts +311 -0
- package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
- package/typechain-types/factories/BulkSeller__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +49 -1
- package/typechain-types/factories/GLPPreviewHelper__factory.ts +65 -0
- package/typechain-types/factories/GMXPreviewHelper__factory.ts +65 -0
- package/typechain-types/factories/I1inchAggregationRouterV5__factory.ts +179 -0
- package/typechain-types/factories/IAddressProvider__factory.ts +63 -0
- package/typechain-types/factories/IAggregationExecutor__factory.ts +84 -0
- package/typechain-types/factories/IChainlinkAggregator__factory.ts +170 -0
- package/typechain-types/factories/IDiamondCut__factory.ts +105 -0
- package/typechain-types/factories/IDiamondLoupe__factory.ts +99 -0
- package/typechain-types/factories/IERC4626__factory.ts +19 -0
- package/typechain-types/factories/IExecutorHelper1__factory.ts +403 -0
- package/typechain-types/factories/IExecutorHelper2__factory.ts +55 -0
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +407 -0
- package/typechain-types/factories/IGMXVault__factory.ts +320 -0
- package/typechain-types/factories/IGlpManager__factory.ts +81 -0
- package/typechain-types/factories/IHashflow__factory.ts +113 -0
- package/typechain-types/factories/IKyberSwapAggregationRouterHelper__factory.ts +56 -0
- package/typechain-types/factories/IMetaAggregationRouterV2__factory.ts +234 -0
- package/typechain-types/factories/IMetaAggregationRouter__factory.ts +202 -0
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +338 -16
- package/typechain-types/factories/IPActionInfoStatic__factory.ts +322 -0
- package/typechain-types/factories/IPActionMarketAuxStatic__factory.ts +288 -0
- package/typechain-types/factories/IPActionMarketCoreStatic__factory.ts +1279 -0
- package/typechain-types/factories/IPActionMintRedeemStatic__factory.ts +292 -0
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +105 -224
- package/typechain-types/factories/IPActionMisc__factory.ts +55 -11
- package/typechain-types/factories/IPActionStorageStatic__factory.ts +203 -0
- package/typechain-types/factories/IPActionSwapPT__factory.ts +52 -8
- package/typechain-types/factories/IPActionSwapYT__factory.ts +231 -8
- package/typechain-types/factories/IPActionVePendleStatic__factory.ts +59 -0
- package/typechain-types/factories/IPAllAction__factory.ts +675 -241
- package/typechain-types/factories/IPInterestManagerYTV2__factory.ts +59 -0
- package/typechain-types/factories/IPLiquidityMigrator__factory.ts +677 -0
- package/typechain-types/factories/IPMiniDiamond__factory.ts +67 -0
- package/typechain-types/factories/IPMsgReceiverApp__factory.ts +1 -1
- package/typechain-types/factories/IPRouterStatic__factory.ts +1942 -494
- package/typechain-types/factories/IPSwapAggregator__factory.ts +71 -0
- package/typechain-types/factories/IPVotingController__factory.ts +39 -0
- package/typechain-types/factories/IPYieldTokenV2__factory.ts +694 -0
- package/typechain-types/factories/IRewardRouterV2__factory.ts +216 -0
- package/typechain-types/factories/IStargateLP__factory.ts +212 -0
- package/typechain-types/factories/IStargateStaking__factory.ts +145 -0
- package/typechain-types/factories/ISwapAggregator__factory.ts +66 -0
- package/typechain-types/factories/IVaultPriceFeed__factory.ts +60 -0
- package/typechain-types/factories/InputScalingHelper__factory.ts +88 -0
- package/typechain-types/factories/InterestManagerYTV2__factory.ts +81 -0
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -27
- package/typechain-types/factories/MetaStableMath__factory.ts +1 -1
- package/typechain-types/factories/MetaStablePreview__factory.ts +1 -1
- package/typechain-types/factories/Multicall2__factory.ts +1 -1
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleAura3EthSY__factory.ts +1 -40
- package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +1 -40
- package/typechain-types/factories/PendleAuraWethAnkrethSY__factory.ts +1265 -0
- package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +1 -40
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGDaiSY__factory.ts +1035 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +2 -2
- package/typechain-types/factories/PendleGlpSY__factory.ts +1249 -0
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiverAppUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMulticall__factory.ts +100 -0
- package/typechain-types/factories/PendlePrincipalTokenV2__factory.ts +564 -0
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendlePtOracleBase__factory.ts +78 -0
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterHelper__factory.ts +841 -0
- package/typechain-types/factories/PendleRouterStatic__factory.ts +88 -0
- package/typechain-types/factories/PendleRouter__factory.ts +75 -74
- package/typechain-types/factories/PendleStargateLP__factory.ts +1241 -0
- package/typechain-types/factories/PendleSwapAggregator__factory.ts +129 -0
- package/typechain-types/factories/PendleSwapArbitrum__factory.ts +129 -0
- package/typechain-types/factories/PendleSwapEthereum__factory.ts +129 -0
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +674 -0
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldTokenV2__factory.ts +1109 -0
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/PtFraxUsdcOracle__factory.ts +226 -0
- package/typechain-types/factories/PtStETHOracle__factory.ts +201 -0
- package/typechain-types/factories/RouterStatic__factory.ts +69 -1
- package/typechain-types/factories/SAPE__factory.ts +1 -1
- package/typechain-types/factories/SwapAggregator__factory.ts +309 -0
- package/typechain-types/factories/VotingControllerStorageUpg__factory.ts +39 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +2 -2
- package/typechain-types/hardhat.d.ts +481 -193
- package/typechain-types/index.ts +106 -56
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +0 -1296
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +0 -1283
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +0 -133
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.json +0 -87
- package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.json +0 -59
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.json +0 -34
- package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.json +0 -162
- package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.json +0 -87
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPGovernanceManager.sol/IPGovernanceManager.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPGovernanceManager.sol/IPGovernanceManager.json +0 -24
- package/build/artifacts/contracts/interfaces/IPPermissionsV2Upg.sol/IPermissionsV2Upg.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPPermissionsV2Upg.sol/IPermissionsV2Upg.json +0 -24
- package/build/artifacts/contracts/interfaces/IREDACTEDStaking.sol/IREDACTEDStaking.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.json +0 -199
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.json +0 -168
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IWXBTRFLY.sol/IWXBTRFLY.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IWXBTRFLY.sol/IWXBTRFLY.json +0 -132
- package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.json +0 -148
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +0 -285
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +0 -2741
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +0 -165
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +0 -343
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +0 -224
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouterEthereum.sol/IMultihopRouterEthereum.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouterEthereum.sol/IMultihopRouterEthereum.json +0 -136
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json +0 -24
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +0 -170
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +0 -162
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +0 -289
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +0 -618
- package/contracts/interfaces/IAToken.sol +0 -44
- package/contracts/interfaces/IAavePool.sol +0 -41
- package/contracts/interfaces/IAaveRewardsController.sol +0 -32
- package/contracts/interfaces/IBoringOwnableUpgradeable.sol +0 -10
- package/contracts/interfaces/IEulerEToken.sol +0 -60
- package/contracts/interfaces/IEulerMarkets.sol +0 -46
- package/contracts/interfaces/IPActionSwapPTYT.sol +0 -31
- package/contracts/interfaces/IPGovernanceManager.sol +0 -28
- package/contracts/interfaces/IPPermissionsV2Upg.sol +0 -28
- package/contracts/interfaces/IREDACTEDStaking.sol +0 -35
- package/contracts/interfaces/ISAvax.sol +0 -61
- package/contracts/interfaces/ISJoe.sol +0 -57
- package/contracts/interfaces/IWAvax.sol +0 -34
- package/contracts/interfaces/IWXBTRFLY.sol +0 -39
- package/contracts/interfaces/IYearnVault.sol +0 -46
- package/contracts/offchain-helpers/MarketMathStatic.sol +0 -557
- package/contracts/offchain-helpers/RouterStatic.sol +0 -903
- package/contracts/router/ActionSwapPTYT.sol +0 -108
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +0 -341
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +0 -10
- package/contracts/router/kyberswap/IMultihopRouterEthereum.sol +0 -141
- package/contracts/router/kyberswap/KyberSwapHelper.sol +0 -79
- package/deployments/1-core.json +0 -30
- package/deployments/1-markets/APE-JUNE-29.json +0 -8
- package/deployments/1-markets/BALANCER-LP-AURA-RETH-WETH-28DEC.json +0 -11
- package/deployments/1-markets/FRAXUSDC-CURVELP-MARCH30.json +0 -11
- package/deployments/1-markets/LOOKS-STAKING-MARCH30.json +0 -10
- package/deployments/1-markets/STETH-JUNE29.json +0 -10
- package/deployments/1-markets/STETH-MARCH30.json +0 -10
package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol
CHANGED
|
@@ -8,10 +8,10 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
|
8
8
|
library CurveFraxUsdcPoolHelper {
|
|
9
9
|
uint256 internal constant N_COINS = 2;
|
|
10
10
|
uint256 internal constant A_PRECISION = 100;
|
|
11
|
-
uint256 internal constant PRECISION = 10**18;
|
|
11
|
+
uint256 internal constant PRECISION = 10 ** 18;
|
|
12
12
|
uint256 internal constant RATE_0 = 1000000000000000000;
|
|
13
13
|
uint256 internal constant RATE_1 = 1000000000000000000000000000000;
|
|
14
|
-
uint256 internal constant FEE_DENOMINATOR = 10**10;
|
|
14
|
+
uint256 internal constant FEE_DENOMINATOR = 10 ** 10;
|
|
15
15
|
|
|
16
16
|
address internal constant POOL = 0xDcEF968d416a41Cdac0ED8702fAC8128A64241A2;
|
|
17
17
|
address internal constant LP = 0x3175Df0976dFA876431C2E9eE6Bc45b65d3473CC;
|
|
@@ -59,11 +59,10 @@ library CurveFraxUsdcPoolHelper {
|
|
|
59
59
|
return (total_supply * (D2 - D0)) / D0;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
function _get_D_mem(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
62
|
+
function _get_D_mem(
|
|
63
|
+
uint256[N_COINS] memory balances,
|
|
64
|
+
uint256 _amp
|
|
65
|
+
) internal pure returns (uint256) {
|
|
67
66
|
uint256[N_COINS] memory _xp;
|
|
68
67
|
_xp[0] = (RATE_0 * balances[0]) / PRECISION;
|
|
69
68
|
_xp[1] = (RATE_1 * balances[1]) / PRECISION;
|
|
@@ -117,11 +116,10 @@ library CurveFraxUsdcPoolHelper {
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
|
|
120
|
-
function _getTokenAmounts(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
{
|
|
119
|
+
function _getTokenAmounts(
|
|
120
|
+
address token,
|
|
121
|
+
uint256 amount
|
|
122
|
+
) internal pure returns (uint256[N_COINS] memory res) {
|
|
125
123
|
res[token == FRAX ? 0 : 1] = amount;
|
|
126
124
|
}
|
|
127
125
|
}
|
package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol
CHANGED
|
@@ -11,9 +11,9 @@ library CurveUsdd3CrvPoolHelper {
|
|
|
11
11
|
|
|
12
12
|
uint256 internal constant N_COINS = 2;
|
|
13
13
|
uint256 internal constant A_PRECISION = 100;
|
|
14
|
-
uint256 internal constant PRECISION = 10**18;
|
|
15
|
-
uint256 internal constant rate_multiplier = 10**18;
|
|
16
|
-
uint256 internal constant FEE_DENOMINATOR = 10**10;
|
|
14
|
+
uint256 internal constant PRECISION = 10 ** 18;
|
|
15
|
+
uint256 internal constant rate_multiplier = 10 ** 18;
|
|
16
|
+
uint256 internal constant FEE_DENOMINATOR = 10 ** 10;
|
|
17
17
|
|
|
18
18
|
// LP == POOL
|
|
19
19
|
address internal constant POOL = 0xe6b5CC1B4b47305c58392CE3D359B10282FC36Ea;
|
|
@@ -25,11 +25,10 @@ library CurveUsdd3CrvPoolHelper {
|
|
|
25
25
|
balances[1] = ICrvPool(POOL).balances(1);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function _getTokenAmounts(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
28
|
+
function _getTokenAmounts(
|
|
29
|
+
address token,
|
|
30
|
+
uint256 amount
|
|
31
|
+
) internal pure returns (uint256[N_COINS] memory res) {
|
|
33
32
|
res[token == USDD ? 0 : 1] = amount;
|
|
34
33
|
}
|
|
35
34
|
|
|
@@ -95,11 +94,10 @@ library CurveUsdd3CrvPoolHelper {
|
|
|
95
94
|
return get_D(xp, _amp);
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
function _xp_mem(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
{
|
|
97
|
+
function _xp_mem(
|
|
98
|
+
uint256[N_COINS] memory _rates,
|
|
99
|
+
uint256[N_COINS] memory balances
|
|
100
|
+
) internal pure returns (uint256[N_COINS] memory) {
|
|
103
101
|
uint256[N_COINS] memory result;
|
|
104
102
|
for (uint256 i = 0; i < N_COINS; ++i) {
|
|
105
103
|
result[i] = (balances[i] * _rates[i]) / PRECISION;
|
|
@@ -140,11 +138,9 @@ library CurveUsdd3CrvPoolHelper {
|
|
|
140
138
|
assert(false);
|
|
141
139
|
}
|
|
142
140
|
|
|
143
|
-
function arrayClone(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
returns (uint256[N_COINS] memory res)
|
|
147
|
-
{
|
|
141
|
+
function arrayClone(
|
|
142
|
+
uint256[N_COINS] memory a
|
|
143
|
+
) internal pure returns (uint256[N_COINS] memory res) {
|
|
148
144
|
for (uint256 i = 0; i < N_COINS; ++i) {
|
|
149
145
|
res[i] = a[i];
|
|
150
146
|
}
|
|
@@ -35,11 +35,9 @@ abstract contract PendleConvexLPSY is SYBaseWithRewards {
|
|
|
35
35
|
_safeApproveInf(crvLp, BOOSTER);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function _getPoolInfo(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
returns (address _crvLp, address _cvxRewardManager)
|
|
42
|
-
{
|
|
38
|
+
function _getPoolInfo(
|
|
39
|
+
uint256 _cvxPid
|
|
40
|
+
) internal view returns (address _crvLp, address _cvxRewardManager) {
|
|
43
41
|
if (_cvxPid > IBooster(BOOSTER).poolLength()) revert Errors.SYCurveInvalidPid();
|
|
44
42
|
|
|
45
43
|
(_crvLp, , , _cvxRewardManager, , ) = IBooster(BOOSTER).poolInfo(_cvxPid);
|
|
@@ -53,12 +51,10 @@ abstract contract PendleConvexLPSY is SYBaseWithRewards {
|
|
|
53
51
|
* If any of the base pool tokens are deposited, it will first add liquidity to the curve pool and mint LP,
|
|
54
52
|
* which will then be deposited into convex
|
|
55
53
|
*/
|
|
56
|
-
function _deposit(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
returns (uint256 amountSharesOut)
|
|
61
|
-
{
|
|
54
|
+
function _deposit(
|
|
55
|
+
address tokenIn,
|
|
56
|
+
uint256 amount
|
|
57
|
+
) internal virtual override returns (uint256 amountSharesOut) {
|
|
62
58
|
if (tokenIn == crvLp) {
|
|
63
59
|
amountSharesOut = amount;
|
|
64
60
|
} else {
|
|
@@ -122,13 +118,10 @@ abstract contract PendleConvexLPSY is SYBaseWithRewards {
|
|
|
122
118
|
MISC FUNCTIONS FOR METADATA
|
|
123
119
|
//////////////////////////////////////////////////////////////*/
|
|
124
120
|
|
|
125
|
-
function _previewDeposit(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
override
|
|
130
|
-
returns (uint256 amountSharesOut)
|
|
131
|
-
{
|
|
121
|
+
function _previewDeposit(
|
|
122
|
+
address tokenIn,
|
|
123
|
+
uint256 amountTokenToDeposit
|
|
124
|
+
) internal view virtual override returns (uint256 amountSharesOut) {
|
|
132
125
|
if (tokenIn == crvLp) {
|
|
133
126
|
amountSharesOut = amountTokenToDeposit;
|
|
134
127
|
} else {
|
|
@@ -136,13 +129,10 @@ abstract contract PendleConvexLPSY is SYBaseWithRewards {
|
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
131
|
|
|
139
|
-
function _previewRedeem(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
override
|
|
144
|
-
returns (uint256 amountTokenOut)
|
|
145
|
-
{
|
|
132
|
+
function _previewRedeem(
|
|
133
|
+
address tokenOut,
|
|
134
|
+
uint256 amountSharesToRedeem
|
|
135
|
+
) internal view virtual override returns (uint256 amountTokenOut) {
|
|
146
136
|
if (tokenOut == crvLp) {
|
|
147
137
|
amountTokenOut = amountSharesToRedeem;
|
|
148
138
|
} else {
|
|
@@ -158,36 +148,30 @@ abstract contract PendleConvexLPSY is SYBaseWithRewards {
|
|
|
158
148
|
|
|
159
149
|
function isValidTokenOut(address token) public view virtual override returns (bool);
|
|
160
150
|
|
|
161
|
-
function _depositToCurve(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
151
|
+
function _depositToCurve(
|
|
152
|
+
address tokenIn,
|
|
153
|
+
uint256 amountTokenToDeposit
|
|
154
|
+
) internal virtual returns (uint256);
|
|
165
155
|
|
|
166
|
-
function _redeemFromCurve(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
156
|
+
function _redeemFromCurve(
|
|
157
|
+
address tokenOut,
|
|
158
|
+
uint256 amountLpToRedeem
|
|
159
|
+
) internal virtual returns (uint256);
|
|
170
160
|
|
|
171
|
-
function _previewDepositToCurve(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
returns (uint256 amountLpOut);
|
|
161
|
+
function _previewDepositToCurve(
|
|
162
|
+
address token,
|
|
163
|
+
uint256 amountTokenToDeposit
|
|
164
|
+
) internal view virtual returns (uint256 amountLpOut);
|
|
176
165
|
|
|
177
|
-
function _previewRedeemFromCurve(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
returns (uint256 amountTokenOut);
|
|
166
|
+
function _previewRedeemFromCurve(
|
|
167
|
+
address token,
|
|
168
|
+
uint256 amountLpToRedeem
|
|
169
|
+
) internal view virtual returns (uint256 amountTokenOut);
|
|
182
170
|
|
|
183
171
|
function assetInfo()
|
|
184
172
|
external
|
|
185
173
|
view
|
|
186
|
-
returns (
|
|
187
|
-
AssetType assetType,
|
|
188
|
-
address assetAddress,
|
|
189
|
-
uint8 assetDecimals
|
|
190
|
-
)
|
|
174
|
+
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
191
175
|
{
|
|
192
176
|
return (AssetType.LIQUIDITY, crvLp, IERC20Metadata(crvLp).decimals());
|
|
193
177
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
|
+
import "../../../../interfaces/GMX/IGMXVault.sol";
|
|
6
|
+
import "../../../../interfaces/GMX/IVaultPriceFeed.sol";
|
|
7
|
+
|
|
8
|
+
abstract contract GLPPreviewHelper {
|
|
9
|
+
// Based on Vault functions
|
|
10
|
+
|
|
11
|
+
IGMXVault public immutable vault;
|
|
12
|
+
address internal immutable usdg;
|
|
13
|
+
uint256 public constant PRICE_PRECISION = 10 ** 30;
|
|
14
|
+
uint256 public constant BASIS_POINTS_DIVISOR = 10000;
|
|
15
|
+
|
|
16
|
+
constructor(address _vaultAddress) {
|
|
17
|
+
vault = IGMXVault(_vaultAddress);
|
|
18
|
+
usdg = vault.usdg();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _buyUSDG(address _token, uint256 tokenAmount) internal view returns (uint256) {
|
|
22
|
+
tokenAmount = __transferIn(_token, tokenAmount);
|
|
23
|
+
assert(tokenAmount > 0);
|
|
24
|
+
|
|
25
|
+
uint256 price = vault.getMinPrice(_token);
|
|
26
|
+
|
|
27
|
+
uint256 usdgAmount = (tokenAmount * price) / PRICE_PRECISION;
|
|
28
|
+
usdgAmount = vault.adjustForDecimals(usdgAmount, _token, usdg);
|
|
29
|
+
require(usdgAmount > 0, "preview buyUSDG: usdgAmount must be > 0");
|
|
30
|
+
|
|
31
|
+
uint256 feeBasisPoints = __getFeeBasisPoints(
|
|
32
|
+
_token,
|
|
33
|
+
usdgAmount,
|
|
34
|
+
0,
|
|
35
|
+
vault.mintBurnFeeBasisPoints(),
|
|
36
|
+
vault.taxBasisPoints(),
|
|
37
|
+
true
|
|
38
|
+
);
|
|
39
|
+
uint256 amountAfterFees = __collectSwapFees(_token, tokenAmount, feeBasisPoints);
|
|
40
|
+
uint256 mintAmount = (amountAfterFees * price) / PRICE_PRECISION;
|
|
41
|
+
mintAmount = vault.adjustForDecimals(mintAmount, _token, usdg);
|
|
42
|
+
|
|
43
|
+
return mintAmount;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _sellUSDG(address _token, uint256 usdgAmount) internal view returns (uint256) {
|
|
47
|
+
usdgAmount = __transferIn(usdg, usdgAmount);
|
|
48
|
+
assert(usdgAmount > 0);
|
|
49
|
+
|
|
50
|
+
uint256 redemptionAmount = vault.getRedemptionAmount(_token, usdgAmount);
|
|
51
|
+
require(redemptionAmount > 0, "preview sellUSDG: redemptionAmount must be > 0");
|
|
52
|
+
|
|
53
|
+
uint256 feeBasisPoints = __getFeeBasisPoints(
|
|
54
|
+
_token,
|
|
55
|
+
usdgAmount,
|
|
56
|
+
usdgAmount,
|
|
57
|
+
vault.mintBurnFeeBasisPoints(),
|
|
58
|
+
vault.taxBasisPoints(),
|
|
59
|
+
false
|
|
60
|
+
);
|
|
61
|
+
uint256 amountOut = __collectSwapFees(_token, redemptionAmount, feeBasisPoints);
|
|
62
|
+
require(amountOut > 0, "preview sellUSDG: amountOut must be > 0");
|
|
63
|
+
|
|
64
|
+
return amountOut;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function __transferIn(address _token, uint256 _amount) private view returns (uint256) {
|
|
68
|
+
uint256 prevBalance = vault.tokenBalances(_token);
|
|
69
|
+
uint256 nextBalance = IERC20(_token).balanceOf(address(vault)) + _amount;
|
|
70
|
+
|
|
71
|
+
return nextBalance - prevBalance;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function __collectSwapFees(
|
|
75
|
+
address /*_token*/,
|
|
76
|
+
uint256 _amount,
|
|
77
|
+
uint256 _feeBasisPoints
|
|
78
|
+
) private pure returns (uint256) {
|
|
79
|
+
uint256 afterFeeAmount = (_amount * (BASIS_POINTS_DIVISOR - _feeBasisPoints)) /
|
|
80
|
+
(BASIS_POINTS_DIVISOR);
|
|
81
|
+
return afterFeeAmount;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function __getFeeBasisPoints(
|
|
85
|
+
address _token,
|
|
86
|
+
uint256 _usdgDelta,
|
|
87
|
+
uint256 _burnedUsdg,
|
|
88
|
+
uint256 _feeBasisPoints,
|
|
89
|
+
uint256 _taxBasisPoints,
|
|
90
|
+
bool _increment
|
|
91
|
+
) private view returns (uint256) {
|
|
92
|
+
if (!vault.hasDynamicFees()) {
|
|
93
|
+
return _feeBasisPoints;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
uint256 initialAmount = vault.usdgAmounts(_token);
|
|
97
|
+
initialAmount = (initialAmount >= _burnedUsdg) ? initialAmount - _burnedUsdg : 0;
|
|
98
|
+
|
|
99
|
+
uint256 nextAmount = initialAmount + _usdgDelta;
|
|
100
|
+
if (!_increment) {
|
|
101
|
+
nextAmount = _usdgDelta > initialAmount ? 0 : initialAmount - _usdgDelta;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
uint256 targetAmount = __getTargetUsdgAmount(_token, _burnedUsdg);
|
|
105
|
+
if (targetAmount == 0) {
|
|
106
|
+
return _feeBasisPoints;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
uint256 initialDiff = initialAmount > targetAmount
|
|
110
|
+
? initialAmount - targetAmount
|
|
111
|
+
: targetAmount - initialAmount;
|
|
112
|
+
uint256 nextDiff = nextAmount > targetAmount
|
|
113
|
+
? nextAmount - targetAmount
|
|
114
|
+
: targetAmount - nextAmount;
|
|
115
|
+
|
|
116
|
+
// action improves relative asset balance
|
|
117
|
+
if (nextDiff < initialDiff) {
|
|
118
|
+
uint256 rebateBps = (_taxBasisPoints * initialDiff) / targetAmount;
|
|
119
|
+
return rebateBps > _feeBasisPoints ? 0 : _feeBasisPoints - rebateBps;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
uint256 averageDiff = (initialDiff + nextDiff) / 2;
|
|
123
|
+
if (averageDiff > targetAmount) {
|
|
124
|
+
averageDiff = targetAmount;
|
|
125
|
+
}
|
|
126
|
+
uint256 taxBps = (_taxBasisPoints * averageDiff) / targetAmount;
|
|
127
|
+
return _feeBasisPoints + taxBps;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function __getTargetUsdgAmount(
|
|
131
|
+
address _token,
|
|
132
|
+
uint256 _burnedUsdg
|
|
133
|
+
) private view returns (uint256) {
|
|
134
|
+
uint256 supply = IERC20(usdg).totalSupply() - _burnedUsdg;
|
|
135
|
+
if (supply == 0) {
|
|
136
|
+
return 0;
|
|
137
|
+
}
|
|
138
|
+
uint256 weight = vault.tokenWeights(_token);
|
|
139
|
+
return (weight * supply) / vault.totalTokenWeights();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../SYBaseWithRewards.sol";
|
|
5
|
+
import "./GLPPreviewHelper.sol";
|
|
6
|
+
import "../../../libraries/ArrayLib.sol";
|
|
7
|
+
import "../../../../interfaces/GMX/IRewardRouterV2.sol";
|
|
8
|
+
import "../../../../interfaces/GMX/IGlpManager.sol";
|
|
9
|
+
import "../../../../interfaces/GMX/IGMXVault.sol";
|
|
10
|
+
|
|
11
|
+
contract PendleGlpSY is SYBaseWithRewards, GLPPreviewHelper {
|
|
12
|
+
using ArrayLib for address[];
|
|
13
|
+
|
|
14
|
+
address public immutable glp;
|
|
15
|
+
address public immutable stakedGlp;
|
|
16
|
+
address public immutable rewardRouter;
|
|
17
|
+
address public immutable glpRouter;
|
|
18
|
+
address public immutable glpManager;
|
|
19
|
+
address public immutable weth;
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
string memory _name,
|
|
23
|
+
string memory _symbol,
|
|
24
|
+
address _glp,
|
|
25
|
+
address _fsGlp,
|
|
26
|
+
address _stakedGlp,
|
|
27
|
+
address _rewardRouter,
|
|
28
|
+
address _glpRouter,
|
|
29
|
+
address _vault
|
|
30
|
+
) SYBaseWithRewards(_name, _symbol, _fsGlp) GLPPreviewHelper(_vault) {
|
|
31
|
+
glp = _glp;
|
|
32
|
+
stakedGlp = _stakedGlp;
|
|
33
|
+
rewardRouter = _rewardRouter;
|
|
34
|
+
glpRouter = _glpRouter;
|
|
35
|
+
glpManager = IRewardRouterV2(glpRouter).glpManager();
|
|
36
|
+
weth = IRewardRouterV2(glpRouter).weth();
|
|
37
|
+
|
|
38
|
+
approveAllWhitelisted();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function approveAllWhitelisted() public {
|
|
42
|
+
uint256 length = vault.allWhitelistedTokensLength();
|
|
43
|
+
for (uint256 i = 0; i < length; ++i) {
|
|
44
|
+
address token = vault.allWhitelistedTokens(i);
|
|
45
|
+
if (vault.whitelistedTokens(token)) {
|
|
46
|
+
_safeApproveInf(token, glpManager);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*///////////////////////////////////////////////////////////////
|
|
52
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
53
|
+
//////////////////////////////////////////////////////////////*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @dev See {SYBase-_deposit}
|
|
57
|
+
*/
|
|
58
|
+
function _deposit(
|
|
59
|
+
address tokenIn,
|
|
60
|
+
uint256 amountDeposited
|
|
61
|
+
) internal virtual override returns (uint256 amountSharesOut) {
|
|
62
|
+
if (tokenIn == stakedGlp) {
|
|
63
|
+
// GLP is already staked in stakedGlp's transferFrom, called in _transferIn()
|
|
64
|
+
amountSharesOut = amountDeposited;
|
|
65
|
+
} else if (tokenIn == NATIVE) {
|
|
66
|
+
amountSharesOut = IRewardRouterV2(glpRouter).mintAndStakeGlpETH{ value: msg.value }(
|
|
67
|
+
0,
|
|
68
|
+
0
|
|
69
|
+
);
|
|
70
|
+
} else {
|
|
71
|
+
amountSharesOut = IRewardRouterV2(glpRouter).mintAndStakeGlp(
|
|
72
|
+
tokenIn,
|
|
73
|
+
amountDeposited,
|
|
74
|
+
0,
|
|
75
|
+
0
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @dev See {SYBase-_redeem}
|
|
82
|
+
*/
|
|
83
|
+
function _redeem(
|
|
84
|
+
address receiver,
|
|
85
|
+
address tokenOut,
|
|
86
|
+
uint256 amountSharesToRedeem
|
|
87
|
+
) internal virtual override returns (uint256 amountTokenOut) {
|
|
88
|
+
if (tokenOut == stakedGlp) {
|
|
89
|
+
amountTokenOut = amountSharesToRedeem;
|
|
90
|
+
_transferOut(tokenOut, receiver, amountTokenOut);
|
|
91
|
+
} else if (tokenOut == NATIVE) {
|
|
92
|
+
amountTokenOut = IRewardRouterV2(glpRouter).unstakeAndRedeemGlpETH(
|
|
93
|
+
amountSharesToRedeem,
|
|
94
|
+
0,
|
|
95
|
+
payable(receiver)
|
|
96
|
+
);
|
|
97
|
+
} else {
|
|
98
|
+
amountTokenOut = IRewardRouterV2(glpRouter).unstakeAndRedeemGlp(
|
|
99
|
+
tokenOut,
|
|
100
|
+
amountSharesToRedeem,
|
|
101
|
+
0,
|
|
102
|
+
receiver
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/*///////////////////////////////////////////////////////////////
|
|
108
|
+
EXCHANGE-RATE
|
|
109
|
+
//////////////////////////////////////////////////////////////*/
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @notice Calculates and updates the exchange rate of shares to underlying asset token
|
|
113
|
+
* @dev 1 SY = 1 GLP
|
|
114
|
+
*/
|
|
115
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
116
|
+
return Math.ONE;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/*///////////////////////////////////////////////////////////////
|
|
120
|
+
REWARDS-RELATED
|
|
121
|
+
//////////////////////////////////////////////////////////////*/
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @dev See {IStandardizedYield-getRewardTokens}
|
|
125
|
+
*/
|
|
126
|
+
function _getRewardTokens() internal view override returns (address[] memory res) {
|
|
127
|
+
res = new address[](1);
|
|
128
|
+
res[0] = weth;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function _redeemExternalReward() internal override {
|
|
132
|
+
IRewardRouterV2(rewardRouter).handleRewards(false, false, true, true, false, true, false);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/*///////////////////////////////////////////////////////////////
|
|
136
|
+
MISC FUNCTIONS FOR METADATA
|
|
137
|
+
//////////////////////////////////////////////////////////////*/
|
|
138
|
+
|
|
139
|
+
function _previewDeposit(
|
|
140
|
+
address tokenIn,
|
|
141
|
+
uint256 amountTokenToDeposit
|
|
142
|
+
) internal view override returns (uint256 amountSharesOut) {
|
|
143
|
+
if (tokenIn == stakedGlp) amountSharesOut = amountTokenToDeposit;
|
|
144
|
+
else {
|
|
145
|
+
if (tokenIn == NATIVE) tokenIn = weth;
|
|
146
|
+
|
|
147
|
+
// Based on GlpManager's _addLiquidity
|
|
148
|
+
uint256 aumInUsdg = IGlpManager(glpManager).getAumInUsdg(true);
|
|
149
|
+
uint256 glpSupply = IERC20(glp).totalSupply();
|
|
150
|
+
uint256 usdgAmount = super._buyUSDG(tokenIn, amountTokenToDeposit);
|
|
151
|
+
|
|
152
|
+
uint256 mintAmount = aumInUsdg == 0
|
|
153
|
+
? usdgAmount
|
|
154
|
+
: (usdgAmount * glpSupply) / aumInUsdg;
|
|
155
|
+
amountSharesOut = mintAmount;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function _previewRedeem(
|
|
160
|
+
address tokenOut,
|
|
161
|
+
uint256 amountSharesToRedeem
|
|
162
|
+
) internal view override returns (uint256 amountTokenOut) {
|
|
163
|
+
if (tokenOut == stakedGlp) amountTokenOut = amountSharesToRedeem;
|
|
164
|
+
else {
|
|
165
|
+
if (tokenOut == NATIVE) tokenOut = weth;
|
|
166
|
+
|
|
167
|
+
// Based on GlpManager's _removeLiquidity
|
|
168
|
+
uint256 aumInUsdg = IGlpManager(glpManager).getAumInUsdg(false);
|
|
169
|
+
uint256 glpSupply = IERC20(glp).totalSupply();
|
|
170
|
+
|
|
171
|
+
uint256 usdgAmount = (amountSharesToRedeem * aumInUsdg) / glpSupply;
|
|
172
|
+
uint256 amountOut = super._sellUSDG(tokenOut, usdgAmount);
|
|
173
|
+
|
|
174
|
+
amountTokenOut = amountOut;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function _getGlpTokens() internal view returns (address[] memory res) {
|
|
179
|
+
res = new address[](0);
|
|
180
|
+
uint256 length = vault.allWhitelistedTokensLength();
|
|
181
|
+
for (uint256 i = 0; i < length; ++i) {
|
|
182
|
+
address token = vault.allWhitelistedTokens(i);
|
|
183
|
+
if (vault.whitelistedTokens(token) && !res.contains(token)) {
|
|
184
|
+
res = res.append(token);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
res = res.append(stakedGlp);
|
|
188
|
+
res = res.append(NATIVE);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
192
|
+
return _getGlpTokens();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
196
|
+
return _getGlpTokens();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
200
|
+
return token == stakedGlp || token == NATIVE || vault.whitelistedTokens(token);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
204
|
+
return token == stakedGlp || token == NATIVE || vault.whitelistedTokens(token);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function assetInfo()
|
|
208
|
+
external
|
|
209
|
+
view
|
|
210
|
+
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
211
|
+
{
|
|
212
|
+
return (AssetType.LIQUIDITY, glp, IERC20Metadata(glp).decimals());
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Audit note GLP SY
|
|
2
|
+
|
|
3
|
+
Our goal is to support SY for the GLP token of GMX.
|
|
4
|
+
|
|
5
|
+
The SY supports mint-and-staking GLP with a whitelisted token (ETH, WBTC, etc) or receiving staked GLP from user.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
- _The main contract_ for the SY is: `PendleGlpSY.sol`.
|
|
10
|
+
This contract contains the main logic ofk all SY operations, except GMX's Vault-related logic for preview functions. This part is contained in the abstract preview contract, which is inherited by the main contract.
|
|
11
|
+
|
|
12
|
+
* _The preview contract_ is: `GMXPreviewHelper.sol`.
|
|
13
|
+
This contract simulates the logic of GMX's Vault to preview buying/selling USDG during deposit/redeem.
|
|
14
|
+
|
|
15
|
+
## About PendleGlpSY
|
|
16
|
+
|
|
17
|
+
A typical, ordinary SY contract.
|
|
18
|
+
|
|
19
|
+
- _Constructor_: Initialize global variables and approve whitelisted tokens to GMX's GlpManager, which would pull tokens in from the SY contract when minting GLP.
|
|
20
|
+
- There are two routers: _rewardRouter_ is used for claiming rewards,, _glpRouter_ is used to deposit/redeem; hence the two global router variables.
|
|
21
|
+
- _Deposit_:
|
|
22
|
+
- In case of receiving staked GLP, then staked GLP is already pulled in with \_transferIn() in SYBase.
|
|
23
|
+
**Note:** StakedGLP (sGLP) is a helper contract by GMX for users to transfer their staked GLP between each other, where staking and unstaking happen behind the scenes. It is not an ERC20 token, but it behaves similar enough to one so that we treat it is ERC20 in the contract.
|
|
24
|
+
- Otherwise, use GlpRewardRouter to mint and stake.
|
|
25
|
+
- _Redeem_: Same as deposit, reversed. If user redeems in staked GLP, \_transferOut() is used for staked GLP.
|
|
26
|
+
- _Exchange rate_: The SY directly wraps GLP, so the exchange rate is always 1.
|
|
27
|
+
- _Preview deposit_: Mimics the logic of _\_addLiquidity()_ in GMX's GlpManager. The functions needs to preview _buyUSDG()_ of GMX's Vault, which is mimicked in GMXPreviewHelper.
|
|
28
|
+
- _Preview redeem_: Mimics the logic of _\_removeLiquidity()_ in GMX's GlpManager. The functions needs to preview _sellUSDG()_ of GMX's Vault, which is also mimicked in GMXPreviewHelper.
|
|
29
|
+
- _Get tokens in/out_: Queries whitelisted tokens from GMX's Vault, then return them along with staked GLP and native ETH.
|
|
30
|
+
- _Check valid token in/out_: Calls _whitelistedTokens()_ from GMX's Vault to check.
|
|
31
|
+
|
|
32
|
+
## About GMXPreviewHelper
|
|
33
|
+
|
|
34
|
+
This contract's purpose is to support preview for _buyUSDG()_ and _sellUSDG()_ functions from GMX's Vault. The contracts has two view functions _buyUSDG()_ and _sellUSDG()_ which mimics their respective Vault counterpart's logic.
|
|
35
|
+
|
|
36
|
+
About _buyUSDG()_:
|
|
37
|
+
|
|
38
|
+
- First, _tokenAmount_ is calculated with \_transferIn(), which should give the same as the corresponding Vault function.
|
|
39
|
+
- _updateCumulativeFundingRate()_ in Vault should not impact amount out, so this is ignored.
|
|
40
|
+
- For _price_ and _usdgAmount_, the Vault view functions used in Vault's buyUSDG() should behave the same as during actual redeeming, so they are called directly from Vault.
|
|
41
|
+
- For _feeBasisPoints_, _getFeeBasisPoints()_ also behave the same as Vault, becacuse the extra parameter _\_burnedUsdg_ = 0 which has no affect on the return value.
|
|
42
|
+
- For _amountAfterFees_, see _\_collectSwapFees()_ below.
|
|
43
|
+
- Finally, _mintAmount_ is calculated normally.
|
|
44
|
+
|
|
45
|
+
About _sellUSDG()_:
|
|
46
|
+
|
|
47
|
+
- Again, first _usdgAmount_ is calculated.
|
|
48
|
+
- _updateCumulativeFundingRate()_ in Vault should not impact amount out, so this is ignored.
|
|
49
|
+
- We directly call Vault's getRedemptionAmount() to calculate _redemptionAmount_. Although _useSwapPricing_ is set to true earlier in Vault's _sellUSDG()_, and _getRedemptionAmount()_ calls _getMaxPrice()_, which then calls priceFeed's _getPrice()_ with _useSwapPricing_ as a parameter, this parameter is then ignored in _getPrice()_. So we can ignore _useSwapPricing_, and Vault's _getRedemptionAmount()_ called in preview should behave the same as actual redeem.
|
|
50
|
+
- Next, _decreaseUsdgAmount() and USDG's \_burn()_ are called. This affects USDG balances, which would later affect _getFeeBasisPoints()_.
|
|
51
|
+
- _poolAmounts_ and _tokenBalances_ should not affect the amount out, so _\_decreasePoolAmount()_ and _\_updateTokenBalance()_ are ignored.
|
|
52
|
+
- For _feeBasisPoints_, we need _getFeeBasisPoints()_. But _usdgAmounts[\_token]_ has been decreased by _usdgAmount_, so we account for this by adding parameter _\_burnedUsdg_ in our "fake" _getFeeBasisPoints()_.
|
|
53
|
+
- Finally, _amountOut_ is calculated with _\_collectSwapFees()_.
|
|
54
|
+
|
|
55
|
+
Other helper functions:
|
|
56
|
+
|
|
57
|
+
- _\_transferIn()_: Mimics Vault's counterpart, should return the same value.
|
|
58
|
+
- _\_collectSwapFees()_: In Vault, this function only changes _feeReserves_ which does not affect deposit/redeem, so we only need the _afterFeeAmount_.
|
|
59
|
+
- _getFeeBasisPoints()_: Since USDG balances are affected in _sellUSDG()_, another parameter _\_burnedUsdg_ is introduced to account for this decrease in USDG. Namely, this affects:
|
|
60
|
+
- _initialAmount_: The new _usdgAmount[\_token]_ is different, which is calculated here similar to Vault's decreaseUsdgAmount().
|
|
61
|
+
- _getTargetUsdgAmount()_: The formula for the target amount concerns the total supply of USDG, which is affected by _burn()_ in _sellUSDG()_. This is accounted for in our "fake" _getTargetUsdgAmount()_, which takes _\_burnedUsdg_ as parameter and uses it to calculate the real _supply_.
|
|
62
|
+
|
|
63
|
+
In our tests, all - intermediate and final return - values perfectly matches between Vault's functions and our replicas.
|