mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Restore highest liquidity tab (#1077)
* get highest liquidity pools WIP * logs deleted * order fix * query fix Co-authored-by: ClaudiaHolhos <claudia@oceanprotocol.com>
This commit is contained in:
parent
e2c468c128
commit
aec34dc712
@ -71,6 +71,7 @@ const HighestLiquidityAssets = gql`
|
|||||||
symbol
|
symbol
|
||||||
}
|
}
|
||||||
baseTokenLiquidity
|
baseTokenLiquidity
|
||||||
|
datatokenLiquidity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
@ -294,6 +295,7 @@ export async function getHighestLiquidityDatatokens(
|
|||||||
highestLiquidityAssets.sort(
|
highestLiquidityAssets.sort(
|
||||||
(a, b) => b.baseTokenLiquidity - a.baseTokenLiquidity
|
(a, b) => b.baseTokenLiquidity - a.baseTokenLiquidity
|
||||||
)
|
)
|
||||||
|
|
||||||
for (let i = 0; i < highestLiquidityAssets.length; i++) {
|
for (let i = 0; i < highestLiquidityAssets.length; i++) {
|
||||||
if (!highestLiquidityAssets[i]?.datatoken?.address) continue
|
if (!highestLiquidityAssets[i]?.datatoken?.address) continue
|
||||||
dtList.push(highestLiquidityAssets[i].datatoken.address)
|
dtList.push(highestLiquidityAssets[i].datatoken.address)
|
||||||
|
@ -24,10 +24,9 @@ async function getQueryHighest(
|
|||||||
esPaginationOptions: {
|
esPaginationOptions: {
|
||||||
size: dtList.length > 0 ? dtList.length : 1
|
size: dtList.length > 0 ? dtList.length : 1
|
||||||
},
|
},
|
||||||
filters: [getFilterTerm('dataToken', dtList)]
|
filters: [getFilterTerm('services.datatokenAddress', dtList)]
|
||||||
} as BaseQueryParams
|
} as BaseQueryParams
|
||||||
const queryHighest = generateBaseQuery(baseQueryParams)
|
const queryHighest = generateBaseQuery(baseQueryParams)
|
||||||
|
|
||||||
return [queryHighest, dtList]
|
return [queryHighest, dtList]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ async function getPoolSharesLiquidity(
|
|||||||
poolShares: PoolShare[]
|
poolShares: PoolShare[]
|
||||||
): Promise<number> {
|
): Promise<number> {
|
||||||
let totalLiquidity = 0
|
let totalLiquidity = 0
|
||||||
|
|
||||||
for (const poolShare of poolShares) {
|
for (const poolShare of poolShares) {
|
||||||
const poolLiquidity = calculateUserLiquidity(poolShare)
|
const poolLiquidity = calculateUserLiquidity(poolShare)
|
||||||
totalLiquidity += poolLiquidity
|
totalLiquidity += poolLiquidity
|
||||||
|
Loading…
Reference in New Issue
Block a user