@pendle/core-v2 0.10.2-testnet → 0.10.3-testnet
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol/PendleYearnVaultSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.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 +8 -8
- 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/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.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/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.json +2 -2
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.json +4 -4
- package/build/artifacts/contracts/core/actions/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.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 +2 -2
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +2 -2
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.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/IPVotingEscrow.sol/IPVotingEscrow.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.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/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/SCY/SCYUtils.sol/SCYUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/{MarketApproxLib.json → MarketApproxPtInLib.json} +3 -3
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.json +10 -0
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +116 -56
- package/build/artifacts/contracts/periphery/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/periphery/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol +6 -1
- package/contracts/core/actions/ActionAddRemoveLiq.sol +2 -1
- package/contracts/core/actions/ActionSwapPT.sol +2 -1
- package/contracts/core/actions/ActionSwapYT.sol +3 -2
- package/contracts/interfaces/IPActionSwapYT.sol +2 -2
- package/contracts/libraries/math/MarketApproxLib.sol +373 -447
- package/contracts/offchain-helpers/MarketMathStatic.sol +32 -14
- package/contracts/offchain-helpers/RouterStatic.sol +48 -18
- package/package.json +1 -1
- package/typechain-types/ActionSwapYT.ts +5 -5
- package/typechain-types/IPActionSwapYT.ts +5 -5
- package/typechain-types/IPAllAction.ts +5 -5
- package/typechain-types/RouterStatic.ts +57 -4
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +3 -3
- package/typechain-types/factories/IPActionSwapYT__factory.ts +2 -2
- package/typechain-types/factories/IPAllAction__factory.ts +2 -2
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleAaveV3SCY__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/PendleQiSAvaxSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleSJoeSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleStargateSCY__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +61 -1
- package/typechain-types/hardhat.d.ts +0 -90
- package/typechain-types/index.ts +0 -20
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxLib.dbg.json +0 -4
|
@@ -6,7 +6,8 @@ import "../interfaces/IPMarket.sol";
|
|
|
6
6
|
|
|
7
7
|
library MarketMathStatic {
|
|
8
8
|
using MarketMathCore for MarketState;
|
|
9
|
-
using
|
|
9
|
+
using MarketApproxPtInLib for MarketState;
|
|
10
|
+
using MarketApproxPtOutLib for MarketState;
|
|
10
11
|
using Math for uint256;
|
|
11
12
|
using Math for int256;
|
|
12
13
|
using LogExpMath for int256;
|
|
@@ -63,6 +64,7 @@ library MarketMathStatic {
|
|
|
63
64
|
tokenUsed = (tokenDesired * scyUsed).rawDivUp(scyDesired);
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
/// @dev netPtToSwap is the parameter to approx
|
|
66
68
|
function addLiquiditySinglePtStatic(
|
|
67
69
|
address market,
|
|
68
70
|
uint256 netPtIn,
|
|
@@ -71,35 +73,39 @@ library MarketMathStatic {
|
|
|
71
73
|
external
|
|
72
74
|
returns (
|
|
73
75
|
uint256 netLpOut,
|
|
76
|
+
uint256 netPtToSwap,
|
|
74
77
|
uint256 netScyFee,
|
|
75
78
|
uint256 priceImpact
|
|
76
79
|
)
|
|
77
80
|
{
|
|
78
81
|
MarketState memory state = IPMarket(market).readState();
|
|
79
82
|
|
|
80
|
-
(
|
|
83
|
+
(netPtToSwap, , ) = state.approxSwapPtToAddLiquidity(
|
|
81
84
|
pyIndex(market),
|
|
82
85
|
netPtIn,
|
|
83
86
|
block.timestamp,
|
|
84
87
|
approxParams
|
|
85
88
|
);
|
|
86
89
|
|
|
90
|
+
state = IPMarket(market).readState(); // re-read
|
|
91
|
+
|
|
87
92
|
uint256 netScyReceived;
|
|
88
93
|
(netScyReceived, netScyFee) = state.swapExactPtForScy(
|
|
89
94
|
pyIndex(market),
|
|
90
|
-
|
|
95
|
+
netPtToSwap,
|
|
91
96
|
block.timestamp
|
|
92
97
|
);
|
|
93
98
|
(, netLpOut, , ) = state.addLiquidity(
|
|
94
99
|
pyIndex(market),
|
|
95
100
|
netScyReceived,
|
|
96
|
-
netPtIn -
|
|
101
|
+
netPtIn - netPtToSwap,
|
|
97
102
|
block.timestamp
|
|
98
103
|
);
|
|
99
104
|
|
|
100
|
-
priceImpact = calcPriceImpact(market,
|
|
105
|
+
priceImpact = calcPriceImpact(market, netPtToSwap.neg());
|
|
101
106
|
}
|
|
102
107
|
|
|
108
|
+
/// @dev netPtFromSwap is the parameter to approx
|
|
103
109
|
function addLiquiditySingleScyStatic(
|
|
104
110
|
address market,
|
|
105
111
|
uint256 netScyIn,
|
|
@@ -108,35 +114,39 @@ library MarketMathStatic {
|
|
|
108
114
|
public
|
|
109
115
|
returns (
|
|
110
116
|
uint256 netLpOut,
|
|
117
|
+
uint256 netPtFromSwap,
|
|
111
118
|
uint256 netScyFee,
|
|
112
119
|
uint256 priceImpact
|
|
113
120
|
)
|
|
114
121
|
{
|
|
115
122
|
MarketState memory state = IPMarket(market).readState();
|
|
116
123
|
|
|
117
|
-
(
|
|
124
|
+
(netPtFromSwap, , ) = state.approxSwapScyToAddLiquidity(
|
|
118
125
|
pyIndex(market),
|
|
119
126
|
netScyIn,
|
|
120
127
|
block.timestamp,
|
|
121
128
|
approxParams
|
|
122
129
|
);
|
|
123
130
|
|
|
131
|
+
state = IPMarket(market).readState(); // re-read
|
|
132
|
+
|
|
124
133
|
uint256 netScySwap;
|
|
125
134
|
(netScySwap, netScyFee) = state.swapScyForExactPt(
|
|
126
135
|
pyIndex(market),
|
|
127
|
-
|
|
136
|
+
netPtFromSwap,
|
|
128
137
|
block.timestamp
|
|
129
138
|
);
|
|
130
139
|
(, netLpOut, , ) = state.addLiquidity(
|
|
131
140
|
pyIndex(market),
|
|
132
141
|
netScyIn - netScySwap,
|
|
133
|
-
|
|
142
|
+
netPtFromSwap,
|
|
134
143
|
block.timestamp
|
|
135
144
|
);
|
|
136
145
|
|
|
137
|
-
priceImpact = calcPriceImpact(market,
|
|
146
|
+
priceImpact = calcPriceImpact(market, netPtFromSwap.Int());
|
|
138
147
|
}
|
|
139
148
|
|
|
149
|
+
/// @dev netPtFromSwap is the parameter to approx
|
|
140
150
|
function addLiquiditySingleBaseTokenStatic(
|
|
141
151
|
address market,
|
|
142
152
|
address baseToken,
|
|
@@ -146,6 +156,7 @@ library MarketMathStatic {
|
|
|
146
156
|
external
|
|
147
157
|
returns (
|
|
148
158
|
uint256 netLpOut,
|
|
159
|
+
uint256 netPtFromSwap,
|
|
149
160
|
uint256 netScyFee,
|
|
150
161
|
uint256 priceImpact
|
|
151
162
|
)
|
|
@@ -183,6 +194,7 @@ library MarketMathStatic {
|
|
|
183
194
|
netTokenOut = SCY.previewRedeem(tokenOut, netScyOut);
|
|
184
195
|
}
|
|
185
196
|
|
|
197
|
+
/// @dev netPtFromSwap is the parameter to approx
|
|
186
198
|
function removeLiquiditySinglePtStatic(
|
|
187
199
|
address market,
|
|
188
200
|
uint256 lpToRemove,
|
|
@@ -191,6 +203,7 @@ library MarketMathStatic {
|
|
|
191
203
|
external
|
|
192
204
|
returns (
|
|
193
205
|
uint256 netPtOut,
|
|
206
|
+
uint256 netPtFromSwap,
|
|
194
207
|
uint256 netScyFee,
|
|
195
208
|
uint256 priceImpact
|
|
196
209
|
)
|
|
@@ -198,16 +211,15 @@ library MarketMathStatic {
|
|
|
198
211
|
MarketState memory state = IPMarket(market).readState();
|
|
199
212
|
|
|
200
213
|
(uint256 scyFromBurn, uint256 ptFromBurn) = state.removeLiquidity(lpToRemove);
|
|
201
|
-
|
|
202
|
-
(ptFromSwap, , netScyFee) = state.approxSwapExactScyForPt(
|
|
214
|
+
(netPtFromSwap, , netScyFee) = state.approxSwapExactScyForPt(
|
|
203
215
|
pyIndex(market),
|
|
204
216
|
scyFromBurn,
|
|
205
217
|
block.timestamp,
|
|
206
218
|
approxParams
|
|
207
219
|
);
|
|
208
220
|
|
|
209
|
-
netPtOut = ptFromBurn +
|
|
210
|
-
priceImpact = calcPriceImpact(market,
|
|
221
|
+
netPtOut = ptFromBurn + netPtFromSwap;
|
|
222
|
+
priceImpact = calcPriceImpact(market, netPtFromSwap.Int());
|
|
211
223
|
}
|
|
212
224
|
|
|
213
225
|
function removeLiquiditySingleScyStatic(address market, uint256 lpToRemove)
|
|
@@ -285,6 +297,7 @@ library MarketMathStatic {
|
|
|
285
297
|
priceImpact = calcPriceImpact(market, exactPtOut.Int());
|
|
286
298
|
}
|
|
287
299
|
|
|
300
|
+
/// @dev netPtOut is the parameter to approx
|
|
288
301
|
function swapExactScyForPtStatic(
|
|
289
302
|
address market,
|
|
290
303
|
uint256 exactScyIn,
|
|
@@ -307,6 +320,7 @@ library MarketMathStatic {
|
|
|
307
320
|
priceImpact = calcPriceImpact(market, netPtOut.Int());
|
|
308
321
|
}
|
|
309
322
|
|
|
323
|
+
/// @dev netPtIn is the parameter to approx
|
|
310
324
|
function swapPtForExactScyStatic(
|
|
311
325
|
address market,
|
|
312
326
|
uint256 exactScyOut,
|
|
@@ -330,6 +344,7 @@ library MarketMathStatic {
|
|
|
330
344
|
priceImpact = calcPriceImpact(market, netPtIn.neg());
|
|
331
345
|
}
|
|
332
346
|
|
|
347
|
+
/// @dev netPtOut is the parameter to approx
|
|
333
348
|
function swapExactBaseTokenForPtStatic(
|
|
334
349
|
address market,
|
|
335
350
|
address baseToken,
|
|
@@ -397,6 +412,7 @@ library MarketMathStatic {
|
|
|
397
412
|
priceImpact = calcPriceImpact(market, exactYtOut.neg());
|
|
398
413
|
}
|
|
399
414
|
|
|
415
|
+
/// @dev netYtOut is the parameter to approx
|
|
400
416
|
function swapExactScyForYtStatic(
|
|
401
417
|
address market,
|
|
402
418
|
uint256 exactScyIn,
|
|
@@ -444,6 +460,7 @@ library MarketMathStatic {
|
|
|
444
460
|
priceImpact = calcPriceImpact(market, exactYtIn.Int());
|
|
445
461
|
}
|
|
446
462
|
|
|
463
|
+
/// @dev netYtIn is the parameter to approx
|
|
447
464
|
function swapYtForExactScyStatic(
|
|
448
465
|
address market,
|
|
449
466
|
uint256 exactScyOut,
|
|
@@ -488,6 +505,7 @@ library MarketMathStatic {
|
|
|
488
505
|
netBaseTokenOut = SCY.previewRedeem(baseToken, netScyOut);
|
|
489
506
|
}
|
|
490
507
|
|
|
508
|
+
/// @dev netYtOut is the parameter to approx
|
|
491
509
|
function swapExactBaseTokenForYtStatic(
|
|
492
510
|
address market,
|
|
493
511
|
address baseToken,
|
|
@@ -496,7 +514,7 @@ library MarketMathStatic {
|
|
|
496
514
|
)
|
|
497
515
|
external
|
|
498
516
|
returns (
|
|
499
|
-
uint256
|
|
517
|
+
uint256 netYtOut,
|
|
500
518
|
uint256 netScyFee,
|
|
501
519
|
uint256 priceImpact
|
|
502
520
|
)
|
|
@@ -47,14 +47,6 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
47
47
|
|
|
48
48
|
IPYieldContractFactory internal immutable yieldContractFactory;
|
|
49
49
|
IPMarketFactory internal immutable marketFactory;
|
|
50
|
-
ApproxParams internal approxParams =
|
|
51
|
-
ApproxParams({
|
|
52
|
-
guessMin: 0,
|
|
53
|
-
guessMax: type(uint256).max,
|
|
54
|
-
guessOffchain: 0,
|
|
55
|
-
maxIteration: 256,
|
|
56
|
-
eps: 1e15
|
|
57
|
-
});
|
|
58
50
|
|
|
59
51
|
constructor(IPYieldContractFactory _yieldContractFactory, IPMarketFactory _marketFactory)
|
|
60
52
|
initializer
|
|
@@ -67,6 +59,17 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
67
59
|
__Ownable_init();
|
|
68
60
|
}
|
|
69
61
|
|
|
62
|
+
function getDefaultApproxParams() public pure returns (ApproxParams memory) {
|
|
63
|
+
return
|
|
64
|
+
ApproxParams({
|
|
65
|
+
guessMin: 0,
|
|
66
|
+
guessMax: type(uint256).max,
|
|
67
|
+
guessOffchain: 0,
|
|
68
|
+
maxIteration: 256,
|
|
69
|
+
eps: 1e15
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
70
73
|
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
|
71
74
|
|
|
72
75
|
// ============= SYSTEM INFO =============
|
|
@@ -287,22 +290,30 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
287
290
|
external
|
|
288
291
|
returns (
|
|
289
292
|
uint256 netLpOut,
|
|
293
|
+
uint256 netPtToSwap,
|
|
290
294
|
uint256 netScyFee,
|
|
291
295
|
uint256 priceImpact
|
|
292
296
|
)
|
|
293
297
|
{
|
|
294
|
-
return
|
|
298
|
+
return
|
|
299
|
+
MarketMathStatic.addLiquiditySinglePtStatic(market, netPtIn, getDefaultApproxParams());
|
|
295
300
|
}
|
|
296
301
|
|
|
297
302
|
function addLiquiditySingleScyStatic(address market, uint256 netScyIn)
|
|
298
303
|
public
|
|
299
304
|
returns (
|
|
300
305
|
uint256 netLpOut,
|
|
306
|
+
uint256 netPtFromSwap,
|
|
301
307
|
uint256 netScyFee,
|
|
302
308
|
uint256 priceImpact
|
|
303
309
|
)
|
|
304
310
|
{
|
|
305
|
-
return
|
|
311
|
+
return
|
|
312
|
+
MarketMathStatic.addLiquiditySingleScyStatic(
|
|
313
|
+
market,
|
|
314
|
+
netScyIn,
|
|
315
|
+
getDefaultApproxParams()
|
|
316
|
+
);
|
|
306
317
|
}
|
|
307
318
|
|
|
308
319
|
function addLiquiditySingleBaseTokenStatic(
|
|
@@ -313,6 +324,7 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
313
324
|
external
|
|
314
325
|
returns (
|
|
315
326
|
uint256 netLpOut,
|
|
327
|
+
uint256 netPtFromSwap,
|
|
316
328
|
uint256 netScyFee,
|
|
317
329
|
uint256 priceImpact
|
|
318
330
|
)
|
|
@@ -322,7 +334,7 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
322
334
|
market,
|
|
323
335
|
baseToken,
|
|
324
336
|
netBaseTokenIn,
|
|
325
|
-
|
|
337
|
+
getDefaultApproxParams()
|
|
326
338
|
);
|
|
327
339
|
}
|
|
328
340
|
|
|
@@ -346,11 +358,17 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
346
358
|
external
|
|
347
359
|
returns (
|
|
348
360
|
uint256 netPtOut,
|
|
361
|
+
uint256 netPtFromSwap,
|
|
349
362
|
uint256 netScyFee,
|
|
350
363
|
uint256 priceImpact
|
|
351
364
|
)
|
|
352
365
|
{
|
|
353
|
-
return
|
|
366
|
+
return
|
|
367
|
+
MarketMathStatic.removeLiquiditySinglePtStatic(
|
|
368
|
+
market,
|
|
369
|
+
lpToRemove,
|
|
370
|
+
getDefaultApproxParams()
|
|
371
|
+
);
|
|
354
372
|
}
|
|
355
373
|
|
|
356
374
|
function removeLiquiditySingleScyStatic(address market, uint256 lpToRemove)
|
|
@@ -410,7 +428,8 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
410
428
|
uint256 priceImpact
|
|
411
429
|
)
|
|
412
430
|
{
|
|
413
|
-
return
|
|
431
|
+
return
|
|
432
|
+
MarketMathStatic.swapExactScyForPtStatic(market, exactScyIn, getDefaultApproxParams());
|
|
414
433
|
}
|
|
415
434
|
|
|
416
435
|
function swapPtForExactScyStatic(address market, uint256 exactScyOut)
|
|
@@ -421,7 +440,12 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
421
440
|
uint256 priceImpact
|
|
422
441
|
)
|
|
423
442
|
{
|
|
424
|
-
return
|
|
443
|
+
return
|
|
444
|
+
MarketMathStatic.swapPtForExactScyStatic(
|
|
445
|
+
market,
|
|
446
|
+
exactScyOut,
|
|
447
|
+
getDefaultApproxParams()
|
|
448
|
+
);
|
|
425
449
|
}
|
|
426
450
|
|
|
427
451
|
function swapExactBaseTokenForPtStatic(
|
|
@@ -441,7 +465,7 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
441
465
|
market,
|
|
442
466
|
baseToken,
|
|
443
467
|
amountBaseToken,
|
|
444
|
-
|
|
468
|
+
getDefaultApproxParams()
|
|
445
469
|
);
|
|
446
470
|
}
|
|
447
471
|
|
|
@@ -479,7 +503,8 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
479
503
|
uint256 priceImpact
|
|
480
504
|
)
|
|
481
505
|
{
|
|
482
|
-
return
|
|
506
|
+
return
|
|
507
|
+
MarketMathStatic.swapExactScyForYtStatic(market, exactScyIn, getDefaultApproxParams());
|
|
483
508
|
}
|
|
484
509
|
|
|
485
510
|
function swapExactYtForScyStatic(address market, uint256 exactYtIn)
|
|
@@ -501,7 +526,12 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
501
526
|
uint256 priceImpact
|
|
502
527
|
)
|
|
503
528
|
{
|
|
504
|
-
return
|
|
529
|
+
return
|
|
530
|
+
MarketMathStatic.swapYtForExactScyStatic(
|
|
531
|
+
market,
|
|
532
|
+
exactScyOut,
|
|
533
|
+
getDefaultApproxParams()
|
|
534
|
+
);
|
|
505
535
|
}
|
|
506
536
|
|
|
507
537
|
function swapExactYtForBaseTokenStatic(
|
|
@@ -536,7 +566,7 @@ contract RouterStatic is OwnableUpgradeable, UUPSUpgradeable {
|
|
|
536
566
|
market,
|
|
537
567
|
baseToken,
|
|
538
568
|
amountBaseToken,
|
|
539
|
-
|
|
569
|
+
getDefaultApproxParams()
|
|
540
570
|
);
|
|
541
571
|
}
|
|
542
572
|
|
package/package.json
CHANGED
|
@@ -170,8 +170,8 @@ export type SwapYtAndTokenEvent = TypedEvent<
|
|
|
170
170
|
{
|
|
171
171
|
caller: string;
|
|
172
172
|
market: string;
|
|
173
|
-
token: string;
|
|
174
173
|
receiver: string;
|
|
174
|
+
token: string;
|
|
175
175
|
netYtToAccount: BigNumber;
|
|
176
176
|
netTokenToAccount: BigNumber;
|
|
177
177
|
}
|
|
@@ -388,16 +388,16 @@ export interface ActionSwapYT extends BaseContract {
|
|
|
388
388
|
"SwapYtAndToken(address,address,address,address,int256,int256)"(
|
|
389
389
|
caller?: string | null,
|
|
390
390
|
market?: string | null,
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
receiver?: string | null,
|
|
392
|
+
token?: null,
|
|
393
393
|
netYtToAccount?: null,
|
|
394
394
|
netTokenToAccount?: null
|
|
395
395
|
): SwapYtAndTokenEventFilter;
|
|
396
396
|
SwapYtAndToken(
|
|
397
397
|
caller?: string | null,
|
|
398
398
|
market?: string | null,
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
receiver?: string | null,
|
|
400
|
+
token?: null,
|
|
401
401
|
netYtToAccount?: null,
|
|
402
402
|
netTokenToAccount?: null
|
|
403
403
|
): SwapYtAndTokenEventFilter;
|
|
@@ -161,8 +161,8 @@ export type SwapYtAndTokenEvent = TypedEvent<
|
|
|
161
161
|
{
|
|
162
162
|
caller: string;
|
|
163
163
|
market: string;
|
|
164
|
-
token: string;
|
|
165
164
|
receiver: string;
|
|
165
|
+
token: string;
|
|
166
166
|
netYtToAccount: BigNumber;
|
|
167
167
|
netTokenToAccount: BigNumber;
|
|
168
168
|
}
|
|
@@ -373,16 +373,16 @@ export interface IPActionSwapYT extends BaseContract {
|
|
|
373
373
|
"SwapYtAndToken(address,address,address,address,int256,int256)"(
|
|
374
374
|
caller?: string | null,
|
|
375
375
|
market?: string | null,
|
|
376
|
-
|
|
377
|
-
|
|
376
|
+
receiver?: string | null,
|
|
377
|
+
token?: null,
|
|
378
378
|
netYtToAccount?: null,
|
|
379
379
|
netTokenToAccount?: null
|
|
380
380
|
): SwapYtAndTokenEventFilter;
|
|
381
381
|
SwapYtAndToken(
|
|
382
382
|
caller?: string | null,
|
|
383
383
|
market?: string | null,
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
receiver?: string | null,
|
|
385
|
+
token?: null,
|
|
386
386
|
netYtToAccount?: null,
|
|
387
387
|
netTokenToAccount?: null
|
|
388
388
|
): SwapYtAndTokenEventFilter;
|
|
@@ -673,8 +673,8 @@ export type SwapYtAndTokenEvent = TypedEvent<
|
|
|
673
673
|
{
|
|
674
674
|
caller: string;
|
|
675
675
|
market: string;
|
|
676
|
-
token: string;
|
|
677
676
|
receiver: string;
|
|
677
|
+
token: string;
|
|
678
678
|
netYtToAccount: BigNumber;
|
|
679
679
|
netTokenToAccount: BigNumber;
|
|
680
680
|
}
|
|
@@ -1813,16 +1813,16 @@ export interface IPAllAction extends BaseContract {
|
|
|
1813
1813
|
"SwapYtAndToken(address,address,address,address,int256,int256)"(
|
|
1814
1814
|
caller?: string | null,
|
|
1815
1815
|
market?: string | null,
|
|
1816
|
-
|
|
1817
|
-
|
|
1816
|
+
receiver?: string | null,
|
|
1817
|
+
token?: null,
|
|
1818
1818
|
netYtToAccount?: null,
|
|
1819
1819
|
netTokenToAccount?: null
|
|
1820
1820
|
): SwapYtAndTokenEventFilter;
|
|
1821
1821
|
SwapYtAndToken(
|
|
1822
1822
|
caller?: string | null,
|
|
1823
1823
|
market?: string | null,
|
|
1824
|
-
|
|
1825
|
-
|
|
1824
|
+
receiver?: string | null,
|
|
1825
|
+
token?: null,
|
|
1826
1826
|
netYtToAccount?: null,
|
|
1827
1827
|
netTokenToAccount?: null
|
|
1828
1828
|
): SwapYtAndTokenEventFilter;
|
|
@@ -23,6 +23,28 @@ import type {
|
|
|
23
23
|
OnEvent,
|
|
24
24
|
} from "./common";
|
|
25
25
|
|
|
26
|
+
export type ApproxParamsStruct = {
|
|
27
|
+
guessMin: BigNumberish;
|
|
28
|
+
guessMax: BigNumberish;
|
|
29
|
+
guessOffchain: BigNumberish;
|
|
30
|
+
maxIteration: BigNumberish;
|
|
31
|
+
eps: BigNumberish;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type ApproxParamsStructOutput = [
|
|
35
|
+
BigNumber,
|
|
36
|
+
BigNumber,
|
|
37
|
+
BigNumber,
|
|
38
|
+
BigNumber,
|
|
39
|
+
BigNumber
|
|
40
|
+
] & {
|
|
41
|
+
guessMin: BigNumber;
|
|
42
|
+
guessMax: BigNumber;
|
|
43
|
+
guessOffchain: BigNumber;
|
|
44
|
+
maxIteration: BigNumber;
|
|
45
|
+
eps: BigNumber;
|
|
46
|
+
};
|
|
47
|
+
|
|
26
48
|
export type MarketStateStruct = {
|
|
27
49
|
totalPt: BigNumberish;
|
|
28
50
|
totalScy: BigNumberish;
|
|
@@ -141,6 +163,7 @@ export interface RouterStaticInterface extends utils.Interface {
|
|
|
141
163
|
"addLiquiditySinglePtStatic(address,uint256)": FunctionFragment;
|
|
142
164
|
"addLiquiditySingleScyStatic(address,uint256)": FunctionFragment;
|
|
143
165
|
"calcPriceImpact(address,int256)": FunctionFragment;
|
|
166
|
+
"getDefaultApproxParams()": FunctionFragment;
|
|
144
167
|
"getExchangeRate(address)": FunctionFragment;
|
|
145
168
|
"getMarketInfo(address)": FunctionFragment;
|
|
146
169
|
"getPY(address)": FunctionFragment;
|
|
@@ -210,6 +233,10 @@ export interface RouterStaticInterface extends utils.Interface {
|
|
|
210
233
|
functionFragment: "calcPriceImpact",
|
|
211
234
|
values: [string, BigNumberish]
|
|
212
235
|
): string;
|
|
236
|
+
encodeFunctionData(
|
|
237
|
+
functionFragment: "getDefaultApproxParams",
|
|
238
|
+
values?: undefined
|
|
239
|
+
): string;
|
|
213
240
|
encodeFunctionData(
|
|
214
241
|
functionFragment: "getExchangeRate",
|
|
215
242
|
values: [string]
|
|
@@ -392,6 +419,10 @@ export interface RouterStaticInterface extends utils.Interface {
|
|
|
392
419
|
functionFragment: "calcPriceImpact",
|
|
393
420
|
data: BytesLike
|
|
394
421
|
): Result;
|
|
422
|
+
decodeFunctionResult(
|
|
423
|
+
functionFragment: "getDefaultApproxParams",
|
|
424
|
+
data: BytesLike
|
|
425
|
+
): Result;
|
|
395
426
|
decodeFunctionResult(
|
|
396
427
|
functionFragment: "getExchangeRate",
|
|
397
428
|
data: BytesLike
|
|
@@ -651,6 +682,10 @@ export interface RouterStatic extends BaseContract {
|
|
|
651
682
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
652
683
|
): Promise<ContractTransaction>;
|
|
653
684
|
|
|
685
|
+
getDefaultApproxParams(
|
|
686
|
+
overrides?: CallOverrides
|
|
687
|
+
): Promise<[ApproxParamsStructOutput]>;
|
|
688
|
+
|
|
654
689
|
getExchangeRate(
|
|
655
690
|
market: string,
|
|
656
691
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
@@ -969,6 +1004,10 @@ export interface RouterStatic extends BaseContract {
|
|
|
969
1004
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
970
1005
|
): Promise<ContractTransaction>;
|
|
971
1006
|
|
|
1007
|
+
getDefaultApproxParams(
|
|
1008
|
+
overrides?: CallOverrides
|
|
1009
|
+
): Promise<ApproxParamsStructOutput>;
|
|
1010
|
+
|
|
972
1011
|
getExchangeRate(
|
|
973
1012
|
market: string,
|
|
974
1013
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
@@ -1264,8 +1303,9 @@ export interface RouterStatic extends BaseContract {
|
|
|
1264
1303
|
netBaseTokenIn: BigNumberish,
|
|
1265
1304
|
overrides?: CallOverrides
|
|
1266
1305
|
): Promise<
|
|
1267
|
-
[BigNumber, BigNumber, BigNumber] & {
|
|
1306
|
+
[BigNumber, BigNumber, BigNumber, BigNumber] & {
|
|
1268
1307
|
netLpOut: BigNumber;
|
|
1308
|
+
netPtFromSwap: BigNumber;
|
|
1269
1309
|
netScyFee: BigNumber;
|
|
1270
1310
|
priceImpact: BigNumber;
|
|
1271
1311
|
}
|
|
@@ -1276,8 +1316,9 @@ export interface RouterStatic extends BaseContract {
|
|
|
1276
1316
|
netPtIn: BigNumberish,
|
|
1277
1317
|
overrides?: CallOverrides
|
|
1278
1318
|
): Promise<
|
|
1279
|
-
[BigNumber, BigNumber, BigNumber] & {
|
|
1319
|
+
[BigNumber, BigNumber, BigNumber, BigNumber] & {
|
|
1280
1320
|
netLpOut: BigNumber;
|
|
1321
|
+
netPtToSwap: BigNumber;
|
|
1281
1322
|
netScyFee: BigNumber;
|
|
1282
1323
|
priceImpact: BigNumber;
|
|
1283
1324
|
}
|
|
@@ -1288,8 +1329,9 @@ export interface RouterStatic extends BaseContract {
|
|
|
1288
1329
|
netScyIn: BigNumberish,
|
|
1289
1330
|
overrides?: CallOverrides
|
|
1290
1331
|
): Promise<
|
|
1291
|
-
[BigNumber, BigNumber, BigNumber] & {
|
|
1332
|
+
[BigNumber, BigNumber, BigNumber, BigNumber] & {
|
|
1292
1333
|
netLpOut: BigNumber;
|
|
1334
|
+
netPtFromSwap: BigNumber;
|
|
1293
1335
|
netScyFee: BigNumber;
|
|
1294
1336
|
priceImpact: BigNumber;
|
|
1295
1337
|
}
|
|
@@ -1301,6 +1343,10 @@ export interface RouterStatic extends BaseContract {
|
|
|
1301
1343
|
overrides?: CallOverrides
|
|
1302
1344
|
): Promise<BigNumber>;
|
|
1303
1345
|
|
|
1346
|
+
getDefaultApproxParams(
|
|
1347
|
+
overrides?: CallOverrides
|
|
1348
|
+
): Promise<ApproxParamsStructOutput>;
|
|
1349
|
+
|
|
1304
1350
|
getExchangeRate(
|
|
1305
1351
|
market: string,
|
|
1306
1352
|
overrides?: CallOverrides
|
|
@@ -1474,8 +1520,9 @@ export interface RouterStatic extends BaseContract {
|
|
|
1474
1520
|
lpToRemove: BigNumberish,
|
|
1475
1521
|
overrides?: CallOverrides
|
|
1476
1522
|
): Promise<
|
|
1477
|
-
[BigNumber, BigNumber, BigNumber] & {
|
|
1523
|
+
[BigNumber, BigNumber, BigNumber, BigNumber] & {
|
|
1478
1524
|
netPtOut: BigNumber;
|
|
1525
|
+
netPtFromSwap: BigNumber;
|
|
1479
1526
|
netScyFee: BigNumber;
|
|
1480
1527
|
priceImpact: BigNumber;
|
|
1481
1528
|
}
|
|
@@ -1729,6 +1776,8 @@ export interface RouterStatic extends BaseContract {
|
|
|
1729
1776
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
1730
1777
|
): Promise<BigNumber>;
|
|
1731
1778
|
|
|
1779
|
+
getDefaultApproxParams(overrides?: CallOverrides): Promise<BigNumber>;
|
|
1780
|
+
|
|
1732
1781
|
getExchangeRate(
|
|
1733
1782
|
market: string,
|
|
1734
1783
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
@@ -2012,6 +2061,10 @@ export interface RouterStatic extends BaseContract {
|
|
|
2012
2061
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
2013
2062
|
): Promise<PopulatedTransaction>;
|
|
2014
2063
|
|
|
2064
|
+
getDefaultApproxParams(
|
|
2065
|
+
overrides?: CallOverrides
|
|
2066
|
+
): Promise<PopulatedTransaction>;
|
|
2067
|
+
|
|
2015
2068
|
getExchangeRate(
|
|
2016
2069
|
market: string,
|
|
2017
2070
|
overrides?: Overrides & { from?: string | Promise<string> }
|