Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sashaboulouds/d6cf5e034e2a505c2337a26e76cf2a83 to your computer and use it in GitHub Desktop.
Save sashaboulouds/d6cf5e034e2a505c2337a26e76cf2a83 to your computer and use it in GitHub Desktop.
Collect every 10 seconds all h6 trending Solana pairs on DexScreener β€” and save to a .csv file πŸ¦…
@rdamaj
Copy link

rdamaj commented Nov 21, 2024

@Sputchik if you figure this out lmk will gladly pay you a handsome sum of $, iv been running a scanning service for a long time that depended on this WS feed.

@Sputchik
Copy link

@Sputchik if you figure this out lmk will gladly pay you a handsome sum of $, iv been running a scanning service for a long time that depended on this WS feed.

@Sputchik if you figure this out lmk will gladly pay you a handsome sum of $, iv been running a scanning service for a long time that depended on this WS feed.

dm t.me/kufla

@prodpeak
Copy link

Does anyone have any further info on the schema?

@prodpeak
Copy link

OK. I've done it (sort of).

I worked through the data structure and manually mapped the data out of the binary format into a readable JSON format.
It's a bit messy when I get down to the links and making adjustments for tokens that are launched on moonshot, but it works.

I won't share the code here, but HMU if you want to review my work and continue to build on it.

There is a stats section at the beginning of the binary data for global tx volume. After that each token follows this format:

{
    "chainId": "solana",
    "dexId": "raydium",
    "pairAddress": "FRsKKpxtoLjTzg45dzMvHu1EyGpU7wUvwUJDXEBxoWKk",
    "baseToken": {
        "address": "6gvWSka7SnJDn4mqV7Ydn4q7AyVNSo2aX4TNGjBg7Cct",
        "name": "MUMMAT",
        "symbol": "MUMMAT",
        "decimals": 9
    },
    "quoteToken": {
        "address": "So11111111111111111111111111111111111111112",
        "name": "Wrapped SOL",
        "symbol": "SOL",
        "decimals": 9
    },
    "quoteTokenSymbol": "SOL",
    "price": "0.000001850",
    "priceUsd": "0.0004465",
    "txns": {
        "m5": {
            "buys": 0,
            "sells": 0
        },
        "h1": {
            "buys": 1,
            "sells": 1
        },
        "h6": {
            "buys": 12,
            "sells": 9
        },
        "h24": {
            "buys": 4674,
            "sells": 87
        }
    },
    "buyers": {
        "m5": 0,
        "h1": 1,
        "h6": 12,
        "h24": 4663
    },
    "sellers": {
        "m5": 0,
        "h1": 1,
        "h6": 8,
        "h24": 72
    },
    "makers": {
        "m5": 0,
        "h1": 1,
        "h6": 18,
        "h24": 4725
    },
    "volume": {
        "h1": 187.5,
        "h6": 1149.02,
        "h24": 36701.15
    },
    "volumeBuy": {
        "h1": 93.87,
        "h6": 820.33,
        "h24": 18622.85
    },
    "volumeSell": {
        "h1": 93.63,
        "h6": 328.68,
        "h24": 18078.3
    },
    "priceChange": {
        "m5": 0,
        "h1": -0.63,
        "h6": 1.52,
        "h24": 5.86
    },
    "liquidity": {
        "usd": 200383.9,
        "base": 224190430,
        "quote": 415.56
    },
    "marketCap": 365385,
    "fdv": 365385,
    "pairCreatedAt": 1721569640000,
    "cmsProfile": {
        "headerId": "Dh0VAaWTabr9NBn2",
        "iconId": "iloOynWhLGzK-19k",
        "description": "Yo, so Mummat woke up in some dark AF pyramid. Dude gets up, shakes off the ancient dust, and starts remembering his past life of total degenerate vibes – think vices and max laziness. He’s like, β€œTime to clean up my act and live straight.”\r\n\r\nAfter wandering around, Mummat finds this lit planet called Solana. It's a crazy place with dope creatures and tech that's outta this world. He soon meets the squad: Pepe, Andy, Landwolf, and Brett – the \"Boys Club.\" These guys are all about blazing up, doing lines, and trading crypto.\r\n\r\nLooks like the universe wasn’t about to let Mummat chill and go straight LMAO.",
        "links": [
            {
                "url": "https://mummat.org/"
            },
            {
                "type": "twitter",
                "url": "https://x.com/mummatfree"
            },
            {
                "type": "telegram",
                "url": "https://t.me/MummatSolana"
            }
        ]
    },
    "isBoostable": true,
    "c": "a",
    "a": "solamm",
    "moonshot": {
        "progress": 100,
        "quoteMcap": 0,
        "curvePos": "0",
        "curveType": "",
        "coefB": "",
        "mcapThreshold": "0",
        "creator": "2TcnXHpFJfu35xihxsGkrvyPh83sf67EXoXXXrtTJ8Ar",
        "migrationDex": "raydium"
    }
}

