Skip to content

m-kus/unrug-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Unrug stats

This is a demo project showcasing factory indexing pattern. Note that it does not scale well: once you have more than ~10k indexes you'll face issues with constant lags, also initial launch time would be pretty long. The alternatives are:

  • Using more sophisticated datasources that allow to filter by class hash rather than contract address (e.g. https://github.com/dipdup-io/starknet-indexer)
  • Subscribing to events by topic (which is sn_keccak of event name) and filter out unsuitable events afterwards
  • Index entire blocks

Running locally

See installation docs

Example queries

Top memes by activity

The more token transfers and the more recent they are - the better.

query TopMemesByActivity {
  memecoin(limit: 3, order_by: {activityMetric: desc}) {
    createdAt
    name
    symbol
    numHolders
    numTransfers
    updatedAt
  }
}

Top memes by the number of holders

query TopMemesByNumberOfHolders {
  memecoin(limit: 3, order_by: {numHolders: desc}) {
    createdAt
    name
    symbol
    numHolders
    numTransfers
    updatedAt
  }
}

Top holders with max number of memes

query TopHoldersWithMaxNumberOfMemes {
  holder(order_by: {numMemes: desc}, limit: 3) {
    contractAddress
    numMemes
    createdAt
    updatedAt
  }
}

Top holders (by activity)

The more transfers and the more recent they are - the better.

query TopHoldersWithMaxNumberOfMemes {
  holder(order_by: {numMemes: desc}, limit: 3) {
    contractAddress
    numMemes
    createdAt
    updatedAt
    numTransfers
  }
}

TODO: filter out liquidity pools and Unrug contracts.

Top holders of the most popular memes (by balance)

List of meme addresses provided (in this example it's Real).

query TopHoldersOfSpecifiedMemes {
  position(limit: 3, order_by: {balance: desc}, where: {memeId: {_in: [3019945096687648353897341156076824465806717891370049345070820623605306751174]}}) {
    balance
    holder {
      contractAddress
      createdAt
      updatedAt
      numTransfers
      numSells
      numMemes
    }
    meme {
      name
    }
  }
}

Early adopters of the most active memes that are still hodling

List of meme addresses provided (in this example it's Real).

query EarlyMemeHodlers {
  position(limit: 3, order_by: {createdAt: asc}, where: {memeId: {_in: [3019945096687648353897341156076824465806717891370049345070820623605306751174]}, numSells: {_eq: "0"}}) {
    balance
    holder {
      contractAddress
      numMemes
    }
    meme {
      name
      symbol
    }
    numTransfers
  }
}

Absolute OGs (holding max memes since the beginning of unrug)

query AbsoluteOGs {
  holder(order_by: {createdAt: asc, numMemes: desc}, where: {numSells: {_eq: "0"}}, limit: 3) {
    numMemes
    contractAddress
    createdAt
  }
}

Most recently created memes

query RecentMemes {
  memecoin(limit: 3, order_by: {createdAt: desc}) {
    createdAt
    name
    symbol
    numTransfers
    numHolders
    updatedAt
  }
}

Most recently active memes

query RecentlyActiveMemes {
  memecoin(limit: 3, order_by: {updatedAt: desc}) {
    updatedAt
    name
    symbol
    numTransfers
    numHolders
  }
}

Most recently active holders

query RecentlyActiveHolders {
  holder(order_by: {activityMetric: desc}, limit: 5) {
    numMemes
    numTransfers
    numSells
    contractAddress
    createdAt
    updatedAt
  }
}

Time series

Number of memes over time (blocks)

Number of holders over time (blocks)

Amount of activity (transfers) over time (blocks)