Skip to content

Token stats calculated incorrectly #569

@christroutner

Description

@christroutner

This issue was first reported by a user in the Simple Ledger Protocol Telegram channel:
https://t.me/simpleledger

Token stats are being reported incorrectly.

This is an issue with the current /tokenStats endpoint in rest.bitcoin.com. Here is the query:
https://rest.bitcoin.com/v2/slp/tokenStats/b10677aef051b73e6b170c1c0824da33a3e0680ab5a01cd8d76aa77840fccfb4

It's showing 200,010 tokens in circulation but there is only 100,010, which is reflected accurately on the SLP explorer:
https://simpleledger.info/#token/b10677aef051b73e6b170c1c0824da33a3e0680ab5a01cd8d76aa77840fccfb4

Here is the actual code that gets called. It's a series of queries to SLPDB. There must be an issue in one of the queries where its counting the initial token issuance twice.
https://github.com/Bitcoin-com/rest.bitcoin.com/blob/master/src/routes/v2/services/slpdb.ts#L77-L89

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions