@pendle/core-v2 1.0.0-mainnet → 1.0.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/README.md +28 -0
- 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/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 +2 -2
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +592 -0
- 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/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 +2 -2
- 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/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/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/StEthHelper.sol/StEthHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +1075 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +1257 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +1244 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +1218 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +1192 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +133 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +40 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +322 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.json +1171 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.json +133 -0
- 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/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/GMXPreviewHelper.sol/GMXPreviewHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/GMXPreviewHelper.sol/GMXPreviewHelper.json +50 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/PendleGlpSY.sol/PendleGlpSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/PendleGlpSY.sol/PendleGlpSY.json +1163 -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/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.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/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +182 -5
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.json +10 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.json +24 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.json +133 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.json +328 -0
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.json +467 -0
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json → Balancer/IGauge.sol/IGauge.json} +18 -33
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.json +30 -0
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.json +398 -0
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +4 -0
- package/build/artifacts/contracts/{router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json → interfaces/Balancer/IRateProvider.sol/IRateProvider.json} +5 -5
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.json +278 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +18 -0
- 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/GMX/IGMXVault.sol/IGMXVault.json +308 -0
- package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.json +43 -0
- package/build/artifacts/contracts/interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.json +165 -0
- 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/IApeStaking.sol/IApeStaking.dbg.json +4 -0
- package/build/artifacts/contracts/{LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json → interfaces/IApeStaking.sol/IApeStaking.json} +70 -52
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.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/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.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/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +105 -224
- 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/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/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/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.json +43 -32
- 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/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.json +679 -0
- package/build/artifacts/contracts/interfaces/IREDACTEDStaking.sol/IREDACTEDStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.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/IWXBTRFLY.sol/IWXBTRFLY.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- 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/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +42 -28
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +322 -0
- 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/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +257 -100
- 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 +338 -45
- 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/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/PendleSwapAggregator.sol/PendleSwapAggregator.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwapAggregator.sol/PendleSwapAggregator.json +97 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.json +65 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.json +388 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.json +101 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +215 -0
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +7 -9
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +224 -0
- package/contracts/core/BulkSeller/BulkSeller.sol +1 -1
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +1 -3
- package/contracts/core/StandardizedYield/StEthHelper.sol +71 -0
- package/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol +197 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +170 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +162 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +134 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +154 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +289 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +618 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +68 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +322 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +390 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +329 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +30 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +189 -0
- package/contracts/core/StandardizedYield/implementations/GMX/GMXPreviewHelper.sol +142 -0
- package/contracts/core/StandardizedYield/implementations/GMX/PendleGlpSY.sol +244 -0
- package/contracts/core/StandardizedYield/implementations/GMX/README.md +61 -0
- 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 +485 -0
- package/contracts/core/libraries/ArrayLib.sol +12 -0
- package/contracts/core/libraries/Errors.sol +20 -2
- package/contracts/core/libraries/TokenHelper.sol +10 -0
- package/contracts/interfaces/Balancer/IAsset.sol +4 -0
- package/contracts/interfaces/Balancer/IBalancerFees.sol +6 -0
- package/contracts/interfaces/Balancer/IBalancerStablePreview.sol +22 -0
- package/contracts/interfaces/Balancer/IBasePool.sol +30 -0
- package/contracts/interfaces/Balancer/IComposableStable.sol +39 -0
- package/contracts/interfaces/Balancer/IGauge.sol +10 -0
- package/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol +6 -0
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +31 -0
- package/contracts/interfaces/Balancer/IRateProvider.sol +6 -0
- package/contracts/interfaces/Balancer/IVault.sol +78 -0
- package/contracts/interfaces/ConvexCurve/IRewards.sol +5 -0
- package/contracts/interfaces/GMX/IGMXVault.sol +47 -0
- package/contracts/interfaces/GMX/IGlpManager.sol +8 -0
- package/contracts/interfaces/GMX/IRewardRouterV2.sol +35 -0
- package/contracts/interfaces/GMX/IVaultPriceFeed.sol +11 -0
- package/contracts/interfaces/IApeStaking.sol +30 -0
- package/contracts/interfaces/IDiamondCut.sol +36 -0
- package/contracts/interfaces/IDiamondLoupe.sol +38 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +36 -1
- package/contracts/interfaces/IPActionMintRedeem.sol +2 -55
- package/contracts/interfaces/IPActionMisc.sol +20 -3
- package/contracts/interfaces/IPActionSwapPT.sol +1 -1
- package/contracts/interfaces/IPActionSwapYT.sol +28 -4
- package/contracts/interfaces/IPAllAction.sol +5 -3
- package/contracts/interfaces/IPFeeDistributor.sol +12 -10
- package/contracts/interfaces/IPInterestManagerYTV2.sol +13 -0
- package/contracts/interfaces/IPYieldTokenV2.sol +66 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +196 -88
- package/contracts/offchain-helpers/Multicall2.sol +103 -0
- package/contracts/offchain-helpers/PendleMulticall.sol +26 -0
- package/contracts/offchain-helpers/RouterStatic.sol +94 -72
- package/contracts/router/ActionAddRemoveLiq.sol +116 -6
- 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 +98 -13
- package/contracts/router/PendleRouter.sol +211 -72
- package/contracts/router/{ActionCallback.sol → base/ActionBaseCallback.sol} +47 -47
- package/contracts/router/base/ActionBaseMintRedeem.sol +105 -60
- package/contracts/router/base/CallbackHelper.sol +137 -44
- package/contracts/router/base/MarketApproxLib.sol +227 -350
- package/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol +45 -0
- package/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol +69 -0
- package/contracts/router/swap-aggregator/IPSwapAggregator.sol +30 -0
- package/contracts/router/swap-aggregator/PendleSwapAggregator.sol +63 -0
- package/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol +214 -0
- package/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol +147 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol +17 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol +191 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol +30 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol +42 -0
- package/deployments/43113-core.json +30 -0
- package/deployments/43113-markets/APE-30-MARCH.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 +29 -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 +6 -6
- package/typechain-types/ActionAddRemoveLiq.ts +203 -23
- package/typechain-types/ActionBaseCallback.ts +115 -0
- package/typechain-types/ActionMintRedeem.ts +29 -230
- package/typechain-types/ActionMisc.ts +78 -27
- package/typechain-types/ActionSwapPT.ts +26 -31
- package/typechain-types/ActionSwapYT.ts +202 -21
- package/typechain-types/BribeDistributor.ts +363 -0
- package/typechain-types/ComposableStablePreview.ts +217 -0
- package/typechain-types/DistributorBase.ts +363 -0
- package/typechain-types/FeeDistributor.ts +416 -0
- package/typechain-types/GMXPreviewHelper.ts +121 -0
- package/typechain-types/I1inchAggregationRouterV5.ts +257 -0
- package/typechain-types/IAggregationExecutor.ts +182 -0
- package/typechain-types/IApeStaking.ts +305 -0
- package/typechain-types/IBalancerFees.ts +89 -0
- package/typechain-types/IBalancerStablePreview.ts +217 -0
- package/typechain-types/IBasePool.ts +482 -0
- package/typechain-types/IComposableStable.ts +730 -0
- package/typechain-types/IDiamondCut.ts +152 -0
- package/typechain-types/IDiamondLoupe.ts +190 -0
- package/typechain-types/IExecutorHelperEthereum1.ts +643 -0
- package/typechain-types/IGMXVault.ts +494 -0
- package/typechain-types/IGauge.ts +160 -0
- package/typechain-types/IGlpManager.ts +115 -0
- package/typechain-types/IHashflow.ts +159 -0
- package/typechain-types/IKyberSwapAggregationRouterHelper.ts +109 -0
- package/typechain-types/ILiquidityGaugeFactory.ts +99 -0
- package/typechain-types/IMetaAggregationRouter.ts +213 -0
- package/typechain-types/IMetaAggregationRouterV2.ts +221 -0
- package/typechain-types/IMetaStablePool.ts +619 -0
- package/typechain-types/IMultihopRouterEthereum.ts +209 -0
- package/typechain-types/IPActionAddRemoveLiq.ts +213 -14
- package/typechain-types/IPActionMintRedeem.ts +29 -211
- package/typechain-types/IPActionMisc.ts +78 -27
- package/typechain-types/IPActionSwapPT.ts +26 -12
- package/typechain-types/IPActionSwapYT.ts +168 -12
- package/typechain-types/IPAllAction.ts +445 -227
- package/typechain-types/IPFeeDistributor.ts +61 -78
- package/typechain-types/IPFeeDistributorFactory.ts +53 -139
- package/typechain-types/IPInterestManagerYTV2.ts +117 -0
- package/typechain-types/IPSwapAggregator.ts +126 -0
- package/typechain-types/IPYieldTokenV2.ts +901 -0
- package/typechain-types/IRateProvider.ts +81 -0
- package/typechain-types/IRewardRouterV2.ts +303 -0
- package/typechain-types/IRewards.ts +35 -5
- package/typechain-types/ISwapAggregator.ts +124 -0
- package/typechain-types/IVault.ts +410 -0
- package/typechain-types/IVaultPriceFeed.ts +114 -0
- package/typechain-types/InterestManagerYTV2.ts +157 -0
- package/typechain-types/MarketMathStatic.ts +49 -0
- package/typechain-types/MetaStableMath.ts +113 -0
- package/typechain-types/MetaStablePreview.ts +501 -0
- package/typechain-types/Multicall2.ts +437 -0
- package/typechain-types/PendleApeStakingSY.ts +1135 -0
- package/typechain-types/PendleAura3EthSY.ts +1600 -0
- package/typechain-types/PendleAuraBalancerStableLPSY.ts +1523 -0
- package/typechain-types/PendleAuraCbethWstethSY.ts +1587 -0
- package/typechain-types/PendleAuraWethRethSY.ts +1549 -0
- package/typechain-types/PendleAuraWethWstethSY.ts +1523 -0
- package/typechain-types/PendleFeeDistributor.ts +409 -117
- package/typechain-types/PendleGlpSY.ts +1463 -0
- package/typechain-types/PendleMulticall.ts +110 -0
- package/typechain-types/PendlePrincipalTokenV2.ts +614 -0
- package/typechain-types/PendleRouter.ts +109 -131
- package/typechain-types/PendleSwapAggregator.ts +167 -0
- package/typechain-types/PendleYieldContractFactoryV2.ts +801 -0
- package/typechain-types/PendleYieldTokenV2.ts +1298 -0
- package/typechain-types/RouterStatic.ts +132 -69
- package/typechain-types/SAPE.ts +1395 -0
- package/typechain-types/SYBaseAutoCompound.ts +1203 -0
- package/typechain-types/StEthHelper.ts +107 -0
- package/typechain-types/StablePreviewBase.ts +217 -0
- package/typechain-types/SwapAggregator.ts +406 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +346 -68
- package/typechain-types/factories/ActionBaseCallback__factory.ts +156 -0
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +108 -266
- package/typechain-types/factories/ActionMisc__factory.ts +56 -17
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +55 -71
- package/typechain-types/factories/ActionSwapYT__factory.ts +341 -48
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/BribeDistributor__factory.ts +303 -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/ComposableStablePreview__factory.ts +190 -0
- package/typechain-types/factories/DistributorBase__factory.ts +249 -0
- package/typechain-types/factories/Errors__factory.ts +181 -4
- package/typechain-types/factories/FeeDistributor__factory.ts +339 -0
- package/typechain-types/factories/GMXPreviewHelper__factory.ts +65 -0
- package/typechain-types/factories/I1inchAggregationRouterV5__factory.ts +179 -0
- package/typechain-types/factories/IAggregationExecutor__factory.ts +84 -0
- package/typechain-types/factories/IApeStaking__factory.ts +161 -0
- package/typechain-types/factories/IBalancerFees__factory.ts +36 -0
- package/typechain-types/factories/IBalancerStablePreview__factory.ts +152 -0
- package/typechain-types/factories/IBasePool__factory.ts +340 -0
- package/typechain-types/factories/IComposableStable__factory.ts +482 -0
- package/typechain-types/factories/IDiamondCut__factory.ts +105 -0
- package/typechain-types/factories/IDiamondLoupe__factory.ts +99 -0
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +407 -0
- package/typechain-types/factories/IGMXVault__factory.ts +320 -0
- package/typechain-types/factories/IGauge__factory.ts +70 -0
- package/typechain-types/factories/IGlpManager__factory.ts +55 -0
- package/typechain-types/factories/IHashflow__factory.ts +113 -0
- package/typechain-types/factories/IKyberSwapAggregationRouterHelper__factory.ts +56 -0
- package/typechain-types/factories/ILiquidityGaugeFactory__factory.ts +49 -0
- package/typechain-types/factories/IMetaAggregationRouterV2__factory.ts +234 -0
- package/typechain-types/factories/IMetaAggregationRouter__factory.ts +202 -0
- package/typechain-types/factories/IMetaStablePool__factory.ts +413 -0
- package/typechain-types/factories/IMultihopRouterEthereum__factory.ts +155 -0
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +338 -16
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +105 -224
- package/typechain-types/factories/IPActionMisc__factory.ts +55 -11
- package/typechain-types/factories/IPActionSwapPT__factory.ts +52 -8
- package/typechain-types/factories/IPActionSwapYT__factory.ts +231 -8
- package/typechain-types/factories/IPAllAction__factory.ts +675 -241
- package/typechain-types/factories/IPFeeDistributorFactory__factory.ts +25 -34
- package/typechain-types/factories/IPFeeDistributor__factory.ts +42 -31
- package/typechain-types/factories/IPInterestManagerYTV2__factory.ts +59 -0
- package/typechain-types/factories/IPSwapAggregator__factory.ts +71 -0
- package/typechain-types/factories/IPYieldTokenV2__factory.ts +694 -0
- package/typechain-types/factories/IRateProvider__factory.ts +36 -0
- package/typechain-types/factories/IRewardRouterV2__factory.ts +180 -0
- package/typechain-types/factories/IRewards__factory.ts +18 -0
- package/typechain-types/factories/ISwapAggregator__factory.ts +66 -0
- package/typechain-types/factories/IVaultPriceFeed__factory.ts +60 -0
- package/typechain-types/factories/IVault__factory.ts +287 -0
- package/typechain-types/factories/InterestManagerYTV2__factory.ts +81 -0
- package/typechain-types/factories/MarketMathStatic__factory.ts +41 -27
- package/typechain-types/factories/MetaStableMath__factory.ts +93 -0
- package/typechain-types/factories/MetaStablePreview__factory.ts +375 -0
- package/typechain-types/factories/Multicall2__factory.ts +372 -0
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleApeStakingSY__factory.ts +981 -0
- package/typechain-types/factories/PendleAura3EthSY__factory.ts +1326 -0
- package/typechain-types/factories/PendleAuraBalancerStableLPSY__factory.ts +1190 -0
- package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +1317 -0
- package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +1291 -0
- package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +1265 -0
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +341 -66
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- 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/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/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +75 -74
- package/typechain-types/factories/PendleSwapAggregator__factory.ts +154 -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/RouterStatic__factory.ts +186 -41
- package/typechain-types/factories/SAPE__factory.ts +1142 -0
- package/typechain-types/factories/SYBaseAutoCompound__factory.ts +942 -0
- package/typechain-types/factories/StEthHelper__factory.ts +62 -0
- package/typechain-types/factories/StablePreviewBase__factory.ts +148 -0
- package/typechain-types/factories/SwapAggregator__factory.ts +309 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +383 -86
- package/typechain-types/index.ts +90 -24
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +0 -310
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +0 -389
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +0 -190
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +0 -4
- 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/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +0 -35
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.json +0 -136
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +0 -4
- package/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol +0 -159
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +0 -99
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +0 -70
- package/contracts/interfaces/IPActionSwapPTYT.sol +0 -31
- package/contracts/interfaces/IPFeeDistributorFactory.sol +0 -14
- package/contracts/router/ActionSwapPTYT.sol +0 -108
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +0 -317
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +0 -10
- package/contracts/router/kyberswap/IMultihopRouter.sol +0 -139
- package/contracts/router/kyberswap/KyberSwapHelper.sol +0 -79
- package/deployments/1-core.json +0 -29
- 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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
pragma solidity >=0.5.0;
|
|
2
|
+
pragma experimental ABIEncoderV2;
|
|
3
|
+
|
|
4
|
+
/// @title Multicall2 - Aggregate results from multiple read-only function calls
|
|
5
|
+
/// @author Michael Elliot <mike@makerdao.com>
|
|
6
|
+
/// @author Joshua Levine <joshua@makerdao.com>
|
|
7
|
+
/// @author Nick Johnson <arachnid@notdot.net>
|
|
8
|
+
|
|
9
|
+
contract Multicall2 {
|
|
10
|
+
struct Call {
|
|
11
|
+
address target;
|
|
12
|
+
bytes callData;
|
|
13
|
+
}
|
|
14
|
+
struct Result {
|
|
15
|
+
bool success;
|
|
16
|
+
bytes returnData;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function aggregate(Call[] memory calls)
|
|
20
|
+
public
|
|
21
|
+
returns (uint256 blockNumber, bytes[] memory returnData)
|
|
22
|
+
{
|
|
23
|
+
blockNumber = block.number;
|
|
24
|
+
returnData = new bytes[](calls.length);
|
|
25
|
+
for (uint256 i = 0; i < calls.length; i++) {
|
|
26
|
+
(bool success, bytes memory ret) = calls[i].target.call(calls[i].callData);
|
|
27
|
+
require(success, "Multicall aggregate: call failed");
|
|
28
|
+
returnData[i] = ret;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function blockAndAggregate(Call[] memory calls)
|
|
33
|
+
public
|
|
34
|
+
returns (
|
|
35
|
+
uint256 blockNumber,
|
|
36
|
+
bytes32 blockHash,
|
|
37
|
+
Result[] memory returnData
|
|
38
|
+
)
|
|
39
|
+
{
|
|
40
|
+
(blockNumber, blockHash, returnData) = tryBlockAndAggregate(true, calls);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getBlockHash(uint256 blockNumber) public view returns (bytes32 blockHash) {
|
|
44
|
+
blockHash = blockhash(blockNumber);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getBlockNumber() public view returns (uint256 blockNumber) {
|
|
48
|
+
blockNumber = block.number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getCurrentBlockCoinbase() public view returns (address coinbase) {
|
|
52
|
+
coinbase = block.coinbase;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getCurrentBlockDifficulty() public view returns (uint256 difficulty) {
|
|
56
|
+
difficulty = block.difficulty;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function getCurrentBlockGasLimit() public view returns (uint256 gaslimit) {
|
|
60
|
+
gaslimit = block.gaslimit;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getCurrentBlockTimestamp() public view returns (uint256 timestamp) {
|
|
64
|
+
timestamp = block.timestamp;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function getEthBalance(address addr) public view returns (uint256 balance) {
|
|
68
|
+
balance = addr.balance;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function getLastBlockHash() public view returns (bytes32 blockHash) {
|
|
72
|
+
blockHash = blockhash(block.number - 1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function tryAggregate(bool requireSuccess, Call[] memory calls)
|
|
76
|
+
public
|
|
77
|
+
returns (Result[] memory returnData)
|
|
78
|
+
{
|
|
79
|
+
returnData = new Result[](calls.length);
|
|
80
|
+
for (uint256 i = 0; i < calls.length; i++) {
|
|
81
|
+
(bool success, bytes memory ret) = calls[i].target.call(calls[i].callData);
|
|
82
|
+
|
|
83
|
+
if (requireSuccess) {
|
|
84
|
+
require(success, "Multicall2 aggregate: call failed");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
returnData[i] = Result(success, ret);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function tryBlockAndAggregate(bool requireSuccess, Call[] memory calls)
|
|
92
|
+
public
|
|
93
|
+
returns (
|
|
94
|
+
uint256 blockNumber,
|
|
95
|
+
bytes32 blockHash,
|
|
96
|
+
Result[] memory returnData
|
|
97
|
+
)
|
|
98
|
+
{
|
|
99
|
+
blockNumber = block.number;
|
|
100
|
+
blockHash = blockhash(block.number);
|
|
101
|
+
returnData = tryAggregate(requireSuccess, calls);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
/// @title PendleMulticall - A more gas-efficient version of Multicall3 (~700 gas saved for each call)
|
|
5
|
+
/// @author UncleGrandpa925 <longvh@pendle.finance>
|
|
6
|
+
contract PendleMulticall {
|
|
7
|
+
error MulticallFailed(uint256 index);
|
|
8
|
+
|
|
9
|
+
struct Call {
|
|
10
|
+
address target;
|
|
11
|
+
bytes callData;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function aggregate(Call[] calldata calls) external payable {
|
|
15
|
+
uint256 length = calls.length;
|
|
16
|
+
Call calldata call;
|
|
17
|
+
for (uint256 i = 0; i < length; ) {
|
|
18
|
+
call = calls[i];
|
|
19
|
+
(bool success, ) = call.target.call(call.callData);
|
|
20
|
+
if (!success) revert MulticallFailed(i);
|
|
21
|
+
unchecked {
|
|
22
|
+
++i;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -14,9 +14,10 @@ import "../LiquidityMining/libraries/VeBalanceLib.sol";
|
|
|
14
14
|
|
|
15
15
|
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
16
16
|
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
17
|
+
import "@openzeppelin/contracts/proxy/Proxy.sol";
|
|
17
18
|
|
|
18
19
|
/// EXCLUDED FROM ALL AUDITS, TO BE CALLED ONLY BY PENDLE's SDK
|
|
19
|
-
contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeable {
|
|
20
|
+
contract RouterStatic is Initializable, Proxy, BoringOwnableUpgradeable, UUPSUpgradeable {
|
|
20
21
|
using Math for uint256;
|
|
21
22
|
using VeBalanceLib for VeBalance;
|
|
22
23
|
using VeBalanceLib for LockedPosition;
|
|
@@ -62,32 +63,29 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
62
63
|
IPMarketFactory internal immutable marketFactory;
|
|
63
64
|
IPVotingEscrowMainchain internal immutable vePENDLE;
|
|
64
65
|
IPBulkSellerFactory internal immutable bulkFactory;
|
|
66
|
+
address internal immutable marketMathStaticLib;
|
|
65
67
|
|
|
66
68
|
constructor(
|
|
67
69
|
IPYieldContractFactory _yieldContractFactory,
|
|
68
70
|
IPMarketFactory _marketFactory,
|
|
69
71
|
IPVotingEscrowMainchain _vePENDLE,
|
|
70
|
-
IPBulkSellerFactory _bulkFactory
|
|
72
|
+
IPBulkSellerFactory _bulkFactory,
|
|
73
|
+
address _marketMathStaticLib
|
|
71
74
|
) initializer {
|
|
72
75
|
yieldContractFactory = _yieldContractFactory;
|
|
73
76
|
marketFactory = _marketFactory;
|
|
74
77
|
vePENDLE = _vePENDLE;
|
|
75
78
|
bulkFactory = _bulkFactory;
|
|
79
|
+
marketMathStaticLib = _marketMathStaticLib;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
// all Market-related functions will go to MarketMathStaticLib
|
|
83
|
+
function _implementation() internal view override returns (address) {
|
|
84
|
+
return marketMathStaticLib;
|
|
80
85
|
}
|
|
81
86
|
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
ApproxParams({
|
|
85
|
-
guessMin: 0,
|
|
86
|
-
guessMax: type(uint256).max,
|
|
87
|
-
guessOffchain: 0,
|
|
88
|
-
maxIteration: 256,
|
|
89
|
-
eps: 1e14
|
|
90
|
-
});
|
|
87
|
+
function initialize() external initializer {
|
|
88
|
+
__BoringOwnable_init();
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
|
@@ -158,7 +156,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
158
156
|
sy = address(SY);
|
|
159
157
|
state = _market.readState(address(this));
|
|
160
158
|
impliedYield = getPtImpliedYield(market);
|
|
161
|
-
exchangeRate = MarketMathStatic.
|
|
159
|
+
exchangeRate = MarketMathStatic.getTradeExchangeRateExcludeFee(market);
|
|
162
160
|
}
|
|
163
161
|
|
|
164
162
|
// ============= USER INFO =============
|
|
@@ -325,11 +323,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
325
323
|
uint256 netLpOut,
|
|
326
324
|
uint256 netPtToSwap,
|
|
327
325
|
uint256 netSyFee,
|
|
328
|
-
uint256 priceImpact
|
|
326
|
+
uint256 priceImpact,
|
|
327
|
+
uint256 exchangeRateAfter
|
|
329
328
|
)
|
|
330
329
|
{
|
|
331
|
-
return
|
|
332
|
-
MarketMathStatic.addLiquiditySinglePtStatic(market, netPtIn, getDefaultApproxParams());
|
|
330
|
+
return MarketMathStatic.addLiquiditySinglePtStatic(market, netPtIn);
|
|
333
331
|
}
|
|
334
332
|
|
|
335
333
|
function addLiquiditySingleSyStatic(address market, uint256 netSyIn)
|
|
@@ -338,11 +336,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
338
336
|
uint256 netLpOut,
|
|
339
337
|
uint256 netPtFromSwap,
|
|
340
338
|
uint256 netSyFee,
|
|
341
|
-
uint256 priceImpact
|
|
339
|
+
uint256 priceImpact,
|
|
340
|
+
uint256 exchangeRateAfter
|
|
342
341
|
)
|
|
343
342
|
{
|
|
344
|
-
return
|
|
345
|
-
MarketMathStatic.addLiquiditySingleSyStatic(market, netSyIn, getDefaultApproxParams());
|
|
343
|
+
return MarketMathStatic.addLiquiditySingleSyStatic(market, netSyIn);
|
|
346
344
|
}
|
|
347
345
|
|
|
348
346
|
function addLiquiditySingleBaseTokenStatic(
|
|
@@ -356,7 +354,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
356
354
|
uint256 netLpOut,
|
|
357
355
|
uint256 netPtFromSwap,
|
|
358
356
|
uint256 netSyFee,
|
|
359
|
-
uint256 priceImpact
|
|
357
|
+
uint256 priceImpact,
|
|
358
|
+
uint256 exchangeRateAfter
|
|
360
359
|
)
|
|
361
360
|
{
|
|
362
361
|
uint256 netSyIn = previewDepositStatic(
|
|
@@ -366,8 +365,29 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
366
365
|
bulk
|
|
367
366
|
);
|
|
368
367
|
|
|
369
|
-
return
|
|
370
|
-
|
|
368
|
+
return MarketMathStatic.addLiquiditySingleSyStatic(market, netSyIn);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function addLiquiditySingleSyKeepYtStatic(address market, uint256 netSyIn)
|
|
372
|
+
external
|
|
373
|
+
returns (uint256 netLpOut, uint256 netYtOut)
|
|
374
|
+
{
|
|
375
|
+
return MarketMathStatic.addLiquiditySingleSyKeepYtStatic(market, netSyIn);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function addLiquiditySingleTokenKeepYtStatic(
|
|
379
|
+
address market,
|
|
380
|
+
address baseToken,
|
|
381
|
+
uint256 netBaseTokenIn,
|
|
382
|
+
address bulk
|
|
383
|
+
) external returns (uint256 netLpOut, uint256 netYtOut) {
|
|
384
|
+
uint256 netSyIn = previewDepositStatic(
|
|
385
|
+
getSyMarket(market),
|
|
386
|
+
baseToken,
|
|
387
|
+
netBaseTokenIn,
|
|
388
|
+
bulk
|
|
389
|
+
);
|
|
390
|
+
return MarketMathStatic.addLiquiditySingleSyKeepYtStatic(market, netSyIn);
|
|
371
391
|
}
|
|
372
392
|
|
|
373
393
|
function removeLiquidityDualSyAndPtStatic(address market, uint256 netLpToRemove)
|
|
@@ -400,15 +420,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
400
420
|
uint256 netPtOut,
|
|
401
421
|
uint256 netPtFromSwap,
|
|
402
422
|
uint256 netSyFee,
|
|
403
|
-
uint256 priceImpact
|
|
423
|
+
uint256 priceImpact,
|
|
424
|
+
uint256 exchangeRateAfter
|
|
404
425
|
)
|
|
405
426
|
{
|
|
406
|
-
return
|
|
407
|
-
MarketMathStatic.removeLiquiditySinglePtStatic(
|
|
408
|
-
market,
|
|
409
|
-
netLpToRemove,
|
|
410
|
-
getDefaultApproxParams()
|
|
411
|
-
);
|
|
427
|
+
return MarketMathStatic.removeLiquiditySinglePtStatic(market, netLpToRemove);
|
|
412
428
|
}
|
|
413
429
|
|
|
414
430
|
function removeLiquiditySingleSyStatic(address market, uint256 netLpToRemove)
|
|
@@ -416,7 +432,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
416
432
|
returns (
|
|
417
433
|
uint256 netSyOut,
|
|
418
434
|
uint256 netSyFee,
|
|
419
|
-
uint256 priceImpact
|
|
435
|
+
uint256 priceImpact,
|
|
436
|
+
uint256 exchangeRateAfter
|
|
420
437
|
)
|
|
421
438
|
{
|
|
422
439
|
return MarketMathStatic.removeLiquiditySingleSyStatic(market, netLpToRemove);
|
|
@@ -432,15 +449,14 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
432
449
|
returns (
|
|
433
450
|
uint256 netBaseTokenOut,
|
|
434
451
|
uint256 netSyFee,
|
|
435
|
-
uint256 priceImpact
|
|
452
|
+
uint256 priceImpact,
|
|
453
|
+
uint256 exchangeRateAfter
|
|
436
454
|
)
|
|
437
455
|
{
|
|
438
456
|
uint256 netSyOut;
|
|
439
457
|
|
|
440
|
-
(netSyOut, netSyFee, priceImpact) = MarketMathStatic
|
|
441
|
-
market,
|
|
442
|
-
netLpToRemove
|
|
443
|
-
);
|
|
458
|
+
(netSyOut, netSyFee, priceImpact, exchangeRateAfter) = MarketMathStatic
|
|
459
|
+
.removeLiquiditySingleSyStatic(market, netLpToRemove);
|
|
444
460
|
|
|
445
461
|
netBaseTokenOut = previewRedeemStatic(getSyMarket(market), baseToken, netSyOut, bulk);
|
|
446
462
|
}
|
|
@@ -450,7 +466,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
450
466
|
returns (
|
|
451
467
|
uint256 netSyOut,
|
|
452
468
|
uint256 netSyFee,
|
|
453
|
-
uint256 priceImpact
|
|
469
|
+
uint256 priceImpact,
|
|
470
|
+
uint256 exchangeRateAfter
|
|
454
471
|
)
|
|
455
472
|
{
|
|
456
473
|
return MarketMathStatic.swapExactPtForSyStatic(market, exactPtIn);
|
|
@@ -461,7 +478,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
461
478
|
returns (
|
|
462
479
|
uint256 netSyIn,
|
|
463
480
|
uint256 netSyFee,
|
|
464
|
-
uint256 priceImpact
|
|
481
|
+
uint256 priceImpact,
|
|
482
|
+
uint256 exchangeRateAfter
|
|
465
483
|
)
|
|
466
484
|
{
|
|
467
485
|
return MarketMathStatic.swapSyForExactPtStatic(market, exactPtOut);
|
|
@@ -472,11 +490,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
472
490
|
returns (
|
|
473
491
|
uint256 netPtOut,
|
|
474
492
|
uint256 netSyFee,
|
|
475
|
-
uint256 priceImpact
|
|
493
|
+
uint256 priceImpact,
|
|
494
|
+
uint256 exchangeRateAfter
|
|
476
495
|
)
|
|
477
496
|
{
|
|
478
|
-
return
|
|
479
|
-
MarketMathStatic.swapExactSyForPtStatic(market, exactSyIn, getDefaultApproxParams());
|
|
497
|
+
return MarketMathStatic.swapExactSyForPtStatic(market, exactSyIn);
|
|
480
498
|
}
|
|
481
499
|
|
|
482
500
|
function swapPtForExactSyStatic(address market, uint256 exactSyOut)
|
|
@@ -484,11 +502,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
484
502
|
returns (
|
|
485
503
|
uint256 netPtIn,
|
|
486
504
|
uint256 netSyFee,
|
|
487
|
-
uint256 priceImpact
|
|
505
|
+
uint256 priceImpact,
|
|
506
|
+
uint256 exchangeRateAfter
|
|
488
507
|
)
|
|
489
508
|
{
|
|
490
|
-
return
|
|
491
|
-
MarketMathStatic.swapPtForExactSyStatic(market, exactSyOut, getDefaultApproxParams());
|
|
509
|
+
return MarketMathStatic.swapPtForExactSyStatic(market, exactSyOut);
|
|
492
510
|
}
|
|
493
511
|
|
|
494
512
|
function swapExactBaseTokenForPtStatic(
|
|
@@ -501,7 +519,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
501
519
|
returns (
|
|
502
520
|
uint256 netPtOut,
|
|
503
521
|
uint256 netSyFee,
|
|
504
|
-
uint256 priceImpact
|
|
522
|
+
uint256 priceImpact,
|
|
523
|
+
uint256 exchangeRateAfter
|
|
505
524
|
)
|
|
506
525
|
{
|
|
507
526
|
uint256 netSyIn = previewDepositStatic(
|
|
@@ -510,7 +529,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
510
529
|
amountBaseToken,
|
|
511
530
|
bulk
|
|
512
531
|
);
|
|
513
|
-
return MarketMathStatic.swapExactSyForPtStatic(market, netSyIn
|
|
532
|
+
return MarketMathStatic.swapExactSyForPtStatic(market, netSyIn);
|
|
514
533
|
}
|
|
515
534
|
|
|
516
535
|
function swapExactPtForBaseTokenStatic(
|
|
@@ -523,14 +542,13 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
523
542
|
returns (
|
|
524
543
|
uint256 netBaseTokenOut,
|
|
525
544
|
uint256 netSyFee,
|
|
526
|
-
uint256 priceImpact
|
|
545
|
+
uint256 priceImpact,
|
|
546
|
+
uint256 exchangeRateAfter
|
|
527
547
|
)
|
|
528
548
|
{
|
|
529
549
|
uint256 netSyOut;
|
|
530
|
-
(netSyOut, netSyFee, priceImpact) = MarketMathStatic
|
|
531
|
-
market,
|
|
532
|
-
exactPtIn
|
|
533
|
-
);
|
|
550
|
+
(netSyOut, netSyFee, priceImpact, exchangeRateAfter) = MarketMathStatic
|
|
551
|
+
.swapExactPtForSyStatic(market, exactPtIn);
|
|
534
552
|
|
|
535
553
|
netBaseTokenOut = previewRedeemStatic(getSyMarket(market), baseToken, netSyOut, bulk);
|
|
536
554
|
}
|
|
@@ -540,7 +558,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
540
558
|
returns (
|
|
541
559
|
uint256 netSyIn,
|
|
542
560
|
uint256 netSyFee,
|
|
543
|
-
uint256 priceImpact
|
|
561
|
+
uint256 priceImpact,
|
|
562
|
+
uint256 exchangeRateAfter
|
|
544
563
|
)
|
|
545
564
|
{
|
|
546
565
|
return MarketMathStatic.swapSyForExactYtStatic(market, exactYtOut);
|
|
@@ -551,11 +570,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
551
570
|
returns (
|
|
552
571
|
uint256 netYtOut,
|
|
553
572
|
uint256 netSyFee,
|
|
554
|
-
uint256 priceImpact
|
|
573
|
+
uint256 priceImpact,
|
|
574
|
+
uint256 exchangeRateAfter
|
|
555
575
|
)
|
|
556
576
|
{
|
|
557
|
-
return
|
|
558
|
-
MarketMathStatic.swapExactSyForYtStatic(market, exactSyIn, getDefaultApproxParams());
|
|
577
|
+
return MarketMathStatic.swapExactSyForYtStatic(market, exactSyIn);
|
|
559
578
|
}
|
|
560
579
|
|
|
561
580
|
function swapExactYtForSyStatic(address market, uint256 exactYtIn)
|
|
@@ -563,7 +582,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
563
582
|
returns (
|
|
564
583
|
uint256 netSyOut,
|
|
565
584
|
uint256 netSyFee,
|
|
566
|
-
uint256 priceImpact
|
|
585
|
+
uint256 priceImpact,
|
|
586
|
+
uint256 exchangeRateAfter
|
|
567
587
|
)
|
|
568
588
|
{
|
|
569
589
|
return MarketMathStatic.swapExactYtForSyStatic(market, exactYtIn);
|
|
@@ -574,11 +594,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
574
594
|
returns (
|
|
575
595
|
uint256 netYtIn,
|
|
576
596
|
uint256 netSyFee,
|
|
577
|
-
uint256 priceImpact
|
|
597
|
+
uint256 priceImpact,
|
|
598
|
+
uint256 exchangeRateAfter
|
|
578
599
|
)
|
|
579
600
|
{
|
|
580
|
-
return
|
|
581
|
-
MarketMathStatic.swapYtForExactSyStatic(market, exactSyOut, getDefaultApproxParams());
|
|
601
|
+
return MarketMathStatic.swapYtForExactSyStatic(market, exactSyOut);
|
|
582
602
|
}
|
|
583
603
|
|
|
584
604
|
function swapExactYtForBaseTokenStatic(
|
|
@@ -591,14 +611,13 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
591
611
|
returns (
|
|
592
612
|
uint256 netBaseTokenOut,
|
|
593
613
|
uint256 netSyFee,
|
|
594
|
-
uint256 priceImpact
|
|
614
|
+
uint256 priceImpact,
|
|
615
|
+
uint256 exchangeRateAfter
|
|
595
616
|
)
|
|
596
617
|
{
|
|
597
618
|
uint256 netSyOut;
|
|
598
|
-
(netSyOut, netSyFee, priceImpact) = MarketMathStatic
|
|
599
|
-
market,
|
|
600
|
-
exactYtIn
|
|
601
|
-
);
|
|
619
|
+
(netSyOut, netSyFee, priceImpact, exchangeRateAfter) = MarketMathStatic
|
|
620
|
+
.swapExactYtForSyStatic(market, exactYtIn);
|
|
602
621
|
|
|
603
622
|
netBaseTokenOut = previewRedeemStatic(getSyMarket(market), baseToken, netSyOut, bulk);
|
|
604
623
|
}
|
|
@@ -613,7 +632,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
613
632
|
returns (
|
|
614
633
|
uint256 netYtOut,
|
|
615
634
|
uint256 netSyFee,
|
|
616
|
-
uint256 priceImpact
|
|
635
|
+
uint256 priceImpact,
|
|
636
|
+
uint256 exchangeRateAfter
|
|
617
637
|
)
|
|
618
638
|
{
|
|
619
639
|
uint256 netSyIn = previewDepositStatic(
|
|
@@ -623,7 +643,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
623
643
|
bulk
|
|
624
644
|
);
|
|
625
645
|
|
|
626
|
-
return MarketMathStatic.swapExactSyForYtStatic(market, netSyIn
|
|
646
|
+
return MarketMathStatic.swapExactSyForYtStatic(market, netSyIn);
|
|
627
647
|
}
|
|
628
648
|
|
|
629
649
|
function swapExactPtForYtStatic(address market, uint256 exactPtIn)
|
|
@@ -632,10 +652,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
632
652
|
uint256 netYtOut,
|
|
633
653
|
uint256 totalPtToSwap,
|
|
634
654
|
uint256 netSyFee,
|
|
635
|
-
uint256 priceImpact
|
|
655
|
+
uint256 priceImpact,
|
|
656
|
+
uint256 exchangeRateAfter
|
|
636
657
|
)
|
|
637
658
|
{
|
|
638
|
-
return MarketMathStatic.swapExactPtForYt(market, exactPtIn
|
|
659
|
+
return MarketMathStatic.swapExactPtForYt(market, exactPtIn);
|
|
639
660
|
}
|
|
640
661
|
|
|
641
662
|
function swapExactYtForPtStatic(address market, uint256 exactYtIn)
|
|
@@ -644,10 +665,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
644
665
|
uint256 netPtOut,
|
|
645
666
|
uint256 totalPtSwapped,
|
|
646
667
|
uint256 netSyFee,
|
|
647
|
-
uint256 priceImpact
|
|
668
|
+
uint256 priceImpact,
|
|
669
|
+
uint256 exchangeRateAfter
|
|
648
670
|
)
|
|
649
671
|
{
|
|
650
|
-
return MarketMathStatic.swapExactYtForPt(market, exactYtIn
|
|
672
|
+
return MarketMathStatic.swapExactYtForPt(market, exactYtIn);
|
|
651
673
|
}
|
|
652
674
|
|
|
653
675
|
// ============= vePENDLE =============
|
|
@@ -778,7 +800,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
778
800
|
public
|
|
779
801
|
returns (uint256 priceImpact)
|
|
780
802
|
{
|
|
781
|
-
return MarketMathStatic.
|
|
803
|
+
return MarketMathStatic.calcPriceImpactPt(market, netPtOut);
|
|
782
804
|
}
|
|
783
805
|
|
|
784
806
|
// either but not both pyToken or market must be != 0
|
|
@@ -803,7 +825,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
803
825
|
address bulk,
|
|
804
826
|
uint256 netSyOut
|
|
805
827
|
) public view returns (uint256 netTokenIn) {
|
|
806
|
-
uint256 pivotAmount =
|
|
828
|
+
uint256 pivotAmount = 10**IERC20Metadata(tokenIn).decimals();
|
|
807
829
|
|
|
808
830
|
uint256 low = pivotAmount;
|
|
809
831
|
{
|
|
@@ -21,13 +21,9 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
|
|
|
21
21
|
using MarketApproxPtInLib for MarketState;
|
|
22
22
|
using MarketApproxPtOutLib for MarketState;
|
|
23
23
|
using PYIndexLib for IPYieldToken;
|
|
24
|
+
using PYIndexLib for PYIndex;
|
|
24
25
|
using BulkSellerMathCore for BulkSellerState;
|
|
25
26
|
|
|
26
|
-
/// @dev since this contract will be proxied, it must not contains non-immutable variables
|
|
27
|
-
constructor(address _kyberScalingLib)
|
|
28
|
-
ActionBaseMintRedeem(_kyberScalingLib) //solhint-disable-next-line no-empty-blocks
|
|
29
|
-
{}
|
|
30
|
-
|
|
31
27
|
/**
|
|
32
28
|
* @notice Adds liquidity to the SY/PT market, granting LP tokens in return
|
|
33
29
|
* @dev Will mint as much LP as possible given no more than `netSyDesired` and `netPtDesired`,
|
|
@@ -258,6 +254,78 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
|
|
|
258
254
|
);
|
|
259
255
|
}
|
|
260
256
|
|
|
257
|
+
/**
|
|
258
|
+
* @notice Mints partial SY to PT+YT, returns YT to user, then uses PT+SY to add liquidity
|
|
259
|
+
* @param netSyIn amount of SY to be transferred in from caller
|
|
260
|
+
* @return netLpOut actual LP output, will not be lower than `minLpOut`
|
|
261
|
+
* @return netYtOut actual YT output, will not be lower than `minYtOut`
|
|
262
|
+
* @dev Reverts if market is expired
|
|
263
|
+
*/
|
|
264
|
+
function addLiquiditySingleSyKeepYt(
|
|
265
|
+
address receiver,
|
|
266
|
+
address market,
|
|
267
|
+
uint256 netSyIn,
|
|
268
|
+
uint256 minLpOut,
|
|
269
|
+
uint256 minYtOut
|
|
270
|
+
) external returns (uint256 netLpOut, uint256 netYtOut) {
|
|
271
|
+
(IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
272
|
+
|
|
273
|
+
_transferIn(address(SY), msg.sender, netSyIn);
|
|
274
|
+
|
|
275
|
+
(netLpOut, netYtOut) = _addLiquiditySingleSyKeepYt(
|
|
276
|
+
receiver,
|
|
277
|
+
market,
|
|
278
|
+
SY,
|
|
279
|
+
YT,
|
|
280
|
+
netSyIn,
|
|
281
|
+
minLpOut,
|
|
282
|
+
minYtOut
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
emit AddLiquiditySingleSyKeepYt(msg.sender, market, receiver, netSyIn, netLpOut, netYtOut);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @notice Adds liquidity and returns leftover YT using a single token input. The input token
|
|
290
|
+
* is first swapped through Kyberswap to a SY-mintable token, the rest is the same as
|
|
291
|
+
* `addLiquiditySingleSyKeepYt()`
|
|
292
|
+
* @param input data for input token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
293
|
+
* @return netLpOut actual LP output, will not be lower than `minLpOut`
|
|
294
|
+
* @return netYtOut actual YT output, will not be lower than `minYtOut`
|
|
295
|
+
* @dev Reverts if market is expired
|
|
296
|
+
*/
|
|
297
|
+
function addLiquiditySingleTokenKeepYt(
|
|
298
|
+
address receiver,
|
|
299
|
+
address market,
|
|
300
|
+
uint256 minLpOut,
|
|
301
|
+
uint256 minYtOut,
|
|
302
|
+
TokenInput calldata input
|
|
303
|
+
) external returns (uint256 netLpOut, uint256 netYtOut) {
|
|
304
|
+
(IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
305
|
+
|
|
306
|
+
uint256 netSyUsed = _mintSyFromToken(address(this), address(SY), 1, input);
|
|
307
|
+
|
|
308
|
+
(netLpOut, netYtOut) = _addLiquiditySingleSyKeepYt(
|
|
309
|
+
receiver,
|
|
310
|
+
market,
|
|
311
|
+
SY,
|
|
312
|
+
YT,
|
|
313
|
+
netSyUsed,
|
|
314
|
+
minLpOut,
|
|
315
|
+
minYtOut
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
emit AddLiquiditySingleTokenKeepYt(
|
|
319
|
+
msg.sender,
|
|
320
|
+
market,
|
|
321
|
+
input.tokenIn,
|
|
322
|
+
receiver,
|
|
323
|
+
input.netTokenIn,
|
|
324
|
+
netLpOut,
|
|
325
|
+
netYtOut
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
261
329
|
/**
|
|
262
330
|
* @notice Burns LP token to remove SY/PT liquidity
|
|
263
331
|
* @param netLpToRemove amount of LP to be burned from caller
|
|
@@ -473,6 +541,48 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
|
|
|
473
541
|
if (netLpOut < minLpOut) revert Errors.RouterInsufficientLpOut(netLpOut, minLpOut);
|
|
474
542
|
}
|
|
475
543
|
|
|
544
|
+
/**
|
|
545
|
+
* @dev algorithm:
|
|
546
|
+
- Split SY into a SY and b SY (with a + b = netSyIn)
|
|
547
|
+
- Mint PY with a SY ---> gives (a * pyIndex / ONE) PT + YT
|
|
548
|
+
- Mint LP with (a * pyIndex / ONE) PT and b SY
|
|
549
|
+
|
|
550
|
+
-> We want (a * pyIndex / ONE) / totalPt = b / totalSy
|
|
551
|
+
-> a * (1 + pyIndex * totalSy / ONE / totalPt) = netSyIn
|
|
552
|
+
-> a = (netSyIn * totalPt) / (totalPt + (pyIndex * totalSy / ONE))
|
|
553
|
+
-> a = (netSyIn * totalPt) / (totalPt + totalAsset)
|
|
554
|
+
*/
|
|
555
|
+
function _addLiquiditySingleSyKeepYt(
|
|
556
|
+
address receiver,
|
|
557
|
+
address market,
|
|
558
|
+
IStandardizedYield SY,
|
|
559
|
+
IPYieldToken YT,
|
|
560
|
+
uint256 netSyIn,
|
|
561
|
+
uint256 minLpOut,
|
|
562
|
+
uint256 minYtOut
|
|
563
|
+
) internal returns (uint256 netLpOut, uint256 netYtOut) {
|
|
564
|
+
MarketState memory state = IPMarket(market).readState(address(this));
|
|
565
|
+
|
|
566
|
+
PYIndex pyIndex = YT.newIndex();
|
|
567
|
+
|
|
568
|
+
uint256 netSyToPt = (netSyIn * state.totalPt.Uint()) /
|
|
569
|
+
(state.totalPt.Uint() + pyIndex.syToAsset(state.totalSy.Uint()));
|
|
570
|
+
|
|
571
|
+
// transfer SY to mint PY
|
|
572
|
+
_transferOut(address(SY), address(YT), netSyToPt);
|
|
573
|
+
|
|
574
|
+
// the rest of SY goes to market
|
|
575
|
+
_transferOut(address(SY), market, netSyIn - netSyToPt);
|
|
576
|
+
|
|
577
|
+
// PT goes to market, YT goes to receiver
|
|
578
|
+
netYtOut = YT.mintPY(market, receiver);
|
|
579
|
+
|
|
580
|
+
(netLpOut, , ) = IPMarket(market).mint(receiver, netSyIn - netSyToPt, netYtOut);
|
|
581
|
+
|
|
582
|
+
if (netLpOut < minLpOut) revert Errors.RouterInsufficientLpOut(netLpOut, minLpOut);
|
|
583
|
+
if (netYtOut < minYtOut) revert Errors.RouterInsufficientYtOut(netYtOut, minYtOut);
|
|
584
|
+
}
|
|
585
|
+
|
|
476
586
|
/// @dev removes SY/PT liquidity, then converts PT to SY
|
|
477
587
|
function _removeLiquiditySingleSy(
|
|
478
588
|
address receiver,
|
|
@@ -497,7 +607,7 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
|
|
|
497
607
|
) internal returns (uint256 netSyOut) {
|
|
498
608
|
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
499
609
|
(uint256 syFromBurn, ) = IPMarket(market).burn(receiver, address(YT), netLpToRemove);
|
|
500
|
-
netSyOut = syFromBurn +
|
|
610
|
+
netSyOut = syFromBurn + YT.redeemPY(receiver);
|
|
501
611
|
}
|
|
502
612
|
|
|
503
613
|
/// @dev swaps PT to SY pre-expiry
|