From b9964a77857e288e9a472871d875e602697d25dd Mon Sep 17 00:00:00 2001 From: macket Date: Wed, 29 Nov 2023 22:59:20 +0400 Subject: [PATCH 1/2] chore: decrease slippage --- src/llammas/LlammaTemplate.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/llammas/LlammaTemplate.ts b/src/llammas/LlammaTemplate.ts index d9533f1..58e20cb 100644 --- a/src/llammas/LlammaTemplate.ts +++ b/src/llammas/LlammaTemplate.ts @@ -1218,12 +1218,12 @@ export class LlammaTemplate { return (await contract.exchange(i, j, _amount, _minRecvAmount, { ...crvusd.options, gasLimit })).hash } - public async swapEstimateGas(i: number, j: number, amount: number | string, slippage = 0.5): Promise { + public async swapEstimateGas(i: number, j: number, amount: number | string, slippage = 0.1): Promise { if (!(await this.swapIsApproved(i, amount))) throw Error("Approval is needed for gas estimation"); return await this._swap(i, j, amount, slippage, true) as number; } - public async swap(i: number, j: number, amount: number | string, slippage = 0.5): Promise { + public async swap(i: number, j: number, amount: number | string, slippage = 0.1): Promise { await this.swapApprove(i, amount); return await this._swap(i, j, amount, slippage, false) as string; } @@ -1270,12 +1270,12 @@ export class LlammaTemplate { return (await contract.liquidate(address, _minAmount, isEth(this.collateral), { ...crvusd.options, gasLimit })).hash } - public async liquidateEstimateGas(address: string, slippage = 0.5): Promise { + public async liquidateEstimateGas(address: string, slippage = 0.1): Promise { if (!(await this.liquidateIsApproved(address))) throw Error("Approval is needed for gas estimation"); return await this._liquidate(address, slippage, true) as number; } - public async liquidate(address: string, slippage = 0.5): Promise { + public async liquidate(address: string, slippage = 0.1): Promise { await this.liquidateApprove(address); return await this._liquidate(address, slippage, false) as string; } @@ -1294,12 +1294,12 @@ export class LlammaTemplate { return await this.liquidateApprove() } - public async selfLiquidateEstimateGas(slippage = 0.5): Promise { + public async selfLiquidateEstimateGas(slippage = 0.1): Promise { if (!(await this.selfLiquidateIsApproved())) throw Error("Approval is needed for gas estimation"); return await this._liquidate(crvusd.signerAddress, slippage, true) as number; } - public async selfLiquidate(slippage = 0.5): Promise { + public async selfLiquidate(slippage = 0.1): Promise { await this.selfLiquidateApprove(); return await this._liquidate(crvusd.signerAddress, slippage, false) as string; } @@ -1607,13 +1607,13 @@ export class LlammaTemplate { )).hash } - private async leverageCreateLoanEstimateGas(collateral: number | string, debt: number | string, range: number, slippage = 0.5): Promise { + private async leverageCreateLoanEstimateGas(collateral: number | string, debt: number | string, range: number, slippage = 0.1): Promise { this._checkLeverageZap(); if (!(await this.createLoanIsApproved(collateral))) throw Error("Approval is needed for gas estimation"); return await this._leverageCreateLoan(collateral, debt, range, slippage, true) as number; } - private async leverageCreateLoan(collateral: number | string, debt: number | string, range: number, slippage = 0.5): Promise { + private async leverageCreateLoan(collateral: number | string, debt: number | string, range: number, slippage = 0.1): Promise { this._checkLeverageZap(); await this.createLoanApprove(collateral); return await this._leverageCreateLoan(collateral, debt, range, slippage, false) as string; @@ -1767,12 +1767,12 @@ export class LlammaTemplate { return (await contract.repay_extended(this.deleverageZap, [routeIdx, _collateral, _minRecv], { ...crvusd.options, gasLimit })).hash } - private async deleverageRepayEstimateGas(collateral: number | string, slippage = 0.5): Promise { + private async deleverageRepayEstimateGas(collateral: number | string, slippage = 0.1): Promise { this._checkDeleverageZap(); return await this._deleverageRepay(collateral, slippage, true) as number; } - private async deleverageRepay(collateral: number | string, slippage = 0.5): Promise { + private async deleverageRepay(collateral: number | string, slippage = 0.1): Promise { this._checkDeleverageZap(); return await this._deleverageRepay(collateral, slippage, false) as string; } From e20cc5c1827c40fbe17270b57cef0abc359ffc06 Mon Sep 17 00:00:00 2001 From: macket Date: Wed, 29 Nov 2023 22:59:44 +0400 Subject: [PATCH 2/2] build: v1.5.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 74b23c3..e96aa03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@curvefi/stablecoin-api", - "version": "1.5.1", + "version": "1.5.2", "description": "JavaScript library for Curve Stablecoin", "main": "lib/index.js", "author": "Macket",