From 49019e8d69a20c6b1a46ee408d622920d247cc37 Mon Sep 17 00:00:00 2001 From: Santiago Gonzalez Date: Wed, 2 Sep 2020 01:27:27 -0500 Subject: [PATCH] Fix undefined property error in cheapestPool object --- src/utils/dtUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/dtUtils.ts b/src/utils/dtUtils.ts index 12fb126..317b730 100644 --- a/src/utils/dtUtils.ts +++ b/src/utils/dtUtils.ts @@ -73,12 +73,12 @@ export async function checkAndBuyDT( dataTokenAddress ) Decimal.set({ precision: 5 }) - const price = new Decimal(cheapestPool.poolPrice).times(1.05).toString() - const maxPrice = new Decimal(cheapestPool.poolPrice).times(2).toString() + const price = new Decimal(cheapestPool.price).times(1.05).toString() + const maxPrice = new Decimal(cheapestPool.price).times(2).toString() Logger.log('Buying token', cheapestPool, account.getId(), price) const buyResponse = await ocean.pool.buyDT( account.getId(), - cheapestPool.poolAddress, + cheapestPool.address, '1', price, maxPrice