Skip to content

Commit

Permalink
Merge pull request #12 from curvefi/fix/rewards-decimals
Browse files Browse the repository at this point in the history
Fix: rewards decimals (2)
  • Loading branch information
Macket authored Apr 3, 2024
2 parents 9ba8dce + 7a1c720 commit a51a98e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/lending-api",
"version": "1.6.5",
"version": "1.6.6",
"description": "JavaScript library for Curve Lending",
"main": "lib/index.js",
"author": "Macket",
Expand Down
8 changes: 4 additions & 4 deletions src/markets/OneWayMarketTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,8 @@ export class OneWayMarketTemplate {

// bands_x and bands_y always return amounts with 18 decimals
return {
borrowed: formatNumber(formatUnits(_balances[0], this.borrowed_token.decimals), this.borrowed_token.decimals),
collateral: formatNumber(formatUnits(_balances[1], this.collateral_token.decimals), this.collateral_token.decimals),
borrowed: formatNumber(formatUnits(_balances[0]), this.borrowed_token.decimals),
collateral: formatNumber(formatUnits(_balances[1]), this.collateral_token.decimals),
}
}

Expand All @@ -880,8 +880,8 @@ export class OneWayMarketTemplate {
const _i = i - minBand
// bands_x and bands_y always return amounts with 18 decimals
bands[i] = {
borrowed: formatNumber(formatUnits(_bands[2 * _i], this.borrowed_token.decimals), this.borrowed_token.decimals),
collateral: formatNumber(formatUnits(_bands[(2 * _i) + 1], this.collateral_token.decimals), this.collateral_token.decimals),
borrowed: formatNumber(formatUnits(_bands[2 * _i]), this.borrowed_token.decimals),
collateral: formatNumber(formatUnits(_bands[(2 * _i) + 1]), this.collateral_token.decimals),
}
}

Expand Down

0 comments on commit a51a98e

Please sign in to comment.