Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add convergence-rfq-solana #11118

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a heads up, we cant treat trading volume as tvl, tvl = funds locked in smart contract.

to track volume/fees: https://github.com/DefiLlama/dimension-adapters

return Number(tvlData)
}


module.exports = {
methodology: "Calculate TVL of convergence",
solana: {
tvl,
},
};
Loading