@@ -985,12 +985,12 @@ export class LlammaTemplate {
985985
986986 const _collateral = parseUnits ( collateral , this . collateralDecimals ) ;
987987 const contract = crvusd . contracts [ this . controller ] . contract ;
988- const gas = await contract . estimateGas . remove_collateral ( _collateral , isEth ( this . collateral ) , crvusd . constantOptions ) ;
988+ const gas = this . isNewMarket ? await contract . estimateGas . remove_collateral ( _collateral , crvusd . constantOptions ) : await contract . estimateGas . remove_collateral ( _collateral , isEth ( this . collateral ) , crvusd . constantOptions ) ;
989989 if ( estimateGas ) return gas . toNumber ( ) ;
990990
991991 await crvusd . updateFeeData ( ) ;
992992 const gasLimit = gas . mul ( 130 ) . div ( 100 ) ;
993- return ( await contract . remove_collateral ( _collateral , isEth ( this . collateral ) , { ...crvusd . options , gasLimit } ) ) . hash
993+ return ( this . isNewMarket ? await contract . remove_collateral ( _collateral , { ... crvusd . options , gasLimit } ) : await contract . remove_collateral ( _collateral , isEth ( this . collateral ) , { ...crvusd . options , gasLimit } ) ) . hash
994994 }
995995
996996 public async removeCollateralEstimateGas ( collateral : number | string ) : Promise < number > {
@@ -1264,12 +1264,12 @@ export class LlammaTemplate {
12641264 const minAmountBN : BigNumber = BN ( stablecoin ) . times ( 100 - slippage ) . div ( 100 ) ;
12651265 const _minAmount = fromBN ( minAmountBN ) ;
12661266 const contract = crvusd . contracts [ this . controller ] . contract ;
1267- const gas = ( await contract . estimateGas . liquidate ( address , _minAmount , isEth ( this . collateral ) , crvusd . constantOptions ) )
1267+ const gas = this . isNewMarket ? ( await contract . estimateGas . liquidate ( address , _minAmount , crvusd . constantOptions ) ) : ( await contract . estimateGas . liquidate ( address , _minAmount , isEth ( this . collateral ) , crvusd . constantOptions ) )
12681268 if ( estimateGas ) return gas . toNumber ( ) ;
12691269
12701270 await crvusd . updateFeeData ( ) ;
12711271 const gasLimit = gas . mul ( 130 ) . div ( 100 ) ;
1272- return ( await contract . liquidate ( address , _minAmount , isEth ( this . collateral ) , { ...crvusd . options , gasLimit } ) ) . hash
1272+ return ( this . isNewMarket ? await contract . liquidate ( address , _minAmount , { ... crvusd . options , gasLimit } ) : await contract . liquidate ( address , _minAmount , isEth ( this . collateral ) , { ...crvusd . options , gasLimit } ) ) . hash
12731273 }
12741274
12751275 public async liquidateEstimateGas ( address : string , slippage = 0.1 ) : Promise < number > {
0 commit comments