Synthetixio / synthetix-pm

Private repo for project management of the americas team
0 stars 2 forks source link

Design a script for determining Phase A entry SNX balances to be minted in Rinkeby #29

Open eternauta1337 opened 4 years ago

eternauta1337 commented 4 years ago

use synthetix-data requirements:

i-stam commented 4 years ago

I have created a script that uses synthetix-data and calls snx.holders in order to obtain the SNX stakers with collateral less than 2500 SNX (and more than 1 in order to eliminate tiny balances). I am attaching the script here so you can urn it locally first.

const snxData = require('synthetix-data'); // common js

snxData.snx.holders().then(holders => {
    const newData = holders
        .filter(({ collateral }) => collateral <= 2500 && collateral >= 1)
        .map(({ address, collateral }) => ({
            address: address,
            collateral: collateral,
        }));
    console.log(newData);
});
i-stam commented 4 years ago

In order to run the script above successfully, I have modified the synthetix-data module locally to return all the available results. You can sue instead the max parameter in this way snxData.snx.holders({ max: 10000 }) and also play with the asc/desc param locally.