1
0
mirror of https://github.com/oceanprotocol/react.git synced 2024-11-25 20:01:30 +01:00

fix price calculation

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
mihaisc 2020-11-26 14:42:27 +02:00
parent 378b5deae3
commit 1bc580bf9b
No known key found for this signature in database
GPG Key ID: 4FB0C2329B4C6E29

View File

@ -24,8 +24,8 @@ export async function getCheapestPoolPrice(
for (let i = 0; i < tokenPools.length; i++) {
const poolPrice = await ocean.pool.calcInGivenOut(
tokenPools[i],
dataTokenAddress,
ocean.pool.oceanAddress,
dataTokenAddress,
'1'
)
const decimalPoolPrice = new Decimal(poolPrice)
@ -186,8 +186,8 @@ export async function getFirstPoolPrice(
const firstPoolPrice = await ocean.pool.calcInGivenOut(
firstPoolAddress,
dataTokenAddress,
ocean.pool.oceanAddress,
dataTokenAddress,
'1'
)
const usePrice = await ocean.pool.getOceanNeeded(firstPoolAddress, '1')