-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0879297
commit 94842ad
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
const convergenceRfqSolEndpoint = 'https://mainnet.indexer.convergence.so/rfqs/trading-matrix' | ||
|
||
const dataFetcher = async () =>{ | ||
const response = await fetch(convergenceRfqSolEndpoint,{ | ||
method: 'GET', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'apikey': 'indexer-key.855ed0656f1c31bb1dda57aa7bdc4353' | ||
}, | ||
}) | ||
const jsonData = await response.json() | ||
console.log('json',jsonData) | ||
return jsonData | ||
} | ||
|
||
const tvl = async () =>{ | ||
const data = await dataFetcher(); | ||
const tvlData = data.tradingVolume.spot.overall + data.tradingVolume.options.overall + data.tradingVolume.futures.overall | ||
return Number(tvlData) | ||
} | ||
|
||
|
||
module.exports = { | ||
methodology: "Calculate TVL of convergence", | ||
solana: { | ||
tvl, | ||
}, | ||
}; |