@pendle/core-v2 0.17.4-testnet → 0.17.6-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/ExcessivelySafeCall.sol/ExcessivelySafeCall.json +2 -2
- 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/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +26 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +28 -3
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +28 -3
- 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/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 +22 -28
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +3 -22
- 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/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/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/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/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 +2 -18
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.json +2 -2
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.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/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.json +187 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json +0 -19
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.json +26 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.json +26 -1
- 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/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/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +2 -2
- 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 +2 -2
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +160 -60
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.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/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol +1 -4
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +6 -5
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +1 -4
- package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +9 -6
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +11 -21
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +0 -3
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +0 -3
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +34 -54
- package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +6 -25
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +20 -38
- package/contracts/LiquidityMining/libraries/VeHistoryLib.sol +1 -1
- package/contracts/core/BulkSeller/BulkSeller.sol +35 -42
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +5 -9
- package/contracts/core/BulkSeller/BulkSellerMathCore.sol +6 -5
- package/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol +1 -3
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +1 -1
- package/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol +1 -1
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +1 -1
- package/contracts/core/YieldContracts/PendleYieldToken.sol +6 -6
- package/contracts/core/erc20/PendleERC20.sol +2 -2
- package/contracts/core/erc20/PendleERC20Permit.sol +1 -1
- package/contracts/core/libraries/ArrayLib.sol +1 -1
- package/contracts/core/libraries/BoringOwnableUpgradeable.sol +1 -1
- package/contracts/core/libraries/Errors.sol +0 -1
- package/contracts/core/libraries/MiniHelpers.sol +1 -0
- package/contracts/core/libraries/TokenHelper.sol +4 -5
- package/contracts/interfaces/Curve/ICrvPool.sol +3 -4
- package/contracts/interfaces/Curve/ITriCrvPool.sol +1 -4
- package/contracts/interfaces/IBoringOwnableUpgradeable.sol +2 -2
- package/contracts/interfaces/ILayerZeroEndpoint.sol +1 -1
- package/contracts/interfaces/ILayerZeroReceiver.sol +8 -3
- package/contracts/interfaces/IPBulkSeller.sol +30 -6
- package/contracts/interfaces/IPBulkSellerFactory.sol +0 -2
- package/contracts/interfaces/IPGaugeController.sol +7 -1
- package/contracts/interfaces/IPMarket.sol +2 -12
- package/contracts/interfaces/IPMsgReceiverApp.sol +1 -1
- package/contracts/interfaces/IPMsgSendEndpoint.sol +1 -1
- package/contracts/interfaces/IPVeToken.sol +1 -1
- package/contracts/interfaces/IREDACTEDStaking.sol +1 -1
- package/contracts/interfaces/IStETH.sol +1 -1
- package/contracts/interfaces/IStargateLPStaking.sol +1 -1
- package/contracts/interfaces/IStargatePool.sol +1 -1
- package/contracts/interfaces/IStargateRouter.sol +1 -1
- package/contracts/interfaces/IWXBTRFLY.sol +1 -1
- package/contracts/offchain-helpers/MarketMathStatic.sol +152 -34
- package/contracts/offchain-helpers/RouterStatic.sol +58 -32
- package/contracts/router/ActionAddRemoveLiq.sol +2 -2
- package/contracts/router/ActionMintRedeem.sol +4 -4
- package/contracts/router/ActionSwapPT.sol +4 -4
- package/contracts/router/ActionSwapPTYT.sol +1 -1
- package/contracts/router/ActionSwapYT.sol +8 -8
- package/contracts/router/base/ActionBaseMintRedeem.sol +6 -7
- package/contracts/router/base/MarketApproxLib.sol +14 -8
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +1 -1
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +1 -1
- package/contracts/router/kyberswap/IMultihopRouter.sol +1 -1
- package/deployments/43113-core.json +1 -1
- package/deployments/43113-markets/USDC-FEB-4TH.json +10 -0
- package/deployments/43113-markets/WETH-FEB-4TH.json +11 -0
- package/package.json +1 -1
- package/typechain-types/BulkSeller.ts +59 -6
- package/typechain-types/BulkSellerFactory.ts +0 -16
- package/typechain-types/IApeStaking.ts +274 -0
- package/typechain-types/IPBulkSeller.ts +178 -9
- package/typechain-types/IPBulkSellerFactory.ts +0 -16
- package/typechain-types/IPGaugeController.ts +23 -2
- package/typechain-types/IPGaugeControllerMainchain.ts +23 -2
- package/typechain-types/PendleApeStakingSY.ts +1251 -0
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +23 -2
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +23 -2
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +23 -2
- package/typechain-types/RouterStatic.ts +40 -20
- package/typechain-types/SYBaseAutoCompound.ts +1203 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
- 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/BulkSellerFactory__factory.ts +2 -21
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
- package/typechain-types/factories/BulkSeller__factory.ts +21 -27
- package/typechain-types/factories/Errors__factory.ts +1 -17
- package/typechain-types/factories/IApeStaking__factory.ts +127 -0
- package/typechain-types/factories/IPBulkSellerFactory__factory.ts +0 -19
- package/typechain-types/factories/IPBulkSeller__factory.ts +187 -1
- package/typechain-types/factories/IPGaugeControllerMainchain__factory.ts +26 -1
- package/typechain-types/factories/IPGaugeController__factory.ts +26 -1
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -1
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleApeStakingSY__factory.ts +1065 -0
- 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/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +26 -1
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +27 -2
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +27 -2
- 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/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 +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +101 -1
- package/typechain-types/factories/SYBaseAutoCompound__factory.ts +942 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
|
@@ -158,7 +158,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
158
158
|
sy = address(SY);
|
|
159
159
|
state = _market.readState(address(this));
|
|
160
160
|
impliedYield = getPtImpliedYield(market);
|
|
161
|
-
exchangeRate = MarketMathStatic.
|
|
161
|
+
exchangeRate = MarketMathStatic.getTradeExchangeRateExcludeFee(market);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
// ============= USER INFO =============
|
|
@@ -325,7 +325,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
325
325
|
uint256 netLpOut,
|
|
326
326
|
uint256 netPtToSwap,
|
|
327
327
|
uint256 netSyFee,
|
|
328
|
-
uint256 priceImpact
|
|
328
|
+
uint256 priceImpact,
|
|
329
|
+
uint256 exchangeRateAfter
|
|
329
330
|
)
|
|
330
331
|
{
|
|
331
332
|
return
|
|
@@ -338,7 +339,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
338
339
|
uint256 netLpOut,
|
|
339
340
|
uint256 netPtFromSwap,
|
|
340
341
|
uint256 netSyFee,
|
|
341
|
-
uint256 priceImpact
|
|
342
|
+
uint256 priceImpact,
|
|
343
|
+
uint256 exchangeRateAfter
|
|
342
344
|
)
|
|
343
345
|
{
|
|
344
346
|
return
|
|
@@ -356,7 +358,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
356
358
|
uint256 netLpOut,
|
|
357
359
|
uint256 netPtFromSwap,
|
|
358
360
|
uint256 netSyFee,
|
|
359
|
-
uint256 priceImpact
|
|
361
|
+
uint256 priceImpact,
|
|
362
|
+
uint256 exchangeRateAfter
|
|
360
363
|
)
|
|
361
364
|
{
|
|
362
365
|
uint256 netSyIn = previewDepositStatic(
|
|
@@ -400,7 +403,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
400
403
|
uint256 netPtOut,
|
|
401
404
|
uint256 netPtFromSwap,
|
|
402
405
|
uint256 netSyFee,
|
|
403
|
-
uint256 priceImpact
|
|
406
|
+
uint256 priceImpact,
|
|
407
|
+
uint256 exchangeRateAfter
|
|
404
408
|
)
|
|
405
409
|
{
|
|
406
410
|
return
|
|
@@ -416,7 +420,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
416
420
|
returns (
|
|
417
421
|
uint256 netSyOut,
|
|
418
422
|
uint256 netSyFee,
|
|
419
|
-
uint256 priceImpact
|
|
423
|
+
uint256 priceImpact,
|
|
424
|
+
uint256 exchangeRateAfter
|
|
420
425
|
)
|
|
421
426
|
{
|
|
422
427
|
return MarketMathStatic.removeLiquiditySingleSyStatic(market, netLpToRemove);
|
|
@@ -432,12 +437,13 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
432
437
|
returns (
|
|
433
438
|
uint256 netBaseTokenOut,
|
|
434
439
|
uint256 netSyFee,
|
|
435
|
-
uint256 priceImpact
|
|
440
|
+
uint256 priceImpact,
|
|
441
|
+
uint256 exchangeRateAfter
|
|
436
442
|
)
|
|
437
443
|
{
|
|
438
444
|
uint256 netSyOut;
|
|
439
445
|
|
|
440
|
-
(netSyOut, netSyFee, priceImpact) = MarketMathStatic.removeLiquiditySingleSyStatic(
|
|
446
|
+
(netSyOut, netSyFee, priceImpact, exchangeRateAfter) = MarketMathStatic.removeLiquiditySingleSyStatic(
|
|
441
447
|
market,
|
|
442
448
|
netLpToRemove
|
|
443
449
|
);
|
|
@@ -450,7 +456,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
450
456
|
returns (
|
|
451
457
|
uint256 netSyOut,
|
|
452
458
|
uint256 netSyFee,
|
|
453
|
-
uint256 priceImpact
|
|
459
|
+
uint256 priceImpact,
|
|
460
|
+
uint256 exchangeRateAfter
|
|
454
461
|
)
|
|
455
462
|
{
|
|
456
463
|
return MarketMathStatic.swapExactPtForSyStatic(market, exactPtIn);
|
|
@@ -461,7 +468,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
461
468
|
returns (
|
|
462
469
|
uint256 netSyIn,
|
|
463
470
|
uint256 netSyFee,
|
|
464
|
-
uint256 priceImpact
|
|
471
|
+
uint256 priceImpact,
|
|
472
|
+
uint256 exchangeRateAfter
|
|
465
473
|
)
|
|
466
474
|
{
|
|
467
475
|
return MarketMathStatic.swapSyForExactPtStatic(market, exactPtOut);
|
|
@@ -472,7 +480,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
472
480
|
returns (
|
|
473
481
|
uint256 netPtOut,
|
|
474
482
|
uint256 netSyFee,
|
|
475
|
-
uint256 priceImpact
|
|
483
|
+
uint256 priceImpact,
|
|
484
|
+
uint256 exchangeRateAfter
|
|
476
485
|
)
|
|
477
486
|
{
|
|
478
487
|
return
|
|
@@ -484,7 +493,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
484
493
|
returns (
|
|
485
494
|
uint256 netPtIn,
|
|
486
495
|
uint256 netSyFee,
|
|
487
|
-
uint256 priceImpact
|
|
496
|
+
uint256 priceImpact,
|
|
497
|
+
uint256 exchangeRateAfter
|
|
488
498
|
)
|
|
489
499
|
{
|
|
490
500
|
return
|
|
@@ -501,7 +511,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
501
511
|
returns (
|
|
502
512
|
uint256 netPtOut,
|
|
503
513
|
uint256 netSyFee,
|
|
504
|
-
uint256 priceImpact
|
|
514
|
+
uint256 priceImpact,
|
|
515
|
+
uint256 exchangeRateAfter
|
|
505
516
|
)
|
|
506
517
|
{
|
|
507
518
|
uint256 netSyIn = previewDepositStatic(
|
|
@@ -523,11 +534,12 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
523
534
|
returns (
|
|
524
535
|
uint256 netBaseTokenOut,
|
|
525
536
|
uint256 netSyFee,
|
|
526
|
-
uint256 priceImpact
|
|
537
|
+
uint256 priceImpact,
|
|
538
|
+
uint256 exchangeRateAfter
|
|
527
539
|
)
|
|
528
540
|
{
|
|
529
541
|
uint256 netSyOut;
|
|
530
|
-
(netSyOut, netSyFee, priceImpact) = MarketMathStatic.swapExactPtForSyStatic(
|
|
542
|
+
(netSyOut, netSyFee, priceImpact, exchangeRateAfter) = MarketMathStatic.swapExactPtForSyStatic(
|
|
531
543
|
market,
|
|
532
544
|
exactPtIn
|
|
533
545
|
);
|
|
@@ -540,7 +552,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
540
552
|
returns (
|
|
541
553
|
uint256 netSyIn,
|
|
542
554
|
uint256 netSyFee,
|
|
543
|
-
uint256 priceImpact
|
|
555
|
+
uint256 priceImpact,
|
|
556
|
+
uint256 exchangeRateAfter
|
|
544
557
|
)
|
|
545
558
|
{
|
|
546
559
|
return MarketMathStatic.swapSyForExactYtStatic(market, exactYtOut);
|
|
@@ -551,7 +564,9 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
551
564
|
returns (
|
|
552
565
|
uint256 netYtOut,
|
|
553
566
|
uint256 netSyFee,
|
|
554
|
-
uint256 priceImpact
|
|
567
|
+
uint256 priceImpact,
|
|
568
|
+
uint256 exchangeRateAfter
|
|
569
|
+
|
|
555
570
|
)
|
|
556
571
|
{
|
|
557
572
|
return
|
|
@@ -563,7 +578,9 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
563
578
|
returns (
|
|
564
579
|
uint256 netSyOut,
|
|
565
580
|
uint256 netSyFee,
|
|
566
|
-
uint256 priceImpact
|
|
581
|
+
uint256 priceImpact,
|
|
582
|
+
uint256 exchangeRateAfter
|
|
583
|
+
|
|
567
584
|
)
|
|
568
585
|
{
|
|
569
586
|
return MarketMathStatic.swapExactYtForSyStatic(market, exactYtIn);
|
|
@@ -574,7 +591,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
574
591
|
returns (
|
|
575
592
|
uint256 netYtIn,
|
|
576
593
|
uint256 netSyFee,
|
|
577
|
-
uint256 priceImpact
|
|
594
|
+
uint256 priceImpact,
|
|
595
|
+
uint256 exchangeRateAfter
|
|
578
596
|
)
|
|
579
597
|
{
|
|
580
598
|
return
|
|
@@ -591,11 +609,12 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
591
609
|
returns (
|
|
592
610
|
uint256 netBaseTokenOut,
|
|
593
611
|
uint256 netSyFee,
|
|
594
|
-
uint256 priceImpact
|
|
612
|
+
uint256 priceImpact,
|
|
613
|
+
uint256 exchangeRateAfter
|
|
595
614
|
)
|
|
596
615
|
{
|
|
597
616
|
uint256 netSyOut;
|
|
598
|
-
(netSyOut, netSyFee, priceImpact) = MarketMathStatic.swapExactYtForSyStatic(
|
|
617
|
+
(netSyOut, netSyFee, priceImpact, exchangeRateAfter) = MarketMathStatic.swapExactYtForSyStatic(
|
|
599
618
|
market,
|
|
600
619
|
exactYtIn
|
|
601
620
|
);
|
|
@@ -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(
|
|
@@ -632,7 +652,8 @@ 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
659
|
return MarketMathStatic.swapExactPtForYt(market, exactPtIn, getDefaultApproxParams());
|
|
@@ -644,7 +665,8 @@ 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
672
|
return MarketMathStatic.swapExactYtForPt(market, exactYtIn, getDefaultApproxParams());
|
|
@@ -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
|
{
|
|
@@ -879,21 +901,25 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
879
901
|
bulk = IPBulkSellerFactory(bulkFactory).get(token, SY);
|
|
880
902
|
if (bulk != address(0)) {
|
|
881
903
|
BulkSellerState memory state = IPBulkSeller(bulk).readState();
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
904
|
+
|
|
905
|
+
// Paused check
|
|
906
|
+
if (state.rateTokenToSy == 0 || state.rateSyToToken == 0) {
|
|
907
|
+
return (address(0), 0, 0);
|
|
885
908
|
}
|
|
886
909
|
|
|
910
|
+
// Liquidity check
|
|
887
911
|
uint256 postFeeRateTokenToSy = state.rateTokenToSy.mulDown(Math.ONE - state.feeRate);
|
|
888
912
|
uint256 postFeeRateSyToToken = state.rateSyToToken.mulDown(Math.ONE - state.feeRate);
|
|
889
913
|
if (
|
|
890
914
|
netTokenIn.mulDown(postFeeRateTokenToSy) > state.totalSy ||
|
|
891
915
|
netSyIn.mulDown(postFeeRateSyToToken) > state.totalToken
|
|
892
916
|
) {
|
|
893
|
-
|
|
894
|
-
totalToken = 0;
|
|
895
|
-
totalSy = 0;
|
|
917
|
+
return (address(0), 0, 0);
|
|
896
918
|
}
|
|
919
|
+
|
|
920
|
+
// return...
|
|
921
|
+
totalToken = state.totalToken;
|
|
922
|
+
totalSy = state.totalSy;
|
|
897
923
|
}
|
|
898
924
|
}
|
|
899
925
|
}
|
|
@@ -76,7 +76,7 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* @notice Adds liquidity to SY/PT market using PT + any token.
|
|
79
|
-
* @dev Input token is first swapped to SY-mintable token using Kyber, then SY is minted from
|
|
79
|
+
* @dev Input token is first swapped to SY-mintable token using Kyber, then SY is minted from
|
|
80
80
|
* such. Finally the SY/PT pair is added to the market
|
|
81
81
|
* @param input data for input token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
82
82
|
* @param netPtDesired maximum PT to be used
|
|
@@ -218,7 +218,7 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
/**
|
|
221
|
-
* @notice Adds liquidity using a single token input. The input token is first swapped through
|
|
221
|
+
* @notice Adds liquidity using a single token input. The input token is first swapped through
|
|
222
222
|
* Kyberswap to a SY-mintable token, the rest is the same as `addLiquiditySingleSy()`
|
|
223
223
|
* @param guessPtReceivedFromSy approximate PT output for the SY-to-PT swap
|
|
224
224
|
* @param input data for input token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
@@ -31,7 +31,7 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* @notice redeems SY for SY-mintable tokens, then (if needed) swaps resulting tokens for
|
|
34
|
+
* @notice redeems SY for SY-mintable tokens, then (if needed) swaps resulting tokens for
|
|
35
35
|
* desired output token through Kyberswap
|
|
36
36
|
* @param output data for desired output token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
37
37
|
*/
|
|
@@ -47,7 +47,7 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* @notice mints PY from any input token
|
|
50
|
-
* @dev swaps input token through Kyberswap to SY-mintable tokens first, then mints SY, finally
|
|
50
|
+
* @dev swaps input token through Kyberswap to SY-mintable tokens first, then mints SY, finally
|
|
51
51
|
* mints PY from SY
|
|
52
52
|
* @param input data for input token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
53
53
|
* @dev reverts if PY is expired
|
|
@@ -68,7 +68,7 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
|
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* @notice redeems PY for token
|
|
71
|
-
* @dev redeems PT(+YT) for SY first, then redeems SY, finally swaps resulting tokens to output
|
|
71
|
+
* @dev redeems PT(+YT) for SY first, then redeems SY, finally swaps resulting tokens to output
|
|
72
72
|
* token through Kyberswap (if needed)
|
|
73
73
|
* @param output data for desired output token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
74
74
|
*/
|
|
@@ -166,7 +166,7 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
|
|
|
166
166
|
uint256[] amounts;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
/**
|
|
169
|
+
/**
|
|
170
170
|
* @notice A function to:
|
|
171
171
|
- Redeem all of caller's due interest and rewards in SYs, YTs, and markets
|
|
172
172
|
- Redeem SYs themselves
|
|
@@ -48,8 +48,8 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
|
|
|
48
48
|
* @param exactSyOut will consume as little PT as possible for this much SY amount
|
|
49
49
|
* @return netPtIn amount of PT used, will not be more than `maxPtIn`
|
|
50
50
|
* @return netSyFee amount SY fee incurred
|
|
51
|
-
* @dev the SY output might be slightly more than `exactSyOut` since an approximation is used.
|
|
52
|
-
* It is guaranteed that exactSyOut <= actualSyOut <= exactSyOut*(100% + guessPtIn.eps)
|
|
51
|
+
* @dev the SY output might be slightly more than `exactSyOut` since an approximation is used.
|
|
52
|
+
* It is guaranteed that exactSyOut <= actualSyOut <= exactSyOut*(100% + guessPtIn.eps)
|
|
53
53
|
*/
|
|
54
54
|
function swapPtForExactSy(
|
|
55
55
|
address receiver,
|
|
@@ -140,7 +140,7 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* @notice swap (through Kyberswap) from any input token for SY-mintable tokens, then mints SY
|
|
143
|
+
* @notice swap (through Kyberswap) from any input token for SY-mintable tokens, then mints SY
|
|
144
144
|
* and swaps said SY for PT
|
|
145
145
|
* @param input data for input token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
146
146
|
* @dev is a combination of `_mintSyFromToken()` and `_swapExactSyForPt()`
|
|
@@ -178,7 +178,7 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
|
-
* @notice swap from exact amount of PT to SY, then redeem SY for assets, finally swaps
|
|
181
|
+
* @notice swap from exact amount of PT to SY, then redeem SY for assets, finally swaps
|
|
182
182
|
* resulting assets through Kyberswap to get desired output token
|
|
183
183
|
* @param exactPtIn will always consume this much PT for as much SY as possible
|
|
184
184
|
* @param output data for desired output token, see {`./kyberswap/KyberSwapHelper.sol`}
|
|
@@ -69,7 +69,7 @@ contract ActionSwapPTYT is IPActionSwapPTYT, CallbackHelper, TokenHelper {
|
|
|
69
69
|
- `exactYtIn` YT is transferred to yield contract
|
|
70
70
|
- `market.swapSyForExactPt` is called, which will transfer PT directly to this contract & callback is invoked.
|
|
71
71
|
Note that we now owe SY
|
|
72
|
-
- in callback, a portion of PT + YT is used to redeem SY, which is then used to payback the loan. The rest of
|
|
72
|
+
- in callback, a portion of PT + YT is used to redeem SY, which is then used to payback the loan. The rest of
|
|
73
73
|
of the PT is transferred to `receiver`
|
|
74
74
|
* @param exactYtIn will always consume this amount of YT for as much PT as possible
|
|
75
75
|
* @param guessTotalPtFromSwap approximation data for PT output of the SY-to-PT flashswap
|
|
@@ -25,9 +25,9 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
25
25
|
* @notice swap exact SY to YT with the help of flashswaps & YT tokenization / redemption
|
|
26
26
|
* @dev inner working of this function:
|
|
27
27
|
- `exactSyIn` SY is transferred to YT contract
|
|
28
|
-
- `market.swapExactPtForSy` is called, which will transfer more SY directly to YT contract &
|
|
28
|
+
- `market.swapExactPtForSy` is called, which will transfer more SY directly to YT contract &
|
|
29
29
|
callback is invoked. Note that now we owe PT
|
|
30
|
-
- in callback, all SY in YT contract is used to mint PT + YT, with all PT used to pay back the
|
|
30
|
+
- in callback, all SY in YT contract is used to mint PT + YT, with all PT used to pay back the
|
|
31
31
|
loan, and all YT transferred to the receiver
|
|
32
32
|
* @param exactSyIn will always consume this amount of SY for as much YT as possible
|
|
33
33
|
* @param guessYtOut approximation data for total YT output
|
|
@@ -60,9 +60,9 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
60
60
|
* @notice swap exact YT to SY with the help of flashswaps & YT tokenization / redemption
|
|
61
61
|
* @dev inner working of this function:
|
|
62
62
|
- `exactYtIn` YT is transferred to YT contract
|
|
63
|
-
- `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract &
|
|
63
|
+
- `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract &
|
|
64
64
|
callback is invoked. Note that now we owe SY.
|
|
65
|
-
- In callback, all PT + YT in YT contract is used to redeem SY. A portion of SY is used to
|
|
65
|
+
- In callback, all PT + YT in YT contract is used to redeem SY. A portion of SY is used to
|
|
66
66
|
payback the loan, the rest is transferred to the `receiver`
|
|
67
67
|
* @param exactYtIn will consume exactly this much YT for as much SY as possible
|
|
68
68
|
* @dev this function works in conjunction with ActionCallback
|
|
@@ -85,9 +85,9 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
85
85
|
/**
|
|
86
86
|
* @notice swap SY to exact YT with the help of flashswaps & YT tokenization / redemption
|
|
87
87
|
* @dev inner working of this function:
|
|
88
|
-
- `market.swapExactPtForSy` is called, which will transfer SY directly to YT contract &
|
|
88
|
+
- `market.swapExactPtForSy` is called, which will transfer SY directly to YT contract &
|
|
89
89
|
callback is invoked. Note that now we owe PT
|
|
90
|
-
- In callback, we will pull in more SY as needed from caller & mint all SY to PT + YT. PT is
|
|
90
|
+
- In callback, we will pull in more SY as needed from caller & mint all SY to PT + YT. PT is
|
|
91
91
|
then used to payback the loan, while YT is transferred to `receiver`
|
|
92
92
|
* @param exactYtOut will output exactly this amount of YT, no approximation is used
|
|
93
93
|
* @dev this function works in conjunction with ActionCallback
|
|
@@ -118,9 +118,9 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
118
118
|
* @dev inner working of this function:
|
|
119
119
|
- Approximates `netYtIn` using the data from `guessYtIn`
|
|
120
120
|
- Pulls `netYtIn` amount of YT from caller
|
|
121
|
-
- `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract &
|
|
121
|
+
- `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract &
|
|
122
122
|
callback is invoked. Note that now we owe SY
|
|
123
|
-
- In callback, we will redeem all PT + YT to get SY. A portion of it is used to payback the
|
|
123
|
+
- In callback, we will redeem all PT + YT to get SY. A portion of it is used to payback the
|
|
124
124
|
loan. The rest is transferred to `receiver`
|
|
125
125
|
* @dev this function works in conjunction with ActionCallback
|
|
126
126
|
*/
|
|
@@ -34,19 +34,17 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
|
|
|
34
34
|
netTokenMintSy = input.netTokenIn;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
_transferOut(input.tokenMintSy, input.bulk, netTokenMintSy);
|
|
37
|
+
uint256 netNative = input.tokenMintSy == NATIVE ? netTokenMintSy : 0;
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
if (input.bulk != address(0)) {
|
|
40
|
+
_safeApproveInf(input.tokenMintSy, input.bulk);
|
|
41
|
+
netSyOut = IPBulkSeller(input.bulk).swapExactTokenForSy{ value: netNative }(
|
|
41
42
|
receiver,
|
|
42
43
|
netTokenMintSy,
|
|
43
44
|
minSyOut
|
|
44
45
|
);
|
|
45
46
|
} else {
|
|
46
|
-
uint256 netNative = input.tokenMintSy == NATIVE ? netTokenMintSy : 0;
|
|
47
|
-
|
|
48
47
|
_safeApproveInf(input.tokenMintSy, SY);
|
|
49
|
-
|
|
50
48
|
netSyOut = IStandardizedYield(SY).deposit{ value: netNative }(
|
|
51
49
|
receiver,
|
|
52
50
|
input.tokenMintSy,
|
|
@@ -75,7 +73,8 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
|
|
|
75
73
|
netTokenRedeemed = IPBulkSeller(output.bulk).swapExactSyForToken(
|
|
76
74
|
receiverRedeemSy,
|
|
77
75
|
netSyIn,
|
|
78
|
-
0
|
|
76
|
+
0,
|
|
77
|
+
true
|
|
79
78
|
);
|
|
80
79
|
} else {
|
|
81
80
|
netTokenRedeemed = IStandardizedYield(SY).redeem(
|
|
@@ -113,7 +113,7 @@ library MarketApproxPtInLib {
|
|
|
113
113
|
- Flashswap the corresponding amount of SY out
|
|
114
114
|
- Pair those amount with exactSyIn SY to tokenize into PT & YT
|
|
115
115
|
- PT to repay the flashswap, YT transferred to user
|
|
116
|
-
- Stop when
|
|
116
|
+
- Stop when the amount of SY to be pulled to tokenize PT to repay loan approx the exactSyIn
|
|
117
117
|
- guess & approx is for netYtOut (also netPtIn)
|
|
118
118
|
*/
|
|
119
119
|
function approxSwapExactSyForYt(
|
|
@@ -149,11 +149,14 @@ library MarketApproxPtInLib {
|
|
|
149
149
|
|
|
150
150
|
(uint256 netSyOut, uint256 netSyFee, ) = calcSyOut(a.market, comp, a.index, guess);
|
|
151
151
|
|
|
152
|
-
uint256
|
|
152
|
+
uint256 netSyToTokenizePt = a.index.assetToSyUp(guess);
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
// for sure netSyToTokenizePt >= netSyOut since we are swapping PT to SY
|
|
155
|
+
uint256 netSyToPull = netSyToTokenizePt - netSyOut;
|
|
156
|
+
|
|
157
|
+
if (netSyToPull <= a.exactSyIn) {
|
|
155
158
|
p.guessMin = guess;
|
|
156
|
-
bool isAnswerAccepted = Math.isASmallerApproxB(
|
|
159
|
+
bool isAnswerAccepted = Math.isASmallerApproxB(netSyToPull, a.exactSyIn, p.eps);
|
|
157
160
|
if (isAnswerAccepted) return (guess, netSyFee);
|
|
158
161
|
} else {
|
|
159
162
|
p.guessMax = guess - 1;
|
|
@@ -262,7 +265,7 @@ library MarketApproxPtInLib {
|
|
|
262
265
|
- Flashswap the corresponding amount of SY out
|
|
263
266
|
- Tokenize all the SY into PT + YT
|
|
264
267
|
- PT to repay the flashswap, YT transferred to user
|
|
265
|
-
- Stop when the amount of PT
|
|
268
|
+
- Stop when the additional amount of PT to pull to repay the loan approx the exactPtIn
|
|
266
269
|
- guess & approx is for totalPtToSwap
|
|
267
270
|
*/
|
|
268
271
|
function approxSwapExactPtForYt(
|
|
@@ -301,10 +304,12 @@ library MarketApproxPtInLib {
|
|
|
301
304
|
|
|
302
305
|
uint256 netAssetOut = a.index.syToAsset(netSyOut);
|
|
303
306
|
|
|
304
|
-
|
|
305
|
-
|
|
307
|
+
// guess >= netAssetOut since we are swapping PT to SY
|
|
308
|
+
uint256 netPtToPull = guess - netAssetOut;
|
|
309
|
+
|
|
310
|
+
if (netPtToPull <= a.exactPtIn) {
|
|
306
311
|
p.guessMin = guess;
|
|
307
|
-
if (Math.isASmallerApproxB(
|
|
312
|
+
if (Math.isASmallerApproxB(netPtToPull, a.exactPtIn, p.eps)) {
|
|
308
313
|
return (netAssetOut, guess, netSyFee);
|
|
309
314
|
}
|
|
310
315
|
} else {
|
|
@@ -676,6 +681,7 @@ library MarketApproxPtOutLib {
|
|
|
676
681
|
|
|
677
682
|
if (netSyOwed <= a.maxSyPayable) {
|
|
678
683
|
p.guessMin = guess;
|
|
684
|
+
|
|
679
685
|
if (Math.isASmallerApproxB(netSyOwed, a.maxSyPayable, p.eps)) {
|
|
680
686
|
return (guess - a.exactYtIn, guess, netSyFee);
|
|
681
687
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"bulkSellerFactory": "0x137404E334a80fa741AD03d8965ee4b5b8A20259",
|
|
16
16
|
"bulkSellerOffchain": "0x85C369B1aD9A981DCf4Fd8F00F74cB783cacec34",
|
|
17
17
|
"router": "0x17ae363f142517b593d9A71282BAb8CA6bb4eA51",
|
|
18
|
-
"routerStatic": "
|
|
18
|
+
"routerStatic": "0xBf98D54D05907f3F576602e8Be7fEaF8891c787F",
|
|
19
19
|
"vePendle": "0xB20E3c268C993BC3c9Bc1C1cc5D7491F2268cD91",
|
|
20
20
|
"senderEndpoint": "0x86bD575c36e236386284C035ffeBE66CB6ecd2DD",
|
|
21
21
|
"votingController": "0x40ea97a7E9A4A0520229d1bbdf4D82E36b1a5475",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY Benqi USDC",
|
|
3
|
+
"SY": "0x4F84e0469F8ba5Eb6b39F017301A221Cc08FDD84",
|
|
4
|
+
"YT": "0x89Bb92d1D5ce9050697d994dFA38631c6CeB29ee",
|
|
5
|
+
"PT": "0x59a4972802cA006801Fb7a0b551fA8385B54D2B1",
|
|
6
|
+
"market": "0xF1Fd2085Ef3403a422999996F3E1d7915a453E46",
|
|
7
|
+
"expiry": 1675468800,
|
|
8
|
+
"scalarRoot": "62000000000000000000",
|
|
9
|
+
"initAnchor": "1012600000000000000"
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY Benqi WETH",
|
|
3
|
+
"SY": "0xBb4C4cEcafAA16911b98C29650bdC37dbc14cA0e",
|
|
4
|
+
"YT": "0xCf51520AaCec976a6144a4584eacbFa6EC25Ad8D",
|
|
5
|
+
"PT": "0x491BecB8976b7540Dfd809c758e514f4296D585d",
|
|
6
|
+
"market": "0x2ad1F05C047fb08ACFA5a3C5BEb793bb4500e1da",
|
|
7
|
+
"expiry": 1675468800,
|
|
8
|
+
"bulkSeller": "0xED4403ef6f7Dfa260676CE330a6d3E38324385ff",
|
|
9
|
+
"scalarRoot": "62000000000000000000",
|
|
10
|
+
"initAnchor": "1012600000000000000"
|
|
11
|
+
}
|
package/package.json
CHANGED