-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DefiLlama:main' into main
- Loading branch information
Showing
10 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const { call } = require("../helper/chain/ton") | ||
const { get } = require('../helper/http') | ||
|
||
// helper function of getting jetton metadata | ||
async function getJettonMetadata(addr) { | ||
const res = await get(`https://tonapi.io/v2/jettons/${addr}`) | ||
return res | ||
} | ||
|
||
async function tvl(api) { | ||
const CLTON_MINTER_ADDRESS = 'EQDz48al4FfPnapvXYJOfkBOIj3xvNZ0t5vSpQN-Qukqwm7W' | ||
const CLTON_TOKEN_ADDRESS = 'EQCxd6SJQ8KiLkEpN3OoBfUIHqPE3yp0j80UnPysQqcTikNF' | ||
|
||
const cltonMinterResult = await call({ target: CLTON_MINTER_ADDRESS, abi: "get_minter_data", stack: [] }) | ||
// exchange rate from clTON to TON: decimal 9 | ||
|
||
const cltonToTon = cltonMinterResult[4] / 1e9 | ||
const cltonMetadata = await getJettonMetadata(CLTON_TOKEN_ADDRESS) | ||
|
||
// Now the tokens in the withdrawal vault will be correctly destroyed, so the TOTAL SUPPLY can be a true indication of tvl | ||
const cltonTotalSupply = (cltonMetadata['total_supply']) / 1e9 | ||
|
||
const cltonTvl = cltonTotalSupply * cltonToTon | ||
api.addCGToken("the-open-network", cltonTvl) | ||
} | ||
|
||
module.exports = { | ||
ton: { | ||
tvl | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const { getUniTVL } = require('../helper/unknownTokens') | ||
|
||
module.exports={ | ||
etn: { | ||
tvl: getUniTVL({ factory: '0x203D550ed6fA9dAB8A4190720CF9F65138abd15B', useDefaultCoreAssets: false }), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { uniV3Export } = require("../helper/uniswapV3"); | ||
|
||
module.exports = uniV3Export({ | ||
etn: { | ||
factory: "0xbF6Bcbe2be545135391777F3B4698be92E2EB8cA", | ||
fromBlock: 1242016, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,7 @@ | |
"ethereumclassic", | ||
"ethf", | ||
"ethpow", | ||
"etn", | ||
"europa", | ||
"everscale", | ||
"evmos", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters