Skip to content

Commit

Permalink
feat: added thala vethl tvl
Browse files Browse the repository at this point in the history
  • Loading branch information
LawsonGraham committed May 12, 2024
1 parent 411b60c commit 3d84257
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions projects/thala-vethl/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const utils = require("../helper/utils");
const sdk = require("@defillama/sdk");
const { transformBalances } = require("../helper/portedTokens");

const THALA_API = "https://app.thala.fi/api";
const thlAddress = "0x7fd500c11216f0fe3095d0c4b8aa4d64a4e2e04f83758462f2b127255643615::thl_coin::THL";
const thlDecimals = 8;

module.exports = {
timetravel: true,
start: 1692598825,
methodology:
`TVL data is pulled from the Thala's API "https://app.thala.fi/api/vethl-tvl".`,
aptos: {
tvl: async ({ timestamp }) => {
const response = await utils.fetchURL(`${THALA_API}/vethl-tvl?timestamp=${ timestamp }`);
const thlAmount = response.data.data * 10**thlDecimals;

const balances = {};
sdk.util.sumSingleBalance(balances, thlAddress, thlAmount);

return transformBalances("aptos", balances);
},
},
};

0 comments on commit 3d84257

Please sign in to comment.