Created
July 3, 2019 21:54
-
-
Save jjgonecrypto/bd208ce7e53160e1542452953337d772 to your computer and use it in GitHub Desktop.
Get total issued debt at some specific block
This file contains hidden or 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
| 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