@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,66 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
4
|
+
import "./IRewardManager.sol";
|
|
5
|
+
import "./IPInterestManagerYTV2.sol";
|
|
6
|
+
|
|
7
|
+
interface IPYieldTokenV2 is IERC20Metadata, IRewardManager, IPInterestManagerYTV2 {
|
|
8
|
+
event Mint(
|
|
9
|
+
address indexed caller,
|
|
10
|
+
address indexed receiverPT,
|
|
11
|
+
address indexed receiverYT,
|
|
12
|
+
uint256 amountSyToMint,
|
|
13
|
+
uint256 amountPYOut
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
event Burn(
|
|
17
|
+
address indexed caller,
|
|
18
|
+
address indexed receiver,
|
|
19
|
+
uint256 amountPYToRedeem,
|
|
20
|
+
uint256 amountSyOut
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
event RedeemRewards(address indexed user, uint256[] amountRewardsOut);
|
|
24
|
+
|
|
25
|
+
event RedeemInterest(address indexed user, uint256 interestOut);
|
|
26
|
+
|
|
27
|
+
event WithdrawFeeToTreasury(uint256[] amountRewardsOut, uint256 syOut);
|
|
28
|
+
|
|
29
|
+
event CollectInterestFee(uint256 amountInterestFee);
|
|
30
|
+
|
|
31
|
+
event CollectRewardFee(address indexed rewardToken, uint256 amountRewardFee);
|
|
32
|
+
|
|
33
|
+
function mintPY(address receiverPT, address receiverYT) external returns (uint256 amountPYOut);
|
|
34
|
+
|
|
35
|
+
function redeemPY(address receiver) external returns (uint256 amountSyOut);
|
|
36
|
+
|
|
37
|
+
function redeemPYMulti(address[] calldata receivers, uint256[] calldata amountPYToRedeems)
|
|
38
|
+
external
|
|
39
|
+
returns (uint256[] memory amountSyOuts);
|
|
40
|
+
|
|
41
|
+
function redeemDueInterestAndRewards(
|
|
42
|
+
address user,
|
|
43
|
+
bool redeemInterest,
|
|
44
|
+
bool redeemRewards
|
|
45
|
+
) external returns (uint256 interestOut, uint256[] memory rewardsOut);
|
|
46
|
+
|
|
47
|
+
function rewardIndexesCurrent() external returns (uint256[] memory);
|
|
48
|
+
|
|
49
|
+
function pyIndexCurrent() external returns (uint256);
|
|
50
|
+
|
|
51
|
+
function pyIndexStored() external view returns (uint256);
|
|
52
|
+
|
|
53
|
+
function getRewardTokens() external view returns (address[] memory);
|
|
54
|
+
|
|
55
|
+
function SY() external view returns (address);
|
|
56
|
+
|
|
57
|
+
function PT() external view returns (address);
|
|
58
|
+
|
|
59
|
+
function factory() external view returns (address);
|
|
60
|
+
|
|
61
|
+
function expiry() external view returns (uint256);
|
|
62
|
+
|
|
63
|
+
function isExpired() external view returns (bool);
|
|
64
|
+
|
|
65
|
+
function doCacheIndexSameBlock() external view returns (bool);
|
|
66
|
+
}
|
|
@@ -14,6 +14,17 @@ library MarketMathStatic {
|
|
|
14
14
|
using PYIndexLib for PYIndex;
|
|
15
15
|
using PYIndexLib for IPYieldToken;
|
|
16
16
|
|
|
17
|
+
function getDefaultApproxParams() public pure returns (ApproxParams memory) {
|
|
18
|
+
return
|
|
19
|
+
ApproxParams({
|
|
20
|
+
guessMin: 0,
|
|
21
|
+
guessMax: type(uint256).max,
|
|
22
|
+
guessOffchain: 0,
|
|
23
|
+
maxIteration: 256,
|
|
24
|
+
eps: 1e14
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
function addLiquidityDualSyAndPtStatic(
|
|
18
29
|
address market,
|
|
19
30
|
uint256 netSyDesired,
|
|
@@ -36,17 +47,14 @@ library MarketMathStatic {
|
|
|
36
47
|
}
|
|
37
48
|
|
|
38
49
|
/// @dev netPtToSwap is the parameter to approx
|
|
39
|
-
function addLiquiditySinglePtStatic(
|
|
40
|
-
address market,
|
|
41
|
-
uint256 netPtIn,
|
|
42
|
-
ApproxParams memory approxParams
|
|
43
|
-
)
|
|
50
|
+
function addLiquiditySinglePtStatic(address market, uint256 netPtIn)
|
|
44
51
|
external
|
|
45
52
|
returns (
|
|
46
53
|
uint256 netLpOut,
|
|
47
54
|
uint256 netPtToSwap,
|
|
48
55
|
uint256 netSyFee,
|
|
49
|
-
uint256 priceImpact
|
|
56
|
+
uint256 priceImpact,
|
|
57
|
+
uint256 exchangeRateAfter
|
|
50
58
|
)
|
|
51
59
|
{
|
|
52
60
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -55,7 +63,7 @@ library MarketMathStatic {
|
|
|
55
63
|
pyIndex(market),
|
|
56
64
|
netPtIn,
|
|
57
65
|
block.timestamp,
|
|
58
|
-
|
|
66
|
+
getDefaultApproxParams()
|
|
59
67
|
);
|
|
60
68
|
|
|
61
69
|
state = IPMarket(market).readState(address(this)); // re-read
|
|
@@ -72,21 +80,19 @@ library MarketMathStatic {
|
|
|
72
80
|
block.timestamp
|
|
73
81
|
);
|
|
74
82
|
|
|
75
|
-
priceImpact =
|
|
83
|
+
priceImpact = calcPriceImpactPt(market, netPtToSwap.neg());
|
|
84
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
76
85
|
}
|
|
77
86
|
|
|
78
87
|
/// @dev netPtFromSwap is the parameter to approx
|
|
79
|
-
function addLiquiditySingleSyStatic(
|
|
80
|
-
address market,
|
|
81
|
-
uint256 netSyIn,
|
|
82
|
-
ApproxParams memory approxParams
|
|
83
|
-
)
|
|
88
|
+
function addLiquiditySingleSyStatic(address market, uint256 netSyIn)
|
|
84
89
|
public
|
|
85
90
|
returns (
|
|
86
91
|
uint256 netLpOut,
|
|
87
92
|
uint256 netPtFromSwap,
|
|
88
93
|
uint256 netSyFee,
|
|
89
|
-
uint256 priceImpact
|
|
94
|
+
uint256 priceImpact,
|
|
95
|
+
uint256 exchangeRateAfter
|
|
90
96
|
)
|
|
91
97
|
{
|
|
92
98
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -95,7 +101,7 @@ library MarketMathStatic {
|
|
|
95
101
|
pyIndex(market),
|
|
96
102
|
netSyIn,
|
|
97
103
|
block.timestamp,
|
|
98
|
-
|
|
104
|
+
getDefaultApproxParams()
|
|
99
105
|
);
|
|
100
106
|
|
|
101
107
|
state = IPMarket(market).readState(address(this)); // re-read
|
|
@@ -108,7 +114,23 @@ library MarketMathStatic {
|
|
|
108
114
|
);
|
|
109
115
|
(, netLpOut, , ) = state.addLiquidity(netSyIn - netSySwap, netPtFromSwap, block.timestamp);
|
|
110
116
|
|
|
111
|
-
priceImpact =
|
|
117
|
+
priceImpact = calcPriceImpactPt(market, netPtFromSwap.Int());
|
|
118
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function addLiquiditySingleSyKeepYtStatic(address market, uint256 netSyIn)
|
|
122
|
+
public
|
|
123
|
+
returns (uint256 netLpOut, uint256 netYtOut)
|
|
124
|
+
{
|
|
125
|
+
MarketState memory state = IPMarket(market).readState(address(this));
|
|
126
|
+
PYIndex index = pyIndex(market);
|
|
127
|
+
|
|
128
|
+
uint256 netSyToPt = (netSyIn * state.totalPt.Uint()) /
|
|
129
|
+
(state.totalPt.Uint() + index.syToAsset(state.totalSy.Uint()));
|
|
130
|
+
|
|
131
|
+
netYtOut = index.syToAsset(netSyToPt);
|
|
132
|
+
|
|
133
|
+
(, netLpOut, , ) = state.addLiquidity(netSyIn - netSyToPt, netYtOut, block.timestamp);
|
|
112
134
|
}
|
|
113
135
|
|
|
114
136
|
function removeLiquidityDualSyAndPtStatic(address market, uint256 netLpToRemove)
|
|
@@ -121,17 +143,14 @@ library MarketMathStatic {
|
|
|
121
143
|
}
|
|
122
144
|
|
|
123
145
|
/// @dev netPtFromSwap is the parameter to approx
|
|
124
|
-
function removeLiquiditySinglePtStatic(
|
|
125
|
-
address market,
|
|
126
|
-
uint256 netLpToRemove,
|
|
127
|
-
ApproxParams memory approxParams
|
|
128
|
-
)
|
|
146
|
+
function removeLiquiditySinglePtStatic(address market, uint256 netLpToRemove)
|
|
129
147
|
external
|
|
130
148
|
returns (
|
|
131
149
|
uint256 netPtOut,
|
|
132
150
|
uint256 netPtFromSwap,
|
|
133
151
|
uint256 netSyFee,
|
|
134
|
-
uint256 priceImpact
|
|
152
|
+
uint256 priceImpact,
|
|
153
|
+
uint256 exchangeRateAfter
|
|
135
154
|
)
|
|
136
155
|
{
|
|
137
156
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -141,11 +160,15 @@ library MarketMathStatic {
|
|
|
141
160
|
pyIndex(market),
|
|
142
161
|
syFromBurn,
|
|
143
162
|
block.timestamp,
|
|
144
|
-
|
|
163
|
+
getDefaultApproxParams()
|
|
145
164
|
);
|
|
146
165
|
|
|
147
166
|
netPtOut = ptFromBurn + netPtFromSwap;
|
|
148
|
-
priceImpact =
|
|
167
|
+
priceImpact = calcPriceImpactPt(market, netPtFromSwap.Int());
|
|
168
|
+
|
|
169
|
+
// Execute swap to calculate exchangeRateAfter
|
|
170
|
+
state.swapSyForExactPt(pyIndex(market), netPtFromSwap, block.timestamp);
|
|
171
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
149
172
|
}
|
|
150
173
|
|
|
151
174
|
function removeLiquiditySingleSyStatic(address market, uint256 netLpToRemove)
|
|
@@ -153,7 +176,8 @@ library MarketMathStatic {
|
|
|
153
176
|
returns (
|
|
154
177
|
uint256 netSyOut,
|
|
155
178
|
uint256 netSyFee,
|
|
156
|
-
uint256 priceImpact
|
|
179
|
+
uint256 priceImpact,
|
|
180
|
+
uint256 exchangeRateAfter
|
|
157
181
|
)
|
|
158
182
|
{
|
|
159
183
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -171,7 +195,8 @@ library MarketMathStatic {
|
|
|
171
195
|
);
|
|
172
196
|
|
|
173
197
|
netSyOut = syFromBurn + syFromSwap;
|
|
174
|
-
priceImpact =
|
|
198
|
+
priceImpact = calcPriceImpactPt(market, ptFromBurn.neg());
|
|
199
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
175
200
|
}
|
|
176
201
|
}
|
|
177
202
|
|
|
@@ -180,7 +205,8 @@ library MarketMathStatic {
|
|
|
180
205
|
returns (
|
|
181
206
|
uint256 netSyOut,
|
|
182
207
|
uint256 netSyFee,
|
|
183
|
-
uint256 priceImpact
|
|
208
|
+
uint256 priceImpact,
|
|
209
|
+
uint256 exchangeRateAfter
|
|
184
210
|
)
|
|
185
211
|
{
|
|
186
212
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -189,7 +215,8 @@ library MarketMathStatic {
|
|
|
189
215
|
exactPtIn,
|
|
190
216
|
block.timestamp
|
|
191
217
|
);
|
|
192
|
-
priceImpact =
|
|
218
|
+
priceImpact = calcPriceImpactPt(market, exactPtIn.neg());
|
|
219
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
193
220
|
}
|
|
194
221
|
|
|
195
222
|
function swapSyForExactPtStatic(address market, uint256 exactPtOut)
|
|
@@ -197,7 +224,8 @@ library MarketMathStatic {
|
|
|
197
224
|
returns (
|
|
198
225
|
uint256 netSyIn,
|
|
199
226
|
uint256 netSyFee,
|
|
200
|
-
uint256 priceImpact
|
|
227
|
+
uint256 priceImpact,
|
|
228
|
+
uint256 exchangeRateAfter
|
|
201
229
|
)
|
|
202
230
|
{
|
|
203
231
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -206,20 +234,18 @@ library MarketMathStatic {
|
|
|
206
234
|
exactPtOut,
|
|
207
235
|
block.timestamp
|
|
208
236
|
);
|
|
209
|
-
priceImpact =
|
|
237
|
+
priceImpact = calcPriceImpactPt(market, exactPtOut.Int());
|
|
238
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
210
239
|
}
|
|
211
240
|
|
|
212
241
|
/// @dev netPtOut is the parameter to approx
|
|
213
|
-
function swapExactSyForPtStatic(
|
|
214
|
-
address market,
|
|
215
|
-
uint256 exactSyIn,
|
|
216
|
-
ApproxParams memory approxParams
|
|
217
|
-
)
|
|
242
|
+
function swapExactSyForPtStatic(address market, uint256 exactSyIn)
|
|
218
243
|
public
|
|
219
244
|
returns (
|
|
220
245
|
uint256 netPtOut,
|
|
221
246
|
uint256 netSyFee,
|
|
222
|
-
uint256 priceImpact
|
|
247
|
+
uint256 priceImpact,
|
|
248
|
+
uint256 exchangeRateAfter
|
|
223
249
|
)
|
|
224
250
|
{
|
|
225
251
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -227,22 +253,23 @@ library MarketMathStatic {
|
|
|
227
253
|
pyIndex(market),
|
|
228
254
|
exactSyIn,
|
|
229
255
|
block.timestamp,
|
|
230
|
-
|
|
256
|
+
getDefaultApproxParams()
|
|
231
257
|
);
|
|
232
|
-
priceImpact =
|
|
258
|
+
priceImpact = calcPriceImpactPt(market, netPtOut.Int());
|
|
259
|
+
|
|
260
|
+
// Execute swap to calculate exchangeRateAfter
|
|
261
|
+
state.swapSyForExactPt(pyIndex(market), netPtOut, block.timestamp);
|
|
262
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
233
263
|
}
|
|
234
264
|
|
|
235
265
|
/// @dev netPtIn is the parameter to approx
|
|
236
|
-
function swapPtForExactSyStatic(
|
|
237
|
-
address market,
|
|
238
|
-
uint256 exactSyOut,
|
|
239
|
-
ApproxParams memory approxParams
|
|
240
|
-
)
|
|
266
|
+
function swapPtForExactSyStatic(address market, uint256 exactSyOut)
|
|
241
267
|
public
|
|
242
268
|
returns (
|
|
243
269
|
uint256 netPtIn,
|
|
244
270
|
uint256 netSyFee,
|
|
245
|
-
uint256 priceImpact
|
|
271
|
+
uint256 priceImpact,
|
|
272
|
+
uint256 exchangeRateAfter
|
|
246
273
|
)
|
|
247
274
|
{
|
|
248
275
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -251,9 +278,13 @@ library MarketMathStatic {
|
|
|
251
278
|
pyIndex(market),
|
|
252
279
|
exactSyOut,
|
|
253
280
|
block.timestamp,
|
|
254
|
-
|
|
281
|
+
getDefaultApproxParams()
|
|
255
282
|
);
|
|
256
|
-
priceImpact =
|
|
283
|
+
priceImpact = calcPriceImpactPt(market, netPtIn.neg());
|
|
284
|
+
|
|
285
|
+
// Execute swap to calculate exchangeRateAfter
|
|
286
|
+
state.swapExactPtForSy(pyIndex(market), netPtIn, block.timestamp);
|
|
287
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
257
288
|
}
|
|
258
289
|
|
|
259
290
|
function swapSyForExactYtStatic(address market, uint256 exactYtOut)
|
|
@@ -261,11 +292,13 @@ library MarketMathStatic {
|
|
|
261
292
|
returns (
|
|
262
293
|
uint256 netSyIn,
|
|
263
294
|
uint256 netSyFee,
|
|
264
|
-
uint256 priceImpact
|
|
295
|
+
uint256 priceImpact,
|
|
296
|
+
uint256 exchangeRateAfter
|
|
265
297
|
)
|
|
266
298
|
{
|
|
267
|
-
|
|
299
|
+
priceImpact = calcPriceImpactYt(market, exactYtOut.neg());
|
|
268
300
|
|
|
301
|
+
MarketState memory state = IPMarket(market).readState(address(this));
|
|
269
302
|
PYIndex index = pyIndex(market);
|
|
270
303
|
|
|
271
304
|
uint256 syReceived;
|
|
@@ -278,20 +311,17 @@ library MarketMathStatic {
|
|
|
278
311
|
uint256 totalSyNeed = index.assetToSyUp(exactYtOut);
|
|
279
312
|
netSyIn = totalSyNeed.subMax0(syReceived);
|
|
280
313
|
|
|
281
|
-
|
|
314
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
282
315
|
}
|
|
283
316
|
|
|
284
317
|
/// @dev netYtOut is the parameter to approx
|
|
285
|
-
function swapExactSyForYtStatic(
|
|
286
|
-
address market,
|
|
287
|
-
uint256 exactSyIn,
|
|
288
|
-
ApproxParams memory approxParams
|
|
289
|
-
)
|
|
318
|
+
function swapExactSyForYtStatic(address market, uint256 exactSyIn)
|
|
290
319
|
public
|
|
291
320
|
returns (
|
|
292
321
|
uint256 netYtOut,
|
|
293
322
|
uint256 netSyFee,
|
|
294
|
-
uint256 priceImpact
|
|
323
|
+
uint256 priceImpact,
|
|
324
|
+
uint256 exchangeRateAfter
|
|
295
325
|
)
|
|
296
326
|
{
|
|
297
327
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -301,10 +331,14 @@ library MarketMathStatic {
|
|
|
301
331
|
index,
|
|
302
332
|
exactSyIn,
|
|
303
333
|
block.timestamp,
|
|
304
|
-
|
|
334
|
+
getDefaultApproxParams()
|
|
305
335
|
);
|
|
306
336
|
|
|
307
|
-
priceImpact =
|
|
337
|
+
priceImpact = calcPriceImpactYt(market, netYtOut.neg());
|
|
338
|
+
|
|
339
|
+
// Execute swap to calculate exchangeRateAfter
|
|
340
|
+
state.swapExactPtForSy(index, netYtOut, block.timestamp);
|
|
341
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
308
342
|
}
|
|
309
343
|
|
|
310
344
|
function swapExactYtForSyStatic(address market, uint256 exactYtIn)
|
|
@@ -312,9 +346,12 @@ library MarketMathStatic {
|
|
|
312
346
|
returns (
|
|
313
347
|
uint256 netSyOut,
|
|
314
348
|
uint256 netSyFee,
|
|
315
|
-
uint256 priceImpact
|
|
349
|
+
uint256 priceImpact,
|
|
350
|
+
uint256 exchangeRateAfter
|
|
316
351
|
)
|
|
317
352
|
{
|
|
353
|
+
priceImpact = calcPriceImpactYt(market, exactYtIn.Int());
|
|
354
|
+
|
|
318
355
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
319
356
|
|
|
320
357
|
PYIndex index = pyIndex(market);
|
|
@@ -326,20 +363,17 @@ library MarketMathStatic {
|
|
|
326
363
|
uint256 amountPYToRedeemSyOut = exactYtIn - amountPYToRepaySyOwed;
|
|
327
364
|
|
|
328
365
|
netSyOut = index.assetToSy(amountPYToRedeemSyOut);
|
|
329
|
-
|
|
366
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
330
367
|
}
|
|
331
368
|
|
|
332
369
|
/// @dev netYtIn is the parameter to approx
|
|
333
|
-
function swapYtForExactSyStatic(
|
|
334
|
-
address market,
|
|
335
|
-
uint256 exactSyOut,
|
|
336
|
-
ApproxParams memory approxParams
|
|
337
|
-
)
|
|
370
|
+
function swapYtForExactSyStatic(address market, uint256 exactSyOut)
|
|
338
371
|
external
|
|
339
372
|
returns (
|
|
340
373
|
uint256 netYtIn,
|
|
341
374
|
uint256 netSyFee,
|
|
342
|
-
uint256 priceImpact
|
|
375
|
+
uint256 priceImpact,
|
|
376
|
+
uint256 exchangeRateAfter
|
|
343
377
|
)
|
|
344
378
|
{
|
|
345
379
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -350,23 +384,24 @@ library MarketMathStatic {
|
|
|
350
384
|
index,
|
|
351
385
|
exactSyOut,
|
|
352
386
|
block.timestamp,
|
|
353
|
-
|
|
387
|
+
getDefaultApproxParams()
|
|
354
388
|
);
|
|
355
|
-
priceImpact =
|
|
389
|
+
priceImpact = calcPriceImpactYt(market, netYtIn.Int());
|
|
390
|
+
|
|
391
|
+
// Execute swap to calculate exchangeRateAfter
|
|
392
|
+
state.swapSyForExactPt(index, netYtIn, block.timestamp);
|
|
393
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
356
394
|
}
|
|
357
395
|
|
|
358
396
|
// totalPtToSwap is the param to approx
|
|
359
|
-
function swapExactPtForYt(
|
|
360
|
-
address market,
|
|
361
|
-
uint256 exactPtIn,
|
|
362
|
-
ApproxParams memory approxParams
|
|
363
|
-
)
|
|
397
|
+
function swapExactPtForYt(address market, uint256 exactPtIn)
|
|
364
398
|
external
|
|
365
399
|
returns (
|
|
366
400
|
uint256 netYtOut,
|
|
367
401
|
uint256 totalPtToSwap,
|
|
368
402
|
uint256 netSyFee,
|
|
369
|
-
uint256 priceImpact
|
|
403
|
+
uint256 priceImpact,
|
|
404
|
+
uint256 exchangeRateAfter
|
|
370
405
|
)
|
|
371
406
|
{
|
|
372
407
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -376,23 +411,24 @@ library MarketMathStatic {
|
|
|
376
411
|
index,
|
|
377
412
|
exactPtIn,
|
|
378
413
|
block.timestamp,
|
|
379
|
-
|
|
414
|
+
getDefaultApproxParams()
|
|
380
415
|
);
|
|
381
|
-
priceImpact =
|
|
416
|
+
priceImpact = calcPriceImpactPY(market, totalPtToSwap.neg());
|
|
417
|
+
|
|
418
|
+
// Execute swap to calculate exchangeRateAfter
|
|
419
|
+
state.swapExactPtForSy(index, totalPtToSwap, block.timestamp);
|
|
420
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
382
421
|
}
|
|
383
422
|
|
|
384
423
|
// totalPtSwapped is the param to approx
|
|
385
|
-
function swapExactYtForPt(
|
|
386
|
-
address market,
|
|
387
|
-
uint256 exactYtIn,
|
|
388
|
-
ApproxParams memory approxParams
|
|
389
|
-
)
|
|
424
|
+
function swapExactYtForPt(address market, uint256 exactYtIn)
|
|
390
425
|
external
|
|
391
426
|
returns (
|
|
392
427
|
uint256 netPtOut,
|
|
393
428
|
uint256 totalPtSwapped,
|
|
394
429
|
uint256 netSyFee,
|
|
395
|
-
uint256 priceImpact
|
|
430
|
+
uint256 priceImpact,
|
|
431
|
+
uint256 exchangeRateAfter
|
|
396
432
|
)
|
|
397
433
|
{
|
|
398
434
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -402,10 +438,14 @@ library MarketMathStatic {
|
|
|
402
438
|
index,
|
|
403
439
|
exactYtIn,
|
|
404
440
|
block.timestamp,
|
|
405
|
-
|
|
441
|
+
getDefaultApproxParams()
|
|
406
442
|
);
|
|
407
443
|
|
|
408
|
-
priceImpact =
|
|
444
|
+
priceImpact = calcPriceImpactPY(market, totalPtSwapped.Int());
|
|
445
|
+
|
|
446
|
+
// Execute swap to calculate exchangeRateAfter
|
|
447
|
+
state.swapSyForExactPt(index, totalPtSwapped, block.timestamp);
|
|
448
|
+
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
409
449
|
}
|
|
410
450
|
|
|
411
451
|
function pyIndex(address market) public returns (PYIndex index) {
|
|
@@ -414,8 +454,25 @@ library MarketMathStatic {
|
|
|
414
454
|
return YT.newIndex();
|
|
415
455
|
}
|
|
416
456
|
|
|
417
|
-
function
|
|
418
|
-
|
|
457
|
+
function getTradeExchangeRateExcludeFee(address market) public returns (uint256) {
|
|
458
|
+
if (IPMarket(market).isExpired()) return Math.ONE;
|
|
459
|
+
MarketState memory state = IPMarket(market).readState(address(this));
|
|
460
|
+
return _getTradeExchangeRateExcludeFee(market, state);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function _getTradeExchangeRateExcludeFee(address market, MarketState memory state)
|
|
464
|
+
public
|
|
465
|
+
returns (uint256)
|
|
466
|
+
{
|
|
467
|
+
MarketPreCompute memory comp = state.getMarketPreCompute(pyIndex(market), block.timestamp);
|
|
468
|
+
int256 preFeeExchangeRate = MarketMathCore._getExchangeRate(
|
|
469
|
+
state.totalPt,
|
|
470
|
+
comp.totalAsset,
|
|
471
|
+
comp.rateScalar,
|
|
472
|
+
comp.rateAnchor,
|
|
473
|
+
0
|
|
474
|
+
);
|
|
475
|
+
return preFeeExchangeRate.Uint();
|
|
419
476
|
}
|
|
420
477
|
|
|
421
478
|
function getTradeExchangeRateIncludeFee(address market, int256 netPtOut)
|
|
@@ -445,14 +502,40 @@ library MarketMathStatic {
|
|
|
445
502
|
}
|
|
446
503
|
}
|
|
447
504
|
|
|
448
|
-
function
|
|
505
|
+
function calcPriceImpactPt(address market, int256 netPtOut)
|
|
449
506
|
public
|
|
450
507
|
returns (uint256 priceImpact)
|
|
451
508
|
{
|
|
452
|
-
uint256 preTradeRate =
|
|
509
|
+
uint256 preTradeRate = getTradeExchangeRateIncludeFee(market, _getSign(netPtOut));
|
|
453
510
|
uint256 tradedRate = getTradeExchangeRateIncludeFee(market, netPtOut);
|
|
511
|
+
priceImpact = _calculateImpact(preTradeRate, tradedRate);
|
|
512
|
+
}
|
|
454
513
|
|
|
455
|
-
|
|
514
|
+
function calcPriceImpactYt(address market, int256 netPtOut)
|
|
515
|
+
public
|
|
516
|
+
returns (uint256 priceImpact)
|
|
517
|
+
{
|
|
518
|
+
uint256 ytPreTradeRate = _calcVirtualYTPrice(
|
|
519
|
+
getTradeExchangeRateIncludeFee(market, _getSign(netPtOut))
|
|
520
|
+
);
|
|
521
|
+
uint256 ytTradedRate = _calcVirtualYTPrice(
|
|
522
|
+
getTradeExchangeRateIncludeFee(market, netPtOut)
|
|
523
|
+
);
|
|
524
|
+
priceImpact = _calculateImpact(ytPreTradeRate, ytTradedRate);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
function calcPriceImpactPY(address market, int256 netPtOut)
|
|
528
|
+
public
|
|
529
|
+
returns (uint256 priceImpact)
|
|
530
|
+
{
|
|
531
|
+
uint256 ptPreTradeRate = getTradeExchangeRateIncludeFee(market, _getSign(netPtOut));
|
|
532
|
+
uint256 ytPreTradeRate = _calcVirtualYTPrice(ptPreTradeRate);
|
|
533
|
+
uint256 ptTradeRate = getTradeExchangeRateIncludeFee(market, netPtOut);
|
|
534
|
+
uint256 ytTradeRate = _calcVirtualYTPrice(ptTradeRate);
|
|
535
|
+
|
|
536
|
+
uint256 pyPreTradeRate = ytPreTradeRate.divDown(ptPreTradeRate);
|
|
537
|
+
uint256 pyTradeRate = ytTradeRate.divDown(ptTradeRate);
|
|
538
|
+
priceImpact = _calculateImpact(pyPreTradeRate, pyTradeRate);
|
|
456
539
|
}
|
|
457
540
|
|
|
458
541
|
function getPtImpliedYield(address market) public view returns (int256) {
|
|
@@ -461,4 +544,29 @@ library MarketMathStatic {
|
|
|
461
544
|
int256 lnImpliedRate = (state.lastLnImpliedRate).Int();
|
|
462
545
|
return lnImpliedRate.exp();
|
|
463
546
|
}
|
|
547
|
+
|
|
548
|
+
function _calcVirtualYTPrice(uint256 ptAssetExchangeRate)
|
|
549
|
+
private
|
|
550
|
+
pure
|
|
551
|
+
returns (uint256 ytAssetExchangeRate)
|
|
552
|
+
{
|
|
553
|
+
// 1 asset = EX pt
|
|
554
|
+
// 1 pt = 1/EX Asset
|
|
555
|
+
// 1 yt + 1/EX Asset = 1 Asset
|
|
556
|
+
// 1 yt = 1 Asset - 1/EX Asset
|
|
557
|
+
// 1 yt = (EX - 1) / EX Asset
|
|
558
|
+
return (ptAssetExchangeRate - Math.ONE).divDown(ptAssetExchangeRate);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
function _getSign(int256 netPtOut) private pure returns (int256) {
|
|
562
|
+
return netPtOut > 0 ? int256(1) : int256(-1);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function _calculateImpact(uint256 rateBefore, uint256 rateTraded)
|
|
566
|
+
private
|
|
567
|
+
pure
|
|
568
|
+
returns (uint256 impact)
|
|
569
|
+
{
|
|
570
|
+
impact = (rateBefore.Int() - rateTraded.Int()).abs().divDown(rateBefore);
|
|
571
|
+
}
|
|
464
572
|
}
|