Skip to content

Commit 1e7ff0a

Browse files
committed
change limit names to min max
1 parent d9f74f6 commit 1e7ff0a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

contracts/BMath.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ contract BMath is BBronze, BConst, BNum
290290
// _calc_SingleOutGivenPoolIn //
291291
// tAo = tokenAmountOut / / \\ //
292292
// bO = tokenBalanceOut / // pS - (pAi * (1 - eF)) \ / 1 \ \\ //
293-
// pAi = poolAmountIn | bO - || ----------------------- | ^ | --------- | * b0 || //
293+
// pAi = poolAmountIn | bO - || ----------------------- | ^ | --------- | * b0 || //
294294
// ps = poolSupply \ \\ pS / \(wO / tW)/ // //
295-
// wI = tokenWeightIn tAo = \ \ // //
295+
// wI = tokenWeightIn tAo = \ \ // //
296296
// tW = totalWeight / / wO \ \ //
297-
// sF = swapFee * | 1 - | 1 - ---- | * sF | //
297+
// sF = swapFee * | 1 - | 1 - ---- | * sF | //
298298
// eF = exitFee \ \ tW / / //
299299
**********************************************************************************************/
300300
function _calc_SingleOutGivenPoolIn(
@@ -330,12 +330,12 @@ contract BMath is BBronze, BConst, BNum
330330

331331
/**********************************************************************************************
332332
// _calc_PoolInGivenSingleOut //
333-
// pAi = poolAmountIn // / tAo \\ / wO \ \ // \\ //
333+
// pAi = poolAmountIn // / tAo \\ / wO \ \ //
334334
// bO = tokenBalanceOut // | bO - -------------------------- |\ | ---- | \ //
335335
// tAo = tokenAmountOut pS - || \ 1 - ((1 - (tO / tW)) * sF)/ | ^ \ tW / * pS | //
336336
// ps = poolSupply \\ -----------------------------------/ / //
337337
// wO = tokenWeightOut pAi = \\ bO / / //
338-
// tW = totalWeight ------------------------------------------------------------- //
338+
// tW = totalWeight ------------------------------------------------------------- //
339339
// sF = swapFee ( 1 - eF ) //
340340
// eF = exitFee //
341341
**********************************************************************************************/

contracts/BPool.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ contract BPool is BBronze, BToken, BMath
482482
}
483483

484484

485-
function swap_ExactMarginalPrice(address tokenIn, uint limitAmountIn, address tokenOut, uint limitAmountOut, uint marginalPrice)
485+
function swap_ExactMarginalPrice(address tokenIn, uint maxAmountIn, address tokenOut, uint minAmountOut, uint marginalPrice)
486486
external
487487
_logs_
488488
_lock_
@@ -503,8 +503,8 @@ contract BPool is BBronze, BToken, BMath
503503
tokenAmountIn = _calc_InGivenPrice( I.balance, I.denorm, O.balance, O.denorm, _totalWeight, marginalPrice, _swapFee );
504504
tokenAmountOut = _calc_OutGivenIn( I.balance, I.denorm, O.balance, O.denorm, tokenAmountIn, _swapFee );
505505

506-
require( tokenAmountIn <= limitAmountIn, ERR_LIMIT_IN);
507-
require( tokenAmountOut >= limitAmountOut, ERR_LIMIT_OUT);
506+
require( tokenAmountIn <= maxAmountIn, ERR_LIMIT_IN);
507+
require( tokenAmountOut >= minAmountOut, ERR_LIMIT_OUT);
508508

509509
I.balance = badd(I.balance, tokenAmountIn);
510510
O.balance = bsub(O.balance, tokenAmountOut);

0 commit comments

Comments
 (0)