Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get total issued debt at some specific block
const { SynthetixJs } = require('synthetix-js');
const snxjs = new SynthetixJs();
(async () => {
const provider = snxjs.ethers.getDefaultProvider();
const currentBlock = await provider.getBlockNumber();
const totalDebtInSystemAtBlock = await snxjs.Synthetix.contract.totalIssuedSynths(
snxjs.utils.toUtf8Bytes4('sUSD'),
{ blockTag: currentBlock }
);
console.log(snxjs.utils.formatEther(totalDebtInSystemAtBlock));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.