mirror of
https://github.com/oceanprotocol/react.git
synced 2025-02-14 21:10:38 +01:00
fix price calculation
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
parent
378b5deae3
commit
1bc580bf9b
@ -24,8 +24,8 @@ export async function getCheapestPoolPrice(
|
|||||||
for (let i = 0; i < tokenPools.length; i++) {
|
for (let i = 0; i < tokenPools.length; i++) {
|
||||||
const poolPrice = await ocean.pool.calcInGivenOut(
|
const poolPrice = await ocean.pool.calcInGivenOut(
|
||||||
tokenPools[i],
|
tokenPools[i],
|
||||||
dataTokenAddress,
|
|
||||||
ocean.pool.oceanAddress,
|
ocean.pool.oceanAddress,
|
||||||
|
dataTokenAddress,
|
||||||
'1'
|
'1'
|
||||||
)
|
)
|
||||||
const decimalPoolPrice = new Decimal(poolPrice)
|
const decimalPoolPrice = new Decimal(poolPrice)
|
||||||
@ -186,8 +186,8 @@ export async function getFirstPoolPrice(
|
|||||||
|
|
||||||
const firstPoolPrice = await ocean.pool.calcInGivenOut(
|
const firstPoolPrice = await ocean.pool.calcInGivenOut(
|
||||||
firstPoolAddress,
|
firstPoolAddress,
|
||||||
dataTokenAddress,
|
|
||||||
ocean.pool.oceanAddress,
|
ocean.pool.oceanAddress,
|
||||||
|
dataTokenAddress,
|
||||||
'1'
|
'1'
|
||||||
)
|
)
|
||||||
const usePrice = await ocean.pool.getOceanNeeded(firstPoolAddress, '1')
|
const usePrice = await ocean.pool.getOceanNeeded(firstPoolAddress, '1')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user