From ecb9779b9b16c67fabb6771ebf5b8127fef9ff65 Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 10 Apr 2025 15:12:52 -0400 Subject: [PATCH] Added Loopscale TVL --- projects/loopscale/index.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 projects/loopscale/index.js diff --git a/projects/loopscale/index.js b/projects/loopscale/index.js new file mode 100644 index 0000000000..26618f4f04 --- /dev/null +++ b/projects/loopscale/index.js @@ -0,0 +1,30 @@ +const sdk = require('@defillama/sdk') + +const endpoint = 'https://tars.loopscale.com/v1/markets/tvl/balances' +const startTimestamp = 1733072400 // 2024-12-01, 12PM ET + +async function tvl(api) { + const request = { + method: 'GET', + headers: { + accept: 'application/json', + }, + } + + const response = await fetch(`${endpoint}?timestamp=${api.timestamp}`, request) + + const data = await response.json() + + data.map(d => { + api.add(d.mint, d.balance) + }) +} + +module.exports = { + doublecounted: false, + timetravel: true, + start: startTimestamp, + methodology: + 'TVL is calculated by summing up all unused deposits and supplied collateral', + solana: { tvl }, +}