Skip to content

amberdata/amberdata-example-token-analysis

Repository files navigation

amberdata-example-token-analysis

A set of scripts to understand core usage for a given address.

How to use these scripts

Install the dependencies:

npm i

Set environmental variable to be your API key:

export AMBERDATA_API_KEY=YOUR_KEY_HERE

If you don't have an API Key yet, refer to Obtaining an API Key below.

Scripts & Commands

# 1. Token Holder Summary:
$ npm run item1 -- <Token_Address>
$ npm run item1 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52

# 2. Holdings Over Time:
$ npm run item2 -- <Token_Address>
$ npm run item2 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52

# 3. Average Holdings: (2 parts)
$ npm run item3 -- <Token_Address>
$ npm run item3b -- <Token_Address> <Whale_Threshold>
$ npm run item3 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52
$ npm run item3b -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52 1000000

# 6. Whale Percentages:
$ npm run item6 -- <Token_Address> <Whale_Threshold> <USD_Threshold>
$ npm run item6 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52 1000000 1000000

# 7. Related Token Holdings:
$ npm run item7 -- <Token_Address> <Holdings_Threshold>
$ npm run item7 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52 5

Example BNB Research:

Using Address: 0xb8c77482e45f1f44de1745f52c74426c631bdd52

1. How many token holders do I have?

Run the following code:

npm run item1 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52

2. How has this changed over time?

Run the following code:

npm run item2 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52

3. How many tokens does my average token holder have?

Run the following code:

npm run item3 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52
npm run item3b -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52 1000000

4. How long do they hold my tokens?

  • This will be a summation of #5, which requires iteration of all token holders

Run the following code:

TBD

5. How are people using my token? HODLing? Or day trading?

Run the following code:

TBD

6. What percentage of my token holders are whales (>1M in assets)?

Run the following code:

npm run item6 -- <Token_Address> <Whale_Threshold> <USD_Threshold>
npm run item6 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52 1000000 1000000

7. What other tokens are my users holding?

  • Base URL: https://web3api.io/api/v1/addresses/:hash/tokens
  • Filters out by amount specified (in this example 18)
  • NOTE: Takes a while for addresses with large amounts of holders, for a full percentage report. This also builds multiple reports with different filters allowing introspection against different validity parameters.

Run the following code:

npm run item7 -- <Token_Address> <Holdings_Threshold>
npm run item7 -- 0xb8c77482e45f1f44de1745f52c74426c631bdd52 5

Resources

Licensing

This project is licensed under the Apache Licence 2.0.

About

A set of scripts to understand core usage for a given address.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published