Skip to content

Commit 5b31971

Browse files
authored
Merge pull request #87 from curvefi/chore/price-impact-optional-zap-v2
chore: make priceImpact optional for zapV2
2 parents b9da628 + 1f9617c commit 5b31971

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@curvefi/llamalend-api",
3-
"version": "2.0.13",
3+
"version": "2.0.14",
44
"description": "JavaScript library for Curve Lending",
55
"main": "lib/index.js",
66
"author": "Macket",

src/interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ export interface IResponseApi {
235235

236236
export interface IQuote {
237237
outAmount: string,
238-
priceImpact: number
238+
priceImpact: number | null
239239
}
240240

241241
export interface ILeverageMetrics {
242-
priceImpact: number,
242+
priceImpact: number | null,
243243
bands: [number, number],
244244
prices: string[],
245245
health: string,

src/lendMarkets/modules/common/leverageZapV2Base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ export class LeverageZapV2BaseModule {
880880

881881
const _stateCollateral = parseUnits(stateCollateral, this.market.collateral_token.decimals);
882882
const _userCollateral = parseUnits(userCollateral, this.market.collateral_token.decimals);
883-
const priceImpact = _stateCollateral + _userCollateral > BigInt(0) ? quote.priceImpact : 0;
883+
const priceImpact = _stateCollateral + _userCollateral > BigInt(0) ? quote.priceImpact : null;
884884

885885
return {
886886
priceImpact,

0 commit comments

Comments
 (0)