Skip to content

Commit 84c3147

Browse files
authored
Adding settleton yield aggregator (DefiLlama#11475)
1 parent f7230e2 commit 84c3147

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

projects/settleton/index.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const ADDRESSES = require("../helper/coreAssets.json");
2+
const { fetchURL } = require('../helper/utils');
3+
4+
async function fetchTvl(api) {
5+
const response = await fetchURL("https://settleton.finance/apiV2/vaults")
6+
for (const pool of response.data) {
7+
api.add(ADDRESSES.ton.TON, pool.tvl * 1e9)
8+
}
9+
}
10+
11+
12+
module.exports = {
13+
methodology: `
14+
The methodology for calculating the total TVL is based on analyzing liquidity pool data and LP token balances.
15+
For each Vaults we iterate through all LP tokens and calculate their price based on following onchain data: (reserve0, reserve1, total_lp_supply)
16+
For each pool, a calculation is performed to determine the equivalent amount of TON based on the current pool reserves and the share of LP tokens held.
17+
This calculation takes into account the reserve ratios and adjusts the token value to TON.
18+
For multi-indices, the TVL of all pools is summed up, while for single indices, the value of the sole pool is used. The final TVL is represented in TON, and the index price is calculated by dividing the TVL by the total supply of the index.
19+
`.trim(),
20+
timetravel: false,
21+
doublecounted: true,
22+
ton: {
23+
tvl: fetchTvl
24+
}
25+
}

0 commit comments

Comments
 (0)