This is a collection of utilities to query Synthetix data from Ethereum. This data has been indexed by The Graph via the various subgraphs the Synthetix team maintains (the subgraph code repo).
exchanges.since({ timestampInSecs = 1 day ago })
Get the lastN
exchanges since the given timestampInSecs (in seconds, so one hour ago is3600
). These are ordered in reverse chronological order.exchanges.total()
Get the total exchange volume, total fees and total number of unique exchange addresses.depot.userActions({ user })
Get all depot deposit (sUSD
) actions for the given user -deposit
,withdrawl
,unaccepted
,removed
.depot.clearedDeposits({ fromAddress, toAddress })
Get all cleared synth deposits (payments ofETH
forsUSD
) either from a givenfromAddress
or (and as well as) to a giventoAddress
# get last 24 hours of exchange activity, ordered from latest to earliest
npx synthetix-data exchanges.since
const snxData = require('synthetix-data'); // common js
// or
import snxData from 'synthetix-data'; // es modules
snxData.exchanges.since().then(exchanges => console.log(exchanges));
<script src="//cdn.jsdelivr.net/npm/synthetix-data/index.min.js"></script>
<script>
window.snxData.exchanges.since().then(console.log);
</script>