forked from DefiLlama/DefiLlama-Adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
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
21 changed files
with
346 additions
and
80 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,30 @@ | ||
//20230428 initial release: simple and clear | ||
const { sumTokensExport } = require('../helper/unwrapLPs'); | ||
|
||
const ownerArbitrum = '0x7a08b29A7Ad4A19A5ECa0c82F5F082872488D135'; // contract address | ||
const tokensArbitrum = [ | ||
'0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', // USDC | ||
'0x0000000000000000000000000000000000000000', // ETH | ||
'0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', // USDT | ||
'0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', // WBTC | ||
]; | ||
|
||
const ownerAvalanche = '0xd8b0D18faE7eA29F2AD95d01FFb479E0021a9A5e'; // contract address | ||
const tokensAvalanche = [ | ||
'0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', // USDC | ||
'0x0000000000000000000000000000000000000000', // AVAX | ||
'0x152b9d0FdC40C096757F570A51E494bd4b943E50', // BTC.b | ||
'0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB', // WETH.e | ||
'0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', // USDt | ||
]; | ||
|
||
module.exports = { | ||
methodology: "TVL is equal to users' deposits minus withdrawals", | ||
start: 1641625200, // Jan-08-2022 07:00:00 AM +UTC | ||
arbitrum: { | ||
tvl: sumTokensExport({ owner:ownerArbitrum, tokens:tokensArbitrum }) | ||
}, | ||
avax: { | ||
tvl: sumTokensExport({ owner:ownerAvalanche, tokens:tokensAvalanche }) | ||
}, | ||
}; |
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,10 @@ | ||
const { getUniTVL } = require('../helper/unknownTokens') | ||
|
||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
methodology: `Uses factory(0xCe9240869391928253Ed9cc9Bcb8cb98CB5B0722) address to count liquidity in pools as TVL.`, | ||
arbitrum: { | ||
tvl: getUniTVL({ factory: '0xCe9240869391928253Ed9cc9Bcb8cb98CB5B0722', useDefaultCoreAssets: true }), | ||
} | ||
}; |
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,27 @@ | ||
const { blockQuery } = require('../helper/http') | ||
const { getBlock } = require('../hydradex/getHydraV3SubgraphTvl') | ||
|
||
async function tvl(timestamp) { | ||
const endpoint = 'https://graph.hydradex.org/subgraphs/name/v3-subgraph' | ||
const block = +(await getBlock('https://graph.hydradex.org/subgraphs/name/blocklytics/ethereum-blocks', timestamp)) | ||
const query = `query ($block: Int){ | ||
factories (block: { number: $block }) { | ||
totalValueLockedUSD | ||
} | ||
}` | ||
const { factories: [{ totalValueLockedUSD }] } = await blockQuery(endpoint, query, { | ||
api: { | ||
getBlock: () => block, | ||
block | ||
} | ||
}) | ||
return { tether: totalValueLockedUSD } | ||
} | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
methodology: "We count liquidity on the dex, pulling data from subgraph", | ||
hydra: { | ||
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 |
---|---|---|
@@ -1,21 +1,27 @@ | ||
const cloudscraper = require('cloudscraper') | ||
const { blockQuery } = require('./helper/http') | ||
const { getBlock } = require('./hydradex/getHydraV3SubgraphTvl') | ||
|
||
async function fetch() { | ||
const uri = 'https://info.hydradex.org/graphql' | ||
const body = { "operationName": "Query", "variables": {}, "query": "query Query {\n hydraswapFactories(where: {id: \"5a2a927bea6c5f4a48d4e0116049c1e36d52a528\"}) {\n totalLiquidityUSD\n }\n}\n" } | ||
const reserves = ( | ||
await cloudscraper.post(uri, { | ||
json: body | ||
}) | ||
) | ||
return { tether: +reserves.data.hydraswapFactories[0].totalLiquidityUSD } | ||
async function tvl(timestamp) { | ||
const endpoint = 'https://info.hydradex.org/graphql' | ||
const block = await getBlock(endpoint, timestamp) | ||
const query = `query ($block: Float!){ | ||
hydraswapFactories (block: { number: $block }) { | ||
totalLiquidityUSD | ||
} | ||
}` | ||
const { hydraswapFactories: [{ totalLiquidityUSD }] } = await blockQuery(endpoint, query, { | ||
api: { | ||
getBlock: () => block, | ||
block | ||
} | ||
}) | ||
return { tether: totalLiquidityUSD } | ||
} | ||
|
||
module.exports = { | ||
misrepresentedTokens: true, | ||
timetravel: false, | ||
methodology: "We count liquidity on the dex, pulling data from subgraph", | ||
hydra: { | ||
tvl: fetch, | ||
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 |
---|---|---|
@@ -1,7 +1 @@ | ||
const { getExports } = require('../helper/heroku-api') | ||
|
||
module.exports = { | ||
timetravel: false, | ||
misrepresentedTokens: true, | ||
...getExports("hydradex", ['hydra']), | ||
} | ||
module.exports = require('../hydradex') |
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,22 @@ | ||
const { graphQuery, } = require("../helper/http"); | ||
|
||
const HOURS_12 = 12 * 3600 | ||
|
||
async function getBlock(endpoint, timestamp) { | ||
const params = { | ||
timestamp_from: timestamp - HOURS_12, | ||
timestamp_to: timestamp + HOURS_12, | ||
} | ||
const query = `query ($timestamp_to: Int, $timestamp_from: Int){ | ||
blocks (orderBy: "timestamp" first:1 orderDirection: "desc" where: { timestamp_lte: $timestamp_to timestamp_gte: $timestamp_from}) { | ||
timestamp | ||
number | ||
} | ||
}` | ||
const { blocks } = await graphQuery(endpoint, query, params) | ||
return blocks[0].number | ||
} | ||
|
||
module.exports = { | ||
getBlock, | ||
}; |
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,89 @@ | ||
const { cexExports } = require('../helper/cex') | ||
|
||
const config = { | ||
bitcoin: { | ||
owners: [ | ||
"17Tf4bVQaCzwWrDWGRPC97RLCHnU4LY8Qr", | ||
"1BzK87zuqidZn489Wb2oLSktrjKrX7TLKe", | ||
"1Drshi4RAuvxk4T6Bkq959ZvLbvy7b1wvD", | ||
"1EiiKCCnFgHjEvPZdu29qqgdBm8zTvpU3U", | ||
"14p4w3TRCd6NMRSnzTmgdvQhNnbrAmzXmy", | ||
"12KkeeRkiNS13GMbg7zos9KRn9ggvZtZgx", | ||
"12T4oSNd4t9ty9fodgNd47TWhK35pAxDYN", | ||
"15kNZcrhxeFZgVVLK2Yjzd69tRidbFdJEZ", | ||
"1LS5EFRRMDgMQusW6zokQUHjzNUfy6HHCQ", | ||
"1FrV9hv1AW34BGJvobJatyzUWYDWB9epRW", | ||
"1HdKXsNQtzDcfB6PGM7DWTgX9vhBWsz1ak", | ||
"1Fu4YgM3Y9CxvioGPqkSzkydAC8MVaPN1D", | ||
"1G23Uzwj55k2A9TRwaTknqGav66oDTkWCu", | ||
"1GkZQcDy8V6pmHFZqUBUBCnN9dc2hoWasD", | ||
"1Hm6XDmhKCHz68wDEYTapN9MEanke8iwUk", | ||
"15SeCwVCFx5cWyrcdD1Zp1D1zxjH2SELPg", | ||
"15U4VsmWG1cdXAtizvQsW4r7iMxzp64Tgu", | ||
"16jZZkMYqjUWUtQ9DfDvHdH5ko5BcnH9XQ", | ||
"16w6sZBDP58yyeyZAcvnxcEGJpwR9amM6g", | ||
"19Cr4zXpKw43xLJhFZW9iv4DDNtQk2TDeB", | ||
"1GyDutntMuYyA2vQGW5HFcKLfx4cbDdbJq", | ||
"17etv2L3nhk6SCcWSNW4eoZkBy84izAm17", | ||
"18ok25NTkdrUzdByFJCNVsqVYkujZ8aP45", | ||
"199Yxz2TJGtND3QKsHTptTJivqSaUZBvku", | ||
"1AZu7TQmKBAes2duNDctYwjAB9nhHczUnA", | ||
"17KcBp8g76Ue8pywgjta4q8Ds6wK4bEKp7", | ||
"1LLc8aA9C9LLULGbYCYSFKXgxKP2DXdCqP", | ||
"1CZsoJfkknbnW5fKrt1oR7N1ALE5WmDGP1", | ||
"1DedUxzgwErg4ipNi988wPgLk5thwciKcc", | ||
"1H4K3dGfNbAN4AUfyUrpkGpjrd83sntDpV", | ||
"13sXfpp2V16nnxYvW9FHHoBdMa3k98uJw8", | ||
"13Wv5hGhubAWgSPWtXYh6s1s7HX2N1psYg", | ||
"14mP6caC5dFhHdVAPCjPKM8Nm36MBDR5pM", | ||
"155FsTtEFq4eGCcBxDseuwLKPbmtWbyHJR", | ||
"156HpsWfgkWYLT63uhTAGUSUF3ZMnB9WWj", | ||
"15QcKCa84ZCHxbsqXDoKhi5XbmQB8jPEAd", | ||
"1EK8vW7UYaYHKiW4TZmYJKtwcZLM14VjvP", | ||
"1Hb8DmmvvtTYv5RBLuGtDxznkZwVpd5Vjy", | ||
"1HuPVqz2xvf1rdNFUqd62vRTyxP3jeX9Ch", | ||
"13xGCc4TPSYY9GYxBGVNox82KxyjkFnxMX", | ||
"13ahgw8sM95EDbugT3tdb8TYoMU46Uw7PX", | ||
"1439q4Na8v88kPBqoyg8F4ueL9SYr8ANWj", | ||
"13dXFMyG22EsUsvaWhCqUo7SXuX7rBPog6", | ||
"14USZ558Rr28AZwdJQyciSQkN4JT1cEoj2", | ||
"1FhRuUkk8Bfx8FJDemtxhKAR4F8GCNKrXG", | ||
"1Mm9brripN4RPTzkGnRrbt5uDWdqbfk2iX", | ||
"1LueUjEuBgc7cQhsWT8zAfTjcWmrNBZXaR", | ||
"1LXi3x7hyt17cxncscGE887WCrC6XDNZ4P", | ||
"19KiFrafXEyJCUDYFEv3B6tBUwyfFo7kNU", | ||
"18YDgRhxsomuBZ1g9d8Y1JuRmxDhF8Bvff", | ||
"18hcZVFPqDNAovJmb9vA6hEJrDz6uWXNGh", | ||
"1BDZBTb4KE5oq6wAgA6EvAe3uCFRrAbPao", | ||
"195HvmjXgoF3M5vFaBC8swZPhwrE7VhxRD", | ||
"18KDS3q6a4YV9Nn8jcyMvNoVPfcrfemeag", | ||
"19c8sUa54yQuRTVDfJa3iDkkCaFkzBJLPB", | ||
"1B6kJM75iu5ty1HAHMMz6tT1HhjoGNTCa9", | ||
"18M1Z337NqLtK9V69bssnQUYsvb7hmfSFS", | ||
"19eihBKk6e5YD2QXAe4SVUsxRLLnTDKsfv", | ||
"1C5aU4Xnpd3txbxehk46UZgiuNB8QdpHCH", | ||
"1BXyJc6BVuTFnHQCcjiWX2xmCPNVfaSZeb", | ||
"1Ar6meJQCkNoC9wnPcyRNNpzX5fBDaGcKd", | ||
"1CRjKZJu8LvTutnSKq4zTJ4yiqrzMAArYW", | ||
"1HweN9p41BY2RBunsPqyVuheEq7gVoxA9u", | ||
"1HX4s3JeFU3x1eQgPNQVAdx6FoCtbb1hr8", | ||
"1HzEPuenagLEWj68igDXBBXrzc293RuR5V", | ||
"1JtgU6Uo1RAt5eiMf34EehyatUezBQP36C", | ||
"1JVmoJT3471FjsX5H4hAeR1RyrDgpkHbpm", | ||
"1JVU43LNKXqa9W5fCh8tppxDDEWgfeNg46", | ||
"1JztCg7eKSkb1vi7NzGJynXpLZmoaFtYud", | ||
"1KFDUSZuapMv7YaDmL6cyrHTQhma1MtFYs", | ||
"1MkyfwJf7uhWTmVGGQXfcT5ip31DoHMxsz", | ||
"1LzwbLgdKd4eFLkpRdeajkH1YJkVCip2zj", | ||
"1MPJJzRaT8vLhowNB4dVyWRxxu79dq7WkB", | ||
"1MvpYtqgBH7CXbTutrSVCTNHPzm9vakuRy", | ||
"1N5X4kcZ56uRh24XrZoztS9Vb8G7j1Joop", | ||
"1Pq7hooZbEAz5y3QMnqFY8C5xqTdrjUwcA", | ||
"1PRXQEoL8vzEzoJJ9hbtAP6NaV2daccAUn", | ||
"1PxGTuJzDx1ceFHx4Z5CHaWuhiPBNovmZD", | ||
"1NA3Tj4b1jtx9eGELe31Jw4DrzTqKP3ayH" //https://www.cryptoground.com/mtgox-cold-wallet-monitor/ | ||
], | ||
}, | ||
} | ||
|
||
module.exports = cexExports(config) |
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 index = require('./index') | ||
|
||
module.exports = { | ||
ethereum: { | ||
tvl: () => 0, | ||
staking: index.ethereum.staking, | ||
} | ||
} |
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
Oops, something went wrong.