Skip to content

Commit

Permalink
add convergence-rfq-solana
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagaprasadvr committed Jul 26, 2024
1 parent 0879297 commit 94842ad
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions projects/convergence-rfq-solana/index.js
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,
},
};

0 comments on commit 94842ad

Please sign in to comment.