Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Noble ecosystem (USDC, USDY) #11369

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion projects/helper/chain/cosmos.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ const endPoints = {
nolus: "https://pirin-cl.nolus.network:1317",
nibiru: "https://lcd.nibiru.fi",
bostrom: "https://lcd.bostrom.cybernode.ai",
joltify: "https://lcd.joltify.io"
joltify: "https://lcd.joltify.io",
noble: "https://api.noble.xyz"
};

const chainSubpaths = {
Expand Down
4 changes: 4 additions & 0 deletions projects/helper/coreAssets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1887,5 +1887,9 @@
},
"neutron": {
"NTRN": "untrn"
},
"noble": {
"USDC": "uusdc",
"USDY": "ausdy"
}
}
38 changes: 38 additions & 0 deletions projects/noble/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { queryV1Beta1 } = require('../helper/chain/cosmos');
const sdk = require("@defillama/sdk");

const chain = 'noble';
const NOBLE_DENOMS_URL = 'bank/v1beta1/denoms_metadata';
const NOBLE_SUPPLY_URL = 'bank/v1beta1/supply/';

const IGNORE_DENOMS = ['ufrienzies', 'ustake'];

async function tvl(api) {
const balances = {};

// fetch all denom metadata
const { metadatas } = await queryV1Beta1({ chain, url: NOBLE_DENOMS_URL });

for (const metadata of metadatas) {
const baseDenom = metadata.base;

// ignore invalid denoms
if (IGNORE_DENOMS.includes(baseDenom)) {
continue;
}

// fetch supply for denom
const { amount } = await queryV1Beta1({ chain, url: `${NOBLE_SUPPLY_URL}${baseDenom}` });

sdk.util.sumSingleBalance(balances, baseDenom, parseInt(amount.amount), 'noble');
}
return balances;
}

module.exports = {
misrepresentedTokens: false,
methodology: "TVL is calculated by fetching the total supply of tokens on the Noble chain.",
noble: {
tvl,
},
};
Loading