mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-04-30 05:45:32 +08:00
feat(curves) add Curves project (#13632)
Co-authored-by: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b165819a4e
commit
d6d53de6b4
23
projects/curves/index.js
Normal file
23
projects/curves/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { sumTokens2, nullAddress } = require('../helper/unwrapLPs')
|
||||
|
||||
// Curves main contract
|
||||
const CURVES_CONTRACT = "0xEad4138380B508949Ccd48B97AD930bd89aAb719"
|
||||
|
||||
// CurvesGroups contract
|
||||
const CURVES_GROUPS_CONTRACT = "0x88c7484d19E49B09233484824698a5214d81f866"
|
||||
|
||||
async function tvl(api) {
|
||||
return sumTokens2({
|
||||
tokens: [nullAddress],
|
||||
owners: [CURVES_CONTRACT, CURVES_GROUPS_CONTRACT],
|
||||
api
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
methodology: `We count the ETH locked in the Curves trading contracts (${CURVES_CONTRACT}, ${CURVES_GROUPS_CONTRACT})`,
|
||||
formnetwork: {
|
||||
tvl
|
||||
}
|
||||
}
|
||||
9
projects/fibonacci-dex/index.js
Normal file
9
projects/fibonacci-dex/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const { uniV3Export } = require("../helper/uniswapV3");
|
||||
|
||||
module.exports = uniV3Export({
|
||||
formnetwork: {
|
||||
factory: "0xbd799BE84dd34B1242e1f7736A6441d6b1540e8b",
|
||||
fromBlock: 1,
|
||||
isAlgebra: true,
|
||||
},
|
||||
})
|
||||
14
projects/form-l2/index.js
Normal file
14
projects/form-l2/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const { sumTokens2 } = require("../helper/unwrapLPs");
|
||||
|
||||
module.exports = {
|
||||
ethereum: {
|
||||
tvl: (api) =>
|
||||
sumTokens2({
|
||||
api,
|
||||
owners: [
|
||||
"0x4e259ee5f4136408908160dd32295a5031fa426f",
|
||||
],
|
||||
fetchCoValentTokens: true,
|
||||
}),
|
||||
},
|
||||
};
|
||||
@@ -134,6 +134,7 @@
|
||||
"flare",
|
||||
"flow",
|
||||
"fluence",
|
||||
"formnetwork",
|
||||
"fraxtal",
|
||||
"fsc",
|
||||
"ftn",
|
||||
@@ -397,4 +398,4 @@
|
||||
"zksync",
|
||||
"zora",
|
||||
"zyx"
|
||||
]
|
||||
]
|
||||
|
||||
@@ -18,9 +18,8 @@ const DEFAULTS = {
|
||||
ANKR_API_KEY: '79258ce7f7ee046decc3b5292a24eb4bf7c910d7e39b691384c7ce0cfb839a01',
|
||||
RENEC_RPC: "https://api-mainnet-beta.renec.foundation:8899/",
|
||||
FLOW_RPC: 'https://rest-mainnet.onflow.org',
|
||||
LULO_API_KEY: '',
|
||||
STY_RPC_MULTICALL: '0xca11bde05977b3631167028862be2a173976ca11',
|
||||
SANKO_RPC_MULTICALL: '0xca11bde05977b3631167028862be2a173976ca11',
|
||||
LULO_API_KEY: '',
|
||||
FORMNETWORK_RPC_MULTICALL: '0xca11bde05977b3631167028862be2a173976ca11',
|
||||
}
|
||||
|
||||
const ENV_KEYS = [
|
||||
|
||||
@@ -49,8 +49,8 @@ const fixBalancesTokens = {
|
||||
'0x60f397acbcfb8f4e3234c659a3e10867e6fa6b67': { coingeckoId: 'pepper', decimals: 18 },
|
||||
},
|
||||
flow: {
|
||||
'0xf1815bd50389c46847f0bda824ec8da914045d14': { coingeckoId: "usd-coin", decimals: 6 },
|
||||
'0x2aabea2058b5ac2d339b163c6ab6f2b6d53aabed': { coingeckoId: "flow-bridged-pyusd-flow", decimals: 6 },
|
||||
'0xf1815bd50389c46847f0bda824ec8da914045d14': { coingeckoId: "usd-coin", decimals: 6 },
|
||||
'0x2aabea2058b5ac2d339b163c6ab6f2b6d53aabed': { coingeckoId: "flow-bridged-pyusd-flow", decimals: 6 },
|
||||
},
|
||||
sonic: {
|
||||
'0x6047828dc181963ba44974801ff68e538da5eaf9': { coingeckoId: "tether", decimals: 6 },
|
||||
@@ -61,6 +61,13 @@ const fixBalancesTokens = {
|
||||
tara: {
|
||||
'0xe6a69cd4ff127ad8e53c21a593f7bac4c608945e': { coingeckoId: 'lara', decimals: 18 },
|
||||
},
|
||||
"formnetwork": {
|
||||
[ADDRESSES.null]: { coingeckoId: "ethereum", decimals: 18 },
|
||||
"0xb1b812b664c28E1bA1d35De925Ae88b7Bc7cdCF5": { coingeckoId: "ethereum", decimals: 18 },
|
||||
"0xFBf489bb4783D4B1B2e7D07ba39873Fb8068507D": { coingeckoId: "usd-coin", decimals: 6 },
|
||||
"0xFA3198ecF05303a6d96E57a45E6c815055D255b1": { coingeckoId: "tether", decimals: 6 },
|
||||
"0x0dc95Af5156fb0cC34a8c9BD646B748B9989A956": { coingeckoId: "wrapped-bitcoin", decimals: 8 },
|
||||
}
|
||||
}
|
||||
|
||||
ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) })
|
||||
|
||||
4
test.js
4
test.js
@@ -354,7 +354,7 @@ function fixBalances(balances) {
|
||||
else if (!token.includes(':')) newKey = `coingecko:${token}`
|
||||
if (newKey) {
|
||||
delete balances[token]
|
||||
sdk.util.sumSingleBalance(balances, newKey, BigNumber(value).toFixed(0))
|
||||
sdk.util.sumSingleBalance(balances, newKey, value)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -424,7 +424,7 @@ async function computeTVL(balances, timestamp) {
|
||||
|
||||
let amount, usdAmount;
|
||||
if (address.includes(":") && !address.startsWith("coingecko:")) {
|
||||
amount = new BigNumber(balance).div(10 ** data.decimals).toNumber();
|
||||
amount = Number(balance) / 10 ** data.decimals
|
||||
usdAmount = amount * data.price;
|
||||
} else {
|
||||
amount = Number(balance);
|
||||
|
||||
Reference in New Issue
Block a user