File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @reserve-protocol/dtf-rebalance-lib" ,
3- "version" : " 2.4.2 " ,
3+ "version" : " 2.4.3 " ,
44 "description" : " Rebalancing library for DTFs in typescript" ,
55 "main" : " dist/index.js" ,
66 "module" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -544,6 +544,9 @@ export const getOpenAuction = (
544544 const buyUpTo = ( newWeights [ i ] . low * newLimits . low * _supply ) / D18n / D27n ;
545545 const sellDownTo = ( newWeights [ i ] . high * newLimits . high * _supply + ( D18n * D27n - 1n ) ) / D18n / D27n ;
546546
547+ // {USD}
548+ const tradeThreshold = round == AuctionRound . EJECT ? ONE : ZERO ;
549+
547550 if ( _assets [ i ] < buyUpTo ) {
548551 // {wholeTok} = {tok} / {tok/wholeTok}
549552 const deficitAmount = new Decimal ( ( buyUpTo - _assets [ i ] ) . toString ( ) ) . div ( decimalScale [ i ] ) ;
@@ -552,7 +555,7 @@ export const getOpenAuction = (
552555 const tokenDeficitValue = deficitAmount . mul ( prices [ i ] ) ;
553556
554557 // $1 minimum
555- if ( round == AuctionRound . EJECT || tokenDeficitValue . gte ( ONE ) ) {
558+ if ( tokenDeficitValue . gt ( tradeThreshold ) ) {
556559 deficitTokens . push ( token ) ;
557560 deficitTokenSizes . push ( tokenDeficitValue . toNumber ( ) ) ;
558561 }
@@ -564,7 +567,7 @@ export const getOpenAuction = (
564567 const tokenSurplusValue = surplusAmount . mul ( prices [ i ] ) ;
565568
566569 // $1 minimum
567- if ( round == AuctionRound . EJECT || tokenSurplusValue . gte ( ONE ) ) {
570+ if ( tokenSurplusValue . gt ( tradeThreshold ) ) {
568571 surplusTokens . push ( token ) ;
569572 surplusTokenSizes . push ( tokenSurplusValue . toNumber ( ) ) ;
570573 }
You can’t perform that action at this time.
0 commit comments