mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix price value (#544)
* fix price value Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * proper price Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
parent
e21780530a
commit
e4803fda9e
@ -44,6 +44,7 @@ const poolLiquidityQuery = gql`
|
||||
id
|
||||
totalShares
|
||||
swapFee
|
||||
spotPrice
|
||||
tokens {
|
||||
tokenAddress
|
||||
balance
|
||||
@ -141,7 +142,8 @@ export default function Pool(): ReactElement {
|
||||
setCreatorLiquidity(creatorLiquidity)
|
||||
|
||||
const totalCreatorLiquidityInOcean =
|
||||
creatorLiquidity?.ocean + creatorLiquidity?.datatoken * price?.value
|
||||
creatorLiquidity?.ocean +
|
||||
creatorLiquidity?.datatoken * dataLiquidity.pool.spotPrice
|
||||
setCreatorTotalLiquidityInOcean(totalCreatorLiquidityInOcean)
|
||||
const creatorPoolShare =
|
||||
price?.ocean &&
|
||||
|
@ -36,6 +36,7 @@ const poolQuery = gql`
|
||||
query PoolPrice($datatoken: String) {
|
||||
pools(where: { datatokenAddress: $datatoken }) {
|
||||
spotPrice
|
||||
consumePrice
|
||||
datatokenReserve
|
||||
oceanReserve
|
||||
}
|
||||
@ -123,9 +124,13 @@ function AssetProvider({
|
||||
return
|
||||
setPrice((prevState) => ({
|
||||
...prevState,
|
||||
value: poolPrice.pools[0].spotPrice,
|
||||
value:
|
||||
poolPrice.pools[0].consumePrice === '-1'
|
||||
? poolPrice.pools[0].spotPrice
|
||||
: poolPrice.pools[0].consumePrice,
|
||||
ocean: poolPrice.pools[0].oceanReserve,
|
||||
datatoken: poolPrice.pools[0].datatokenReserve
|
||||
datatoken: poolPrice.pools[0].datatokenReserve,
|
||||
isConsumable: poolPrice.pools[0].consumePrice === '-1' ? 'false' : 'true'
|
||||
}))
|
||||
}, [poolPrice])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user