Tokens are static for all fields before and including pairCreatedAt.
After that they differ depending on token type, launchpad, etc. I've not fully mapped those fields.

@prodpeak
Copy link

Here is an example map for a pair and the data I have working:

b'\x0csolana\x0eraydium\x00XFEeo6Hof4tLCTcgbwCeJru4veVRHnXpRYzdA3accFrE3X74ZnBs4M4q2icYPLKry6RDFhCEKwgYNZAqq5Hxjkpump\x08goob\x08goob\x02\x00\x00\x00\x00\x00\x00\x18@\x00VSo11111111111111111111111111111111111111112\x16Wrapped SOL\x06SOL\x02\x00\x00\x00\x00\x00\x00"@\x06SOL\x160.000001964\x02\x120.0004781\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00$@\x00\x00\x00\x00\x00\x00(@\x00\x00\x00\x00\x00\xc0W@\x00\x00\x00\x00\x00\x00Q@\x00\x00\x00\x00\x00\xb0}@\x00\x00\x00\x00\x00@w@\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 @\x00\x00\x00\x00\x00\x80Q@\x00\x00\x00\x00\x00`p@\x02\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00 @\x00\x00\x00\x00\x00\x80I@\x00\x00\x00\x00\x00@n@\x02\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x000@\x00\x00\x00\x00\x00\x00W@\x00\x00\x00\x00\x00\x90u@\x02\xecQ\xb8\x1e\x85\x1be@\x023333\xb3M\xab@\x02\xcd\xcc\xcc\xcct\xfc\xf0@\x02\x85\xebQ\xb8j\xfa\x0bA\x02\x00\x02\xa4p=\n\xd7=\x8f@\x02\x00\x00\x00\x00\xd8#\xe1@\x02\x1f\x85\xebQ\xd4\x8c\xfb@\x02\x02\xecQ\xb8\x1e\x85\x1be@\x02\x1f\x85\xebQ8~\xa3@\x02{\x14\xaeG\x11\xd5\xe0@\x02\\\x8f\xc2\xf5\x00h\xfc@\x02\xe1z\x14\xaeG\xe1\xca\xbf\x02\x00\x00\x00\x00\x00\x00\x12\xc0\x02\x1f\x85\xebQ\xb8\x1e\t@\x02\xecQ\xb8\x1e\x85k \xc0\x02H\xe1z\x14\x8e\xcf\xfc@\x00\x00\x00$\xbdl\x9dA\xca\xc3B\xadiJn@\x02\x00\x00\x00\x00\xf8\x1e\x1bA\x02\x00\x00\x00\x00\xf8\x1e\x1bA\x02\x00\x00\xf2\xb8\xd62yB\x02\x01\x02\x01\x02\x01\x00\x02\x01\x00\x02\x00\x00\x00\x00\x00\x00\x00@\x02\x0caa65ec\x00\x01\x00\x02a\x0csolamm\x02\x00\x00'
{'chainId': 'solana', 'dexId': 'raydium', 'labels': [], 'pairAddress': 'ChUNGiiC4LjHRXY1rHi8y2pGTDumyfQaEiMSdjhF8xu2', 'baseToken': {'address': 'Gg7yp9ZL4Fszk26zPmVToCvEqSXWLRR25KsgKQdFpump', 'name': 'SOL RACCOON', 'symbol': 'RACCOON', 'decimals': 6}, 'quoteToken': {'address': 'So11111111111111111111111111111111111111112', 'name': 'Wrapped SOL', 'symbol': 'SOL', 'decimals': 9}, 'quoteSymbol': 'SOL', 'price': '0.000003900', 'priceUsd': '0.0009495', 'txns': {'m5': {'buys': 92, 'sells': 79}, 'h1': {'buys': 1649, 'sells': 1248}, 'h6': {'buys': 16066, 'sells': 14433}, 'h24': {'buys': 49388, 'sells': 33272}}, 'buyers': {'m5': 81, 'h1': 1224, 'h6': 12333, 'h24': 37374}, 'sellers': {'m5': 68, 'h1': 899, 'h6': 8995, 'h24': 14724}, 'makers': {'m5': 124, 'h1': 1714, 'h6': 17118, 'h24': 38718}, 'volume': {'m5': 23324.79, 'h1': 401164.58, 'h6': 6699571.2, 'h24': 16246400.3}, 'volumeBuy': {'m5': 10799.88, 'h1': 203351.66, 'h6': 3335607.43, 'h24': 8151975.68}, 'volumeSell': {'m5': 12524.91, 'h1': 197812.91, 'h6': 3363963.76, 'h24': 8094424.61}, 'priceChange': {'m5': -3.93, 'h1': 15.67, 'h6': -54.4, 'h24': 424.0}, 'liquidity': {'usd': 152295.23, 'base': 80279977.0, 'quote': 312.4312}, 'marketCap': 949560, 'fdv': 949560, 'pairCreatedAt': 1732712673000}

