@pendle/core-v2 0.20.2-testnet → 1.0.0-mainnet
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/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/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +4 -0
- package/build/artifacts/contracts/{interfaces/IApeStaking.sol/IApeStaking.json → LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json} +52 -70
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +310 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +389 -0
- 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/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/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/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/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 +5 -171
- 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/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +0 -18
- 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/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +32 -80
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +40 -100
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +16 -40
- 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/IPActionSwapYT.sol/IPActionSwapYT.json +16 -40
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +104 -260
- 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 +32 -43
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{Balancer/IGauge.sol/IGauge.json → IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json} +33 -18
- 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/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 -42
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +98 -171
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +53 -96
- 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 +61 -116
- 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 +25 -44
- 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 +25 -44
- 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/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.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 +4 -0
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +224 -0
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +35 -0
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.json +136 -0
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +4 -0
- package/build/artifacts/contracts/{interfaces/Balancer/IRateProvider.sol/IRateProvider.json → router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json} +5 -5
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +9 -7
- package/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol +159 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +99 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +70 -0
- package/contracts/core/BulkSeller/BulkSeller.sol +1 -1
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +3 -1
- package/contracts/core/libraries/ArrayLib.sol +0 -12
- package/contracts/core/libraries/Errors.sol +2 -19
- package/contracts/interfaces/ConvexCurve/IRewards.sol +0 -5
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +1 -1
- package/contracts/interfaces/IPActionMintRedeem.sol +3 -2
- package/contracts/interfaces/IPActionSwapPT.sol +1 -1
- package/contracts/interfaces/IPActionSwapPTYT.sol +1 -1
- package/contracts/interfaces/IPActionSwapYT.sol +1 -1
- package/contracts/interfaces/IPFeeDistributor.sol +10 -12
- package/contracts/interfaces/IPFeeDistributorFactory.sol +14 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +88 -181
- package/contracts/offchain-helpers/RouterStatic.sol +72 -72
- package/contracts/router/ActionAddRemoveLiq.sol +2 -2
- package/contracts/router/ActionMintRedeem.sol +9 -7
- package/contracts/router/ActionSwapPT.sol +2 -2
- package/contracts/router/ActionSwapYT.sol +2 -2
- package/contracts/router/base/ActionBaseMintRedeem.sol +14 -51
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +317 -0
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +10 -0
- package/contracts/router/kyberswap/IMultihopRouter.sol +139 -0
- package/contracts/router/kyberswap/KyberSwapHelper.sol +79 -0
- package/deployments/1-core.json +29 -0
- package/deployments/1-markets/FRAXUSDC-CURVELP-MARCH30.json +11 -0
- package/deployments/1-markets/LOOKS-STAKING-MARCH30.json +10 -0
- package/deployments/1-markets/STETH-JUNE29.json +10 -0
- package/deployments/1-markets/STETH-MARCH30.json +10 -0
- package/package.json +6 -6
- package/typechain-types/ActionAddRemoveLiq.ts +35 -41
- package/typechain-types/ActionBaseMintRedeem.ts +8 -8
- package/typechain-types/ActionMintRedeem.ts +42 -45
- package/typechain-types/ActionSwapPT.ts +22 -28
- package/typechain-types/ActionSwapYT.ts +22 -28
- package/typechain-types/IPActionAddRemoveLiq.ts +16 -22
- package/typechain-types/IPActionMintRedeem.ts +23 -26
- package/typechain-types/IPActionSwapPT.ts +14 -20
- package/typechain-types/IPActionSwapYT.ts +14 -20
- package/typechain-types/IPAllAction.ts +31 -34
- package/typechain-types/IPFeeDistributor.ts +78 -61
- package/typechain-types/IPFeeDistributorFactory.ts +139 -53
- package/typechain-types/IRewards.ts +5 -35
- package/typechain-types/MarketMathStatic.ts +0 -49
- package/typechain-types/PendleFeeDistributor.ts +117 -409
- package/typechain-types/RouterStatic.ts +69 -40
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +56 -99
- package/typechain-types/factories/ActionBaseMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +64 -119
- 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 +28 -47
- package/typechain-types/factories/ActionSwapYT__factory.ts +28 -47
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
- package/typechain-types/factories/BulkSeller__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +4 -170
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +32 -80
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +40 -100
- package/typechain-types/factories/IPActionSwapPT__factory.ts +16 -40
- package/typechain-types/factories/IPActionSwapYT__factory.ts +16 -40
- package/typechain-types/factories/IPAllAction__factory.ts +104 -260
- package/typechain-types/factories/IPFeeDistributorFactory__factory.ts +34 -25
- package/typechain-types/factories/IPFeeDistributor__factory.ts +31 -42
- package/typechain-types/factories/IRewards__factory.ts +0 -18
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -41
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- 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 +66 -341
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- 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 +41 -118
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +56 -263
- package/typechain-types/index.ts +16 -62
- package/README.md +0 -28
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +0 -592
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +0 -50
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +0 -1075
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +0 -1296
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +0 -1283
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +0 -1218
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +0 -1231
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +0 -133
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +0 -40
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +0 -322
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.json +0 -1171
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.json +0 -10
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.json +0 -24
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.json +0 -328
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.json +0 -467
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.json +0 -30
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.json +0 -398
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.json +0 -278
- package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +0 -322
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.json +0 -160
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.json +0 -10
- package/build/artifacts/contracts/router/swap-aggregator/ISwapAggregator.sol/ISwapAggregator.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/ISwapAggregator.sol/ISwapAggregator.json +0 -51
- package/build/artifacts/contracts/router/swap-aggregator/SwapAggregator.sol/SwapAggregator.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/SwapAggregator.sol/SwapAggregator.json +0 -256
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.json +0 -10
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.json +0 -10
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.json +0 -65
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.json +0 -359
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.json +0 -101
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.json +0 -183
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +0 -215
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +0 -224
- package/contracts/core/StandardizedYield/StEthHelper.sol +0 -71
- package/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol +0 -197
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +0 -170
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +0 -162
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +0 -134
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +0 -154
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +0 -289
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +0 -618
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +0 -68
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +0 -322
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +0 -390
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +0 -329
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +0 -30
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +0 -189
- package/contracts/interfaces/Balancer/IAsset.sol +0 -4
- package/contracts/interfaces/Balancer/IBalancerFees.sol +0 -6
- package/contracts/interfaces/Balancer/IBalancerStablePreview.sol +0 -22
- package/contracts/interfaces/Balancer/IBasePool.sol +0 -30
- package/contracts/interfaces/Balancer/IComposableStable.sol +0 -39
- package/contracts/interfaces/Balancer/IGauge.sol +0 -10
- package/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol +0 -6
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +0 -31
- package/contracts/interfaces/Balancer/IRateProvider.sol +0 -6
- package/contracts/interfaces/Balancer/IVault.sol +0 -78
- package/contracts/interfaces/IApeStaking.sol +0 -30
- package/contracts/offchain-helpers/Multicall2.sol +0 -103
- package/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol +0 -45
- package/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol +0 -71
- package/contracts/router/swap-aggregator/ISwapAggregator.sol +0 -21
- package/contracts/router/swap-aggregator/SwapAggregator.sol +0 -62
- package/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol +0 -302
- package/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol +0 -134
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol +0 -17
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol +0 -185
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol +0 -30
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouter.sol +0 -33
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol +0 -42
- package/deployments/43113-core.json +0 -29
- package/deployments/43113-helper.json +0 -3
- package/deployments/43113-markets/APE-30-MARCH.json +0 -10
- package/deployments/43113-markets/USDC-FEB-2ND.json +0 -10
- package/deployments/43113-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/43113-markets/WETH-FEB-2ND.json +0 -11
- package/deployments/43113-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/43113-testenv.json +0 -22
- package/deployments/80001-core.json +0 -28
- package/deployments/80001-helper.json +0 -3
- package/deployments/80001-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/80001-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/80001-testenv.json +0 -22
- package/typechain-types/BribeDistributor.ts +0 -363
- package/typechain-types/ComposableStablePreview.ts +0 -217
- package/typechain-types/DistributorBase.ts +0 -363
- package/typechain-types/FeeDistributor.ts +0 -416
- package/typechain-types/I1inchAggregationRouterV5.ts +0 -257
- package/typechain-types/IAggregationExecutor.ts +0 -182
- package/typechain-types/IApeStaking.ts +0 -305
- package/typechain-types/IBalancerFees.ts +0 -89
- package/typechain-types/IBalancerStablePreview.ts +0 -217
- package/typechain-types/IBasePool.ts +0 -482
- package/typechain-types/IComposableStable.ts +0 -730
- package/typechain-types/IExecutorHelperEthereum1.ts +0 -599
- package/typechain-types/IGauge.ts +0 -160
- package/typechain-types/IHashflow.ts +0 -159
- package/typechain-types/IKyberSwapAggregationRouterHelper.ts +0 -109
- package/typechain-types/ILiquidityGaugeFactory.ts +0 -99
- package/typechain-types/IMetaAggregationRouter.ts +0 -213
- package/typechain-types/IMetaAggregationRouterV2.ts +0 -221
- package/typechain-types/IMetaStablePool.ts +0 -619
- package/typechain-types/IMultihopRouterEthereum.ts +0 -209
- package/typechain-types/IRateProvider.ts +0 -81
- package/typechain-types/ISwapAggregator.ts +0 -124
- package/typechain-types/IVault.ts +0 -410
- package/typechain-types/MetaStableMath.ts +0 -113
- package/typechain-types/MetaStablePreview.ts +0 -501
- package/typechain-types/Multicall2.ts +0 -437
- package/typechain-types/PendleApeStakingSY.ts +0 -1135
- package/typechain-types/PendleAura3EthSY.ts +0 -1639
- package/typechain-types/PendleAuraBalancerStableLPSY.ts +0 -1523
- package/typechain-types/PendleAuraCbethWstethSY.ts +0 -1626
- package/typechain-types/PendleAuraWethRethSY.ts +0 -1549
- package/typechain-types/PendleAuraWethWstethSY.ts +0 -1562
- package/typechain-types/SAPE.ts +0 -1395
- package/typechain-types/SYBaseAutoCompound.ts +0 -1203
- package/typechain-types/StEthHelper.ts +0 -107
- package/typechain-types/StablePreviewBase.ts +0 -217
- package/typechain-types/SwapAggregator.ts +0 -406
- package/typechain-types/factories/BribeDistributor__factory.ts +0 -303
- package/typechain-types/factories/ComposableStablePreview__factory.ts +0 -190
- package/typechain-types/factories/DistributorBase__factory.ts +0 -249
- package/typechain-types/factories/FeeDistributor__factory.ts +0 -339
- package/typechain-types/factories/I1inchAggregationRouterV5__factory.ts +0 -179
- package/typechain-types/factories/IAggregationExecutor__factory.ts +0 -84
- package/typechain-types/factories/IApeStaking__factory.ts +0 -161
- package/typechain-types/factories/IBalancerFees__factory.ts +0 -36
- package/typechain-types/factories/IBalancerStablePreview__factory.ts +0 -152
- package/typechain-types/factories/IBasePool__factory.ts +0 -340
- package/typechain-types/factories/IComposableStable__factory.ts +0 -482
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +0 -378
- package/typechain-types/factories/IGauge__factory.ts +0 -70
- package/typechain-types/factories/IHashflow__factory.ts +0 -113
- package/typechain-types/factories/IKyberSwapAggregationRouterHelper__factory.ts +0 -56
- package/typechain-types/factories/ILiquidityGaugeFactory__factory.ts +0 -49
- package/typechain-types/factories/IMetaAggregationRouterV2__factory.ts +0 -234
- package/typechain-types/factories/IMetaAggregationRouter__factory.ts +0 -202
- package/typechain-types/factories/IMetaStablePool__factory.ts +0 -413
- package/typechain-types/factories/IMultihopRouterEthereum__factory.ts +0 -155
- package/typechain-types/factories/IRateProvider__factory.ts +0 -36
- package/typechain-types/factories/ISwapAggregator__factory.ts +0 -66
- package/typechain-types/factories/IVault__factory.ts +0 -287
- package/typechain-types/factories/MetaStableMath__factory.ts +0 -93
- package/typechain-types/factories/MetaStablePreview__factory.ts +0 -375
- package/typechain-types/factories/Multicall2__factory.ts +0 -372
- package/typechain-types/factories/PendleApeStakingSY__factory.ts +0 -981
- package/typechain-types/factories/PendleAura3EthSY__factory.ts +0 -1365
- package/typechain-types/factories/PendleAuraBalancerStableLPSY__factory.ts +0 -1190
- package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +0 -1356
- package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +0 -1291
- package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +0 -1304
- package/typechain-types/factories/SAPE__factory.ts +0 -1142
- package/typechain-types/factories/SYBaseAutoCompound__factory.ts +0 -942
- package/typechain-types/factories/StEthHelper__factory.ts +0 -62
- package/typechain-types/factories/StablePreviewBase__factory.ts +0 -148
- package/typechain-types/factories/SwapAggregator__factory.ts +0 -309
|
@@ -14,17 +14,6 @@ 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
|
-
|
|
28
17
|
function addLiquidityDualSyAndPtStatic(
|
|
29
18
|
address market,
|
|
30
19
|
uint256 netSyDesired,
|
|
@@ -47,14 +36,17 @@ library MarketMathStatic {
|
|
|
47
36
|
}
|
|
48
37
|
|
|
49
38
|
/// @dev netPtToSwap is the parameter to approx
|
|
50
|
-
function addLiquiditySinglePtStatic(
|
|
39
|
+
function addLiquiditySinglePtStatic(
|
|
40
|
+
address market,
|
|
41
|
+
uint256 netPtIn,
|
|
42
|
+
ApproxParams memory approxParams
|
|
43
|
+
)
|
|
51
44
|
external
|
|
52
45
|
returns (
|
|
53
46
|
uint256 netLpOut,
|
|
54
47
|
uint256 netPtToSwap,
|
|
55
48
|
uint256 netSyFee,
|
|
56
|
-
uint256 priceImpact
|
|
57
|
-
uint256 exchangeRateAfter
|
|
49
|
+
uint256 priceImpact
|
|
58
50
|
)
|
|
59
51
|
{
|
|
60
52
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -63,7 +55,7 @@ library MarketMathStatic {
|
|
|
63
55
|
pyIndex(market),
|
|
64
56
|
netPtIn,
|
|
65
57
|
block.timestamp,
|
|
66
|
-
|
|
58
|
+
approxParams
|
|
67
59
|
);
|
|
68
60
|
|
|
69
61
|
state = IPMarket(market).readState(address(this)); // re-read
|
|
@@ -80,19 +72,21 @@ library MarketMathStatic {
|
|
|
80
72
|
block.timestamp
|
|
81
73
|
);
|
|
82
74
|
|
|
83
|
-
priceImpact =
|
|
84
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
75
|
+
priceImpact = calcPriceImpact(market, netPtToSwap.neg());
|
|
85
76
|
}
|
|
86
77
|
|
|
87
78
|
/// @dev netPtFromSwap is the parameter to approx
|
|
88
|
-
function addLiquiditySingleSyStatic(
|
|
79
|
+
function addLiquiditySingleSyStatic(
|
|
80
|
+
address market,
|
|
81
|
+
uint256 netSyIn,
|
|
82
|
+
ApproxParams memory approxParams
|
|
83
|
+
)
|
|
89
84
|
public
|
|
90
85
|
returns (
|
|
91
86
|
uint256 netLpOut,
|
|
92
87
|
uint256 netPtFromSwap,
|
|
93
88
|
uint256 netSyFee,
|
|
94
|
-
uint256 priceImpact
|
|
95
|
-
uint256 exchangeRateAfter
|
|
89
|
+
uint256 priceImpact
|
|
96
90
|
)
|
|
97
91
|
{
|
|
98
92
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -101,7 +95,7 @@ library MarketMathStatic {
|
|
|
101
95
|
pyIndex(market),
|
|
102
96
|
netSyIn,
|
|
103
97
|
block.timestamp,
|
|
104
|
-
|
|
98
|
+
approxParams
|
|
105
99
|
);
|
|
106
100
|
|
|
107
101
|
state = IPMarket(market).readState(address(this)); // re-read
|
|
@@ -114,8 +108,7 @@ library MarketMathStatic {
|
|
|
114
108
|
);
|
|
115
109
|
(, netLpOut, , ) = state.addLiquidity(netSyIn - netSySwap, netPtFromSwap, block.timestamp);
|
|
116
110
|
|
|
117
|
-
priceImpact =
|
|
118
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
111
|
+
priceImpact = calcPriceImpact(market, netPtFromSwap.Int());
|
|
119
112
|
}
|
|
120
113
|
|
|
121
114
|
function removeLiquidityDualSyAndPtStatic(address market, uint256 netLpToRemove)
|
|
@@ -128,14 +121,17 @@ library MarketMathStatic {
|
|
|
128
121
|
}
|
|
129
122
|
|
|
130
123
|
/// @dev netPtFromSwap is the parameter to approx
|
|
131
|
-
function removeLiquiditySinglePtStatic(
|
|
124
|
+
function removeLiquiditySinglePtStatic(
|
|
125
|
+
address market,
|
|
126
|
+
uint256 netLpToRemove,
|
|
127
|
+
ApproxParams memory approxParams
|
|
128
|
+
)
|
|
132
129
|
external
|
|
133
130
|
returns (
|
|
134
131
|
uint256 netPtOut,
|
|
135
132
|
uint256 netPtFromSwap,
|
|
136
133
|
uint256 netSyFee,
|
|
137
|
-
uint256 priceImpact
|
|
138
|
-
uint256 exchangeRateAfter
|
|
134
|
+
uint256 priceImpact
|
|
139
135
|
)
|
|
140
136
|
{
|
|
141
137
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -145,15 +141,11 @@ library MarketMathStatic {
|
|
|
145
141
|
pyIndex(market),
|
|
146
142
|
syFromBurn,
|
|
147
143
|
block.timestamp,
|
|
148
|
-
|
|
144
|
+
approxParams
|
|
149
145
|
);
|
|
150
146
|
|
|
151
147
|
netPtOut = ptFromBurn + netPtFromSwap;
|
|
152
|
-
priceImpact =
|
|
153
|
-
|
|
154
|
-
// Execute swap to calculate exchangeRateAfter
|
|
155
|
-
state.swapSyForExactPt(pyIndex(market), netPtFromSwap, block.timestamp);
|
|
156
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
148
|
+
priceImpact = calcPriceImpact(market, netPtFromSwap.Int());
|
|
157
149
|
}
|
|
158
150
|
|
|
159
151
|
function removeLiquiditySingleSyStatic(address market, uint256 netLpToRemove)
|
|
@@ -161,8 +153,7 @@ library MarketMathStatic {
|
|
|
161
153
|
returns (
|
|
162
154
|
uint256 netSyOut,
|
|
163
155
|
uint256 netSyFee,
|
|
164
|
-
uint256 priceImpact
|
|
165
|
-
uint256 exchangeRateAfter
|
|
156
|
+
uint256 priceImpact
|
|
166
157
|
)
|
|
167
158
|
{
|
|
168
159
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -180,8 +171,7 @@ library MarketMathStatic {
|
|
|
180
171
|
);
|
|
181
172
|
|
|
182
173
|
netSyOut = syFromBurn + syFromSwap;
|
|
183
|
-
priceImpact =
|
|
184
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
174
|
+
priceImpact = calcPriceImpact(market, ptFromBurn.neg());
|
|
185
175
|
}
|
|
186
176
|
}
|
|
187
177
|
|
|
@@ -190,8 +180,7 @@ library MarketMathStatic {
|
|
|
190
180
|
returns (
|
|
191
181
|
uint256 netSyOut,
|
|
192
182
|
uint256 netSyFee,
|
|
193
|
-
uint256 priceImpact
|
|
194
|
-
uint256 exchangeRateAfter
|
|
183
|
+
uint256 priceImpact
|
|
195
184
|
)
|
|
196
185
|
{
|
|
197
186
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -200,8 +189,7 @@ library MarketMathStatic {
|
|
|
200
189
|
exactPtIn,
|
|
201
190
|
block.timestamp
|
|
202
191
|
);
|
|
203
|
-
priceImpact =
|
|
204
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
192
|
+
priceImpact = calcPriceImpact(market, exactPtIn.neg());
|
|
205
193
|
}
|
|
206
194
|
|
|
207
195
|
function swapSyForExactPtStatic(address market, uint256 exactPtOut)
|
|
@@ -209,8 +197,7 @@ library MarketMathStatic {
|
|
|
209
197
|
returns (
|
|
210
198
|
uint256 netSyIn,
|
|
211
199
|
uint256 netSyFee,
|
|
212
|
-
uint256 priceImpact
|
|
213
|
-
uint256 exchangeRateAfter
|
|
200
|
+
uint256 priceImpact
|
|
214
201
|
)
|
|
215
202
|
{
|
|
216
203
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -219,18 +206,20 @@ library MarketMathStatic {
|
|
|
219
206
|
exactPtOut,
|
|
220
207
|
block.timestamp
|
|
221
208
|
);
|
|
222
|
-
priceImpact =
|
|
223
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
209
|
+
priceImpact = calcPriceImpact(market, exactPtOut.Int());
|
|
224
210
|
}
|
|
225
211
|
|
|
226
212
|
/// @dev netPtOut is the parameter to approx
|
|
227
|
-
function swapExactSyForPtStatic(
|
|
213
|
+
function swapExactSyForPtStatic(
|
|
214
|
+
address market,
|
|
215
|
+
uint256 exactSyIn,
|
|
216
|
+
ApproxParams memory approxParams
|
|
217
|
+
)
|
|
228
218
|
public
|
|
229
219
|
returns (
|
|
230
220
|
uint256 netPtOut,
|
|
231
221
|
uint256 netSyFee,
|
|
232
|
-
uint256 priceImpact
|
|
233
|
-
uint256 exchangeRateAfter
|
|
222
|
+
uint256 priceImpact
|
|
234
223
|
)
|
|
235
224
|
{
|
|
236
225
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -238,23 +227,22 @@ library MarketMathStatic {
|
|
|
238
227
|
pyIndex(market),
|
|
239
228
|
exactSyIn,
|
|
240
229
|
block.timestamp,
|
|
241
|
-
|
|
230
|
+
approxParams
|
|
242
231
|
);
|
|
243
|
-
priceImpact =
|
|
244
|
-
|
|
245
|
-
// Execute swap to calculate exchangeRateAfter
|
|
246
|
-
state.swapSyForExactPt(pyIndex(market), netPtOut, block.timestamp);
|
|
247
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
232
|
+
priceImpact = calcPriceImpact(market, netPtOut.Int());
|
|
248
233
|
}
|
|
249
234
|
|
|
250
235
|
/// @dev netPtIn is the parameter to approx
|
|
251
|
-
function swapPtForExactSyStatic(
|
|
236
|
+
function swapPtForExactSyStatic(
|
|
237
|
+
address market,
|
|
238
|
+
uint256 exactSyOut,
|
|
239
|
+
ApproxParams memory approxParams
|
|
240
|
+
)
|
|
252
241
|
public
|
|
253
242
|
returns (
|
|
254
243
|
uint256 netPtIn,
|
|
255
244
|
uint256 netSyFee,
|
|
256
|
-
uint256 priceImpact
|
|
257
|
-
uint256 exchangeRateAfter
|
|
245
|
+
uint256 priceImpact
|
|
258
246
|
)
|
|
259
247
|
{
|
|
260
248
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -263,13 +251,9 @@ library MarketMathStatic {
|
|
|
263
251
|
pyIndex(market),
|
|
264
252
|
exactSyOut,
|
|
265
253
|
block.timestamp,
|
|
266
|
-
|
|
254
|
+
approxParams
|
|
267
255
|
);
|
|
268
|
-
priceImpact =
|
|
269
|
-
|
|
270
|
-
// Execute swap to calculate exchangeRateAfter
|
|
271
|
-
state.swapExactPtForSy(pyIndex(market), netPtIn, block.timestamp);
|
|
272
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
256
|
+
priceImpact = calcPriceImpact(market, netPtIn.neg());
|
|
273
257
|
}
|
|
274
258
|
|
|
275
259
|
function swapSyForExactYtStatic(address market, uint256 exactYtOut)
|
|
@@ -277,13 +261,11 @@ library MarketMathStatic {
|
|
|
277
261
|
returns (
|
|
278
262
|
uint256 netSyIn,
|
|
279
263
|
uint256 netSyFee,
|
|
280
|
-
uint256 priceImpact
|
|
281
|
-
uint256 exchangeRateAfter
|
|
264
|
+
uint256 priceImpact
|
|
282
265
|
)
|
|
283
266
|
{
|
|
284
|
-
priceImpact = calcPriceImpactYt(market, exactYtOut.neg());
|
|
285
|
-
|
|
286
267
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
268
|
+
|
|
287
269
|
PYIndex index = pyIndex(market);
|
|
288
270
|
|
|
289
271
|
uint256 syReceived;
|
|
@@ -296,17 +278,20 @@ library MarketMathStatic {
|
|
|
296
278
|
uint256 totalSyNeed = index.assetToSyUp(exactYtOut);
|
|
297
279
|
netSyIn = totalSyNeed.subMax0(syReceived);
|
|
298
280
|
|
|
299
|
-
|
|
281
|
+
priceImpact = calcPriceImpact(market, exactYtOut.neg());
|
|
300
282
|
}
|
|
301
283
|
|
|
302
284
|
/// @dev netYtOut is the parameter to approx
|
|
303
|
-
function swapExactSyForYtStatic(
|
|
285
|
+
function swapExactSyForYtStatic(
|
|
286
|
+
address market,
|
|
287
|
+
uint256 exactSyIn,
|
|
288
|
+
ApproxParams memory approxParams
|
|
289
|
+
)
|
|
304
290
|
public
|
|
305
291
|
returns (
|
|
306
292
|
uint256 netYtOut,
|
|
307
293
|
uint256 netSyFee,
|
|
308
|
-
uint256 priceImpact
|
|
309
|
-
uint256 exchangeRateAfter
|
|
294
|
+
uint256 priceImpact
|
|
310
295
|
)
|
|
311
296
|
{
|
|
312
297
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -316,14 +301,10 @@ library MarketMathStatic {
|
|
|
316
301
|
index,
|
|
317
302
|
exactSyIn,
|
|
318
303
|
block.timestamp,
|
|
319
|
-
|
|
304
|
+
approxParams
|
|
320
305
|
);
|
|
321
306
|
|
|
322
|
-
priceImpact =
|
|
323
|
-
|
|
324
|
-
// Execute swap to calculate exchangeRateAfter
|
|
325
|
-
state.swapExactPtForSy(index, netYtOut, block.timestamp);
|
|
326
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
307
|
+
priceImpact = calcPriceImpact(market, netYtOut.neg());
|
|
327
308
|
}
|
|
328
309
|
|
|
329
310
|
function swapExactYtForSyStatic(address market, uint256 exactYtIn)
|
|
@@ -331,12 +312,9 @@ library MarketMathStatic {
|
|
|
331
312
|
returns (
|
|
332
313
|
uint256 netSyOut,
|
|
333
314
|
uint256 netSyFee,
|
|
334
|
-
uint256 priceImpact
|
|
335
|
-
uint256 exchangeRateAfter
|
|
315
|
+
uint256 priceImpact
|
|
336
316
|
)
|
|
337
317
|
{
|
|
338
|
-
priceImpact = calcPriceImpactYt(market, exactYtIn.Int());
|
|
339
|
-
|
|
340
318
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
341
319
|
|
|
342
320
|
PYIndex index = pyIndex(market);
|
|
@@ -348,17 +326,20 @@ library MarketMathStatic {
|
|
|
348
326
|
uint256 amountPYToRedeemSyOut = exactYtIn - amountPYToRepaySyOwed;
|
|
349
327
|
|
|
350
328
|
netSyOut = index.assetToSy(amountPYToRedeemSyOut);
|
|
351
|
-
|
|
329
|
+
priceImpact = calcPriceImpact(market, exactYtIn.Int());
|
|
352
330
|
}
|
|
353
331
|
|
|
354
332
|
/// @dev netYtIn is the parameter to approx
|
|
355
|
-
function swapYtForExactSyStatic(
|
|
333
|
+
function swapYtForExactSyStatic(
|
|
334
|
+
address market,
|
|
335
|
+
uint256 exactSyOut,
|
|
336
|
+
ApproxParams memory approxParams
|
|
337
|
+
)
|
|
356
338
|
external
|
|
357
339
|
returns (
|
|
358
340
|
uint256 netYtIn,
|
|
359
341
|
uint256 netSyFee,
|
|
360
|
-
uint256 priceImpact
|
|
361
|
-
uint256 exchangeRateAfter
|
|
342
|
+
uint256 priceImpact
|
|
362
343
|
)
|
|
363
344
|
{
|
|
364
345
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -369,24 +350,23 @@ library MarketMathStatic {
|
|
|
369
350
|
index,
|
|
370
351
|
exactSyOut,
|
|
371
352
|
block.timestamp,
|
|
372
|
-
|
|
353
|
+
approxParams
|
|
373
354
|
);
|
|
374
|
-
priceImpact =
|
|
375
|
-
|
|
376
|
-
// Execute swap to calculate exchangeRateAfter
|
|
377
|
-
state.swapSyForExactPt(index, netYtIn, block.timestamp);
|
|
378
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
355
|
+
priceImpact = calcPriceImpact(market, netYtIn.Int());
|
|
379
356
|
}
|
|
380
357
|
|
|
381
358
|
// totalPtToSwap is the param to approx
|
|
382
|
-
function swapExactPtForYt(
|
|
359
|
+
function swapExactPtForYt(
|
|
360
|
+
address market,
|
|
361
|
+
uint256 exactPtIn,
|
|
362
|
+
ApproxParams memory approxParams
|
|
363
|
+
)
|
|
383
364
|
external
|
|
384
365
|
returns (
|
|
385
366
|
uint256 netYtOut,
|
|
386
367
|
uint256 totalPtToSwap,
|
|
387
368
|
uint256 netSyFee,
|
|
388
|
-
uint256 priceImpact
|
|
389
|
-
uint256 exchangeRateAfter
|
|
369
|
+
uint256 priceImpact
|
|
390
370
|
)
|
|
391
371
|
{
|
|
392
372
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -396,24 +376,23 @@ library MarketMathStatic {
|
|
|
396
376
|
index,
|
|
397
377
|
exactPtIn,
|
|
398
378
|
block.timestamp,
|
|
399
|
-
|
|
379
|
+
approxParams
|
|
400
380
|
);
|
|
401
|
-
priceImpact =
|
|
402
|
-
|
|
403
|
-
// Execute swap to calculate exchangeRateAfter
|
|
404
|
-
state.swapExactPtForSy(index, totalPtToSwap, block.timestamp);
|
|
405
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
381
|
+
priceImpact = calcPriceImpact(market, totalPtToSwap.neg());
|
|
406
382
|
}
|
|
407
383
|
|
|
408
384
|
// totalPtSwapped is the param to approx
|
|
409
|
-
function swapExactYtForPt(
|
|
385
|
+
function swapExactYtForPt(
|
|
386
|
+
address market,
|
|
387
|
+
uint256 exactYtIn,
|
|
388
|
+
ApproxParams memory approxParams
|
|
389
|
+
)
|
|
410
390
|
external
|
|
411
391
|
returns (
|
|
412
392
|
uint256 netPtOut,
|
|
413
393
|
uint256 totalPtSwapped,
|
|
414
394
|
uint256 netSyFee,
|
|
415
|
-
uint256 priceImpact
|
|
416
|
-
uint256 exchangeRateAfter
|
|
395
|
+
uint256 priceImpact
|
|
417
396
|
)
|
|
418
397
|
{
|
|
419
398
|
MarketState memory state = IPMarket(market).readState(address(this));
|
|
@@ -423,14 +402,10 @@ library MarketMathStatic {
|
|
|
423
402
|
index,
|
|
424
403
|
exactYtIn,
|
|
425
404
|
block.timestamp,
|
|
426
|
-
|
|
405
|
+
approxParams
|
|
427
406
|
);
|
|
428
407
|
|
|
429
|
-
priceImpact =
|
|
430
|
-
|
|
431
|
-
// Execute swap to calculate exchangeRateAfter
|
|
432
|
-
state.swapSyForExactPt(index, totalPtSwapped, block.timestamp);
|
|
433
|
-
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
408
|
+
priceImpact = calcPriceImpact(market, totalPtSwapped.Int());
|
|
434
409
|
}
|
|
435
410
|
|
|
436
411
|
function pyIndex(address market) public returns (PYIndex index) {
|
|
@@ -439,25 +414,8 @@ library MarketMathStatic {
|
|
|
439
414
|
return YT.newIndex();
|
|
440
415
|
}
|
|
441
416
|
|
|
442
|
-
function
|
|
443
|
-
|
|
444
|
-
MarketState memory state = IPMarket(market).readState(address(this));
|
|
445
|
-
return _getTradeExchangeRateExcludeFee(market, state);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
function _getTradeExchangeRateExcludeFee(address market, MarketState memory state)
|
|
449
|
-
public
|
|
450
|
-
returns (uint256)
|
|
451
|
-
{
|
|
452
|
-
MarketPreCompute memory comp = state.getMarketPreCompute(pyIndex(market), block.timestamp);
|
|
453
|
-
int256 preFeeExchangeRate = MarketMathCore._getExchangeRate(
|
|
454
|
-
state.totalPt,
|
|
455
|
-
comp.totalAsset,
|
|
456
|
-
comp.rateScalar,
|
|
457
|
-
comp.rateAnchor,
|
|
458
|
-
0
|
|
459
|
-
);
|
|
460
|
-
return preFeeExchangeRate.Uint();
|
|
417
|
+
function getExchangeRate(address market) public returns (uint256) {
|
|
418
|
+
return getTradeExchangeRateIncludeFee(market, 0);
|
|
461
419
|
}
|
|
462
420
|
|
|
463
421
|
function getTradeExchangeRateIncludeFee(address market, int256 netPtOut)
|
|
@@ -487,40 +445,14 @@ library MarketMathStatic {
|
|
|
487
445
|
}
|
|
488
446
|
}
|
|
489
447
|
|
|
490
|
-
function
|
|
448
|
+
function calcPriceImpact(address market, int256 netPtOut)
|
|
491
449
|
public
|
|
492
450
|
returns (uint256 priceImpact)
|
|
493
451
|
{
|
|
494
|
-
uint256 preTradeRate =
|
|
452
|
+
uint256 preTradeRate = getExchangeRate(market);
|
|
495
453
|
uint256 tradedRate = getTradeExchangeRateIncludeFee(market, netPtOut);
|
|
496
|
-
priceImpact = _calculateImpact(preTradeRate, tradedRate);
|
|
497
|
-
}
|
|
498
454
|
|
|
499
|
-
|
|
500
|
-
public
|
|
501
|
-
returns (uint256 priceImpact)
|
|
502
|
-
{
|
|
503
|
-
uint256 ytPreTradeRate = _calcVirtualYTPrice(
|
|
504
|
-
getTradeExchangeRateIncludeFee(market, _getSign(netPtOut))
|
|
505
|
-
);
|
|
506
|
-
uint256 ytTradedRate = _calcVirtualYTPrice(
|
|
507
|
-
getTradeExchangeRateIncludeFee(market, netPtOut)
|
|
508
|
-
);
|
|
509
|
-
priceImpact = _calculateImpact(ytPreTradeRate, ytTradedRate);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
function calcPriceImpactPY(address market, int256 netPtOut)
|
|
513
|
-
public
|
|
514
|
-
returns (uint256 priceImpact)
|
|
515
|
-
{
|
|
516
|
-
uint256 ptPreTradeRate = getTradeExchangeRateIncludeFee(market, _getSign(netPtOut));
|
|
517
|
-
uint256 ytPreTradeRate = _calcVirtualYTPrice(ptPreTradeRate);
|
|
518
|
-
uint256 ptTradeRate = getTradeExchangeRateIncludeFee(market, netPtOut);
|
|
519
|
-
uint256 ytTradeRate = _calcVirtualYTPrice(ptTradeRate);
|
|
520
|
-
|
|
521
|
-
uint256 pyPreTradeRate = ytPreTradeRate.divDown(ptPreTradeRate);
|
|
522
|
-
uint256 pyTradeRate = ytTradeRate.divDown(ptTradeRate);
|
|
523
|
-
priceImpact = _calculateImpact(pyPreTradeRate, pyTradeRate);
|
|
455
|
+
priceImpact = (tradedRate.Int() - preTradeRate.Int()).abs().divDown(preTradeRate);
|
|
524
456
|
}
|
|
525
457
|
|
|
526
458
|
function getPtImpliedYield(address market) public view returns (int256) {
|
|
@@ -529,29 +461,4 @@ library MarketMathStatic {
|
|
|
529
461
|
int256 lnImpliedRate = (state.lastLnImpliedRate).Int();
|
|
530
462
|
return lnImpliedRate.exp();
|
|
531
463
|
}
|
|
532
|
-
|
|
533
|
-
function _calcVirtualYTPrice(uint256 ptAssetExchangeRate)
|
|
534
|
-
private
|
|
535
|
-
pure
|
|
536
|
-
returns (uint256 ytAssetExchangeRate)
|
|
537
|
-
{
|
|
538
|
-
// 1 asset = EX pt
|
|
539
|
-
// 1 pt = 1/EX Asset
|
|
540
|
-
// 1 yt + 1/EX Asset = 1 Asset
|
|
541
|
-
// 1 yt = 1 Asset - 1/EX Asset
|
|
542
|
-
// 1 yt = (EX - 1) / EX Asset
|
|
543
|
-
return (ptAssetExchangeRate - Math.ONE).divDown(ptAssetExchangeRate);
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
function _getSign(int256 netPtOut) private pure returns (int256) {
|
|
547
|
-
return netPtOut > 0 ? int256(1) : int256(-1);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
function _calculateImpact(uint256 rateBefore, uint256 rateTraded)
|
|
551
|
-
private
|
|
552
|
-
pure
|
|
553
|
-
returns (uint256 impact)
|
|
554
|
-
{
|
|
555
|
-
impact = (rateBefore.Int() - rateTraded.Int()).abs().divDown(rateBefore);
|
|
556
|
-
}
|
|
557
464
|
}
|