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
|
||||
}
|
||||
baseTokenLiquidity
|
||||
datatokenLiquidity
|
||||
}
|
||||
}
|
||||
`
|
||||
@ -294,6 +295,7 @@ export async function getHighestLiquidityDatatokens(
|
||||
highestLiquidityAssets.sort(
|
||||
(a, b) => b.baseTokenLiquidity - a.baseTokenLiquidity
|
||||
)
|
||||
|
||||
for (let i = 0; i < highestLiquidityAssets.length; i++) {
|
||||
if (!highestLiquidityAssets[i]?.datatoken?.address) continue
|
||||
dtList.push(highestLiquidityAssets[i].datatoken.address)
|
||||
|
@ -24,10 +24,9 @@ async function getQueryHighest(
|
||||
esPaginationOptions: {
|
||||
size: dtList.length > 0 ? dtList.length : 1
|
||||
},
|
||||
filters: [getFilterTerm('dataToken', dtList)]
|
||||
filters: [getFilterTerm('services.datatokenAddress', dtList)]
|
||||
} as BaseQueryParams
|
||||
const queryHighest = generateBaseQuery(baseQueryParams)
|
||||
|
||||
return [queryHighest, dtList]
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ async function getPoolSharesLiquidity(
|
||||
poolShares: PoolShare[]
|
||||
): Promise<number> {
|
||||
let totalLiquidity = 0
|
||||
|
||||
for (const poolShare of poolShares) {
|
||||
const poolLiquidity = calculateUserLiquidity(poolShare)
|
||||
totalLiquidity += poolLiquidity
|
||||
|
Loading…
Reference in New Issue
Block a user