@cyraxop123
Copy link

did anyone found solution?

b'\n1.3.0\x08pair\x02\x0csolana\x0eraydium\x00X83G6VzJzLRCnHBsLATj94VCpRimyyqwuN6ZfL11McADLXGtDZKAqvMZMnti46ZewMiXCa4oXF4bZxwQPoKzXPFxZn\x0cnubcat\x06nub\x02\x00\x00\x00\x00\x00\x00"@\x00VSo11111111111111111111111111111111111111112\x16Wrapped SOL\x06SOL\x02\x00\x00\x00\x00\x00\x00"@\x06SOL\x140.00008376\x02\x0e0.02034\x00\x00\x00\x00\x00\x00.@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\xc0R@\x00\x00\x00\x00\x00\x00M@\x00\x00\x00\x00\x00\x10u@\x00\x00\x00\x00\x00\xc0u@\x00\x00\x00\x00\x00\xf8\x92@\x00\x00\x00\x00\x00<\x92@\x02\x00\x00\x00\x00\x00\x00*@\x00\x00\x00\x00\x00\x00M@\x00\x00\x00\x00\x00\xe0h@\x00\x00\x00\x00\x00\xf0\x82@\x02\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00J@\x00\x00\x00\x00\x00\xe0i@\x00\x00\x00\x00\x00\x88\x81@\x02\x00\x00\x00\x00\x00\x002@\x00\x00\x00\x00\x00@Y@\x00\x00\x00\x00\x00pu@\x00\x00\x00\x00\x00\xd0\x8d@\x02\xe1z\x14\xaeg\xec\xce@\x02\n\xd7\xa3p\xfd\x0f\xf7@\x02H\xe1z\x14+^\x13A\x02\n\xd7\xa30#g2A\x02\x02\n\xd7\xa3p=\xc2\xa8@\x02\xa4p=\n\x97\xcb\xe3@\x02\xa4p=\n#\x08\x02A\x02\xaeG\xe1z\xe7/"A\x02\x02\x1f\x85\xebQ\xd8\xbb\xc8@\x02R\xb8\x1e\x85cT\xea@\x02\xecQ\xb8\x1e3\xb4\x04A\x02\x14\xaeG\xe1^\x9e"A\x02H\xe1z\x14\xaeG\xfd\xbf\x02\x8f\xc2\xf5(\\\x8f\xe2\xbf\x02H\xe1z\x14\xaeG\x1f\xc0\x02\x85\xebQ\xb8\x1e\x85\r\xc0\x02\xe1z\x14\xce\x92=BA\x00\x00\x00\xa0\x17\x0e\x8cAH\xe1z\x14\xee4\xb3@\x02\x00\x00\x00\xb0\xfdesA\x02\x00\x00\x00\xb0\xfdesA\x02\x00\x80\xa4\x9f6\xe7xB\x02\x01\x02\x01\x0'

for this encoding?

@Pashovich
Copy link

@prodpeak , Hi, how can i contact you regarding your work?

@prodpeak
Copy link

prodpeak commented Dec 7, 2024

@prodpeak , Hi, how can i contact you regarding your work?

Share your telegram username and I'll DM you

@Blender-git
Copy link

Blender-git commented Dec 8, 2024

@prodpeak

Hi, how can i contact you regarding your work?

I have been looking for an answer to this problem for a long time

@Nux-xader
Copy link

v4

now that's doesn't work:')

@mohamed224legrand
Copy link

@prodpeak hi sir please how can i joind you on telegram

@SteveGremory
Copy link

@prodpeak heya, I wanna checkout your code, tele is https://t.me/stevegremory

@karthikkrishnaswamysr
Copy link

Hi @prodpeak , were you able to find a solution to this. can i please have a look at the code my telegram is https://t.me/kratkrish

@Sputchik
Copy link

Sputchik commented Mar 8, 2025

Anyone needing ready solution for decoding (or connecting to websocket) websocket or any other (specify) data for python/js, contact t.me/kufla

Update: Contactlessly, you can get it here (example)

@Blender-git
Copy link

Hi, how can i contact you regarding your work?
@BOTtellegrams
I have been looking for an answer to this problem for a long time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment