Skip to content

Commit

Permalink
Revert "Revert "add ck aggregator"" (#11694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Define101 authored Sep 20, 2024
2 parents 7adc308 + 48d7f99 commit 228ffca
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 37 deletions.
27 changes: 27 additions & 0 deletions projects/chain-fusion/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { sumTokens2, } = require("../helper/unwrapLPs");
const { get } = require('../helper/http')

// This address holds all the locked ETH as well as locked ERC20 tokens
const ethereum_contract = "0xb25eA1D493B49a1DeD42aC5B1208cC618f9A9B80";

async function ethereum_tvl(api) {
return sumTokens2({ owner: ethereum_contract, api, fetchCoValentTokens: true });
}

async function bitcoin_tvl(ts) {
var end = ts.timestamp
let start = end - 24 * 60 * 60;
const { data } = await get(`https://icrc-api.internetcomputer.org/api/v1/ledgers/mxzaz-hqaaa-aaaar-qaada-cai/total-supply?start=${start}&end=${end}&step=1`);
let [_, bal] = data.pop()
return {
'coingecko:bitcoin': bal / 1e8
};
}

module.exports = {
methodology: `We count the ETH and ERC20-Tokens on ${ethereum_contract} as the collateral for ckETH and ck-ERC20 tokens and we count BTC as the collateral for ckBTC`,
ethereum: {
tvl: ethereum_tvl,
},
bitcoin: { tvl: bitcoin_tvl },
};
16 changes: 0 additions & 16 deletions projects/ckbtc/index.js

This file was deleted.

21 changes: 0 additions & 21 deletions projects/cketh/index.js

This file was deleted.

0 comments on commit 228ffca

Please sign in to comment.