From 90667040fe5b06e15449d6e1cd15b0d59a2dec5c Mon Sep 17 00:00:00 2001 From: mihaisc Date: Wed, 5 Aug 2020 15:24:07 +0300 Subject: [PATCH] getCheapestPool return proper value --- src/utils/dtUtils.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/dtUtils.ts b/src/utils/dtUtils.ts index 858c26e..bb0e300 100644 --- a/src/utils/dtUtils.ts +++ b/src/utils/dtUtils.ts @@ -10,6 +10,12 @@ export async function getCheapestPool( dataTokenAddress ) Logger.log('DT Pool found', tokenPools) + if(tokenPools===undefined || tokenPools.length===0){ + return { + poolAddress: '', + poolPrice: '0' + } + } let cheapestPoolAddress let cheapestPoolPrice = new Decimal(999999999999)