Skip to content

Commit

Permalink
adding caviarnine products tvl (DefiLlama#8032)
Browse files Browse the repository at this point in the history
* Revert "adding CVR (DefiLlama#7784)"

This reverts commit 7ecd727.

* add caviarnine projects

* update the url for the aggregator

* remove the aggregator from tvl
  • Loading branch information
balda-rdx authored Nov 13, 2023
1 parent 861fcd1 commit f26ae47
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions projects/caviarnine-lsu/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { get } = require('../helper/http')

async function tvl(_, _b, _cb, { api, }) {
const { composition } = await get('https://api-core.caviarnine.com/v1.0/lsupool/get_details')
const { summary } = await get('https://api-core.caviarnine.com/v1.0/stats/product/lsupool')
return {
'radix': composition.reduce((acc, i) => acc + i.amount_in_lsu/1e18 * +i.price_lsu_to_xrd, 0)
'radix': summary.total_value_locked.xrd
}
}

Expand Down
13 changes: 13 additions & 0 deletions projects/caviarnine-orderbook/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { get } = require('../helper/http')

async function tvl(_, _b, _cb, { api, }) {
const { summary } = await get('https://api-core.caviarnine.com/v1.0/stats/product/orderbook')
return {
'radix': summary.total_value_locked.xrd
}
}

module.exports = {
timetravel: false,
radixdlt: { tvl }
}
13 changes: 13 additions & 0 deletions projects/caviarnine-shapeliquidity/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { get } = require('../helper/http')

async function tvl(_, _b, _cb, { api, }) {
const { summary } = await get('https://api-core.caviarnine.com/v1.0/stats/product/shapeliquidity')
return {
'radix': summary.total_value_locked.xrd
}
}

module.exports = {
timetravel: false,
radixdlt: { tvl }
}
2 changes: 1 addition & 1 deletion projects/helper/chain/radixdlt.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ module.exports = {
queryAddresses,
sumTokens,
sumTokensExport,
}
}

0 comments on commit f26ae47

Please sign in to comment.