fix DVM test

This commit is contained in:
mingda
2020-11-20 19:55:32 +08:00
parent 047d7f1d94
commit 8ba1a24e1a
5 changed files with 45 additions and 33 deletions

View File

@@ -88,4 +88,14 @@ contract DVMStorage is InitializableOwnable, ReentrancyGuard {
function setSell(bool open) external onlyOwner {
_SELLING_CLOSE_ = !open;
}
// ============ View Functions ============
function getLpFeeRate(address trader) external view returns (uint256 feeRate) {
return _LP_FEE_RATE_MODEL_.getFeeRate(trader);
}
function getMtFeeRate(address trader) external view returns (uint256 feeRate) {
return _MT_FEE_RATE_MODEL_.getFeeRate(trader);
}
}

View File

@@ -52,8 +52,8 @@ library DODOMath {
c=-kQ0^2
and Q2=(-b+sqrt(b^2+4(1-k)kQ0^2))/2(1-k)
note: another root is negative, abondan
if deltaBSig=true, then Q2>Q1
if deltaBSig=false, then Q2<Q1
if deltaBSig=true, then Q2>Q1, user sell Q and receive B
if deltaBSig=false, then Q2<Q1, user sell B and receive Q
return |Q1-Q2|
*/
function _SolveQuadraticFunctionForTrade(

View File

@@ -207,7 +207,7 @@ library PMMPricing {
state.B,
DecimalMath.divFloor(payQuoteAmount, state.i),
false,
state.i
state.K
);
}