Skip to content

Commit

Permalink
CentrifugeJS: Change Price decimals (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser authored Sep 7, 2023
1 parent 4605500 commit b1f0ec4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion centrifuge-app/src/utils/tinlake/useTinlakePools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ async function getPools(pools: IpfsPools): Promise<{ pools: TinlakePool[] }> {
const toCurrencyBalance = (val: BigNumber) => new CurrencyBalance(val.toString(), 18)
const toTokenBalance = (val: BigNumber) => new TokenBalance(val.toString(), 18)
const toRate = (val: BigNumber) => new Rate(val.toString())
const toPrice = (val: BigNumber) => new Price(val.toString())
const toPrice = (val: BigNumber) => new Rate(val.toString())

const calls: Call[] = []
pools.active.forEach((pool) => {
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-js/src/modules/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { CurrencyBalance, Perquintill, Price, Rate, TokenBalance } from '../util
import { Dec } from '../utils/Decimal'

const PerquintillBN = new BN(10).pow(new BN(18))
const PriceBN = new BN(10).pow(new BN(27))
const PriceBN = new BN(10).pow(new BN(18))
const MaxU128 = '340282366920938463463374607431768211455'
const SEC_PER_DAY = 24 * 60 * 60

Expand Down
2 changes: 1 addition & 1 deletion centrifuge-js/src/utils/BN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class TokenBalance extends CurrencyBalance {
}

export class Price extends BNSubType {
static decimals = 27
static decimals = 18
static fromFloat(number: Numeric) {
return Price._fromFloat<Price>(number)
}
Expand Down

0 comments on commit b1f0ec4

Please sign in to comment.