<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[cryptolisting.ws]]></title><description><![CDATA[cryptolisting.ws]]></description><link>https://cryptolistingws.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6af5fc50bb5d766878bca3bf/5a7d72eb-470d-44dd-88e2-b9e4e32d6072.png</url><title>cryptolisting.ws</title><link>https://cryptolistingws.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 15:06:10 GMT</lastBuildDate><atom:link href="https://cryptolistingws.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Parsing Multi-Token Listing Announcements: Comma-Separated Tickers and listingType Enums]]></title><description><![CDATA[If a downstream parser reads only the first symbol out of an announcement, it silently misses tokens. Plenty of "list TOKEN1, TOKEN2 and TOKEN3" notices…]]></description><link>https://cryptolistingws.hashnode.dev/parsing-multi-token-listing-announcements-comma-separated-tickers-and-listingtype-enums</link><guid isPermaLink="true">https://cryptolistingws.hashnode.dev/parsing-multi-token-listing-announcements-comma-separated-tickers-and-listingtype-enums</guid><category><![CDATA[websockets]]></category><category><![CDATA[Python]]></category><category><![CDATA[Cryptocurrency]]></category><category><![CDATA[api]]></category><dc:creator><![CDATA[cryptolisting.ws]]></dc:creator><pubDate>Fri, 13 Nov 2026 09:53:35 GMT</pubDate><content:encoded><![CDATA[<p>If a downstream parser reads only the first symbol out of an announcement, it silently misses tokens. Plenty of "list TOKEN1, TOKEN2 and TOKEN3" notices ship more than one coin in a single message, and a naive parser grabs <code>TOKEN1</code> and drops the rest. This is a short, bookmark-it reference for parsing a real listing-announcement payload cleanly — multiple tickers included.</p>
<p>The schema below is the message format CLW (<a href="http://cryptolisting.ws">cryptolisting.ws</a>) emits; it is documented in full at the public <a href="https://cryptolisting.ws/docs/book/message-reference.html">message-reference</a>. The parsing patterns themselves are generic, so they port to whatever feed you are reading.</p>
<h2>The payload</h2>
<p>Every announcement message carries the same flat fields:</p>
<table>
<thead>
<tr>
<th>Field</th>
<th>Meaning</th>
</tr>
</thead>
<tbody><tr>
<td><code>type</code></td>
<td>Message kind (e.g. <code>announcement</code>, <code>test_announcement</code>)</td>
</tr>
<tr>
<td><code>title</code></td>
<td>Human-readable headline</td>
</tr>
<tr>
<td><code>ticker</code></td>
<td>Symbol(s) — <strong>comma-separated string</strong> when multiple</td>
</tr>
<tr>
<td><code>publisher</code></td>
<td>Source exchange: <code>binance</code>, <code>upbit</code>, <code>bithumb</code>, <code>robinhood</code> (lowercase)</td>
</tr>
<tr>
<td><code>listingType</code></td>
<td>What kind of event (enum, below)</td>
</tr>
<tr>
<td><code>detectedTimestampUs</code></td>
<td>When the announcement was detected, microseconds</td>
</tr>
<tr>
<td><code>dispatchTimestampUs</code></td>
<td>When it was sent to the consumer, microseconds</td>
</tr>
<tr>
<td><code>abnormalDetectionLatency</code></td>
<td><code>true</code> = detected under unusual conditions (possibly slower): handle with care</td>
</tr>
<tr>
<td><code>markets</code></td>
<td><em>Optional.</em> Upbit spot listings only: the quote markets opened, e.g. <code>KRW,BTC</code></td>
</tr>
</tbody></table>
<h3>The two enums that drive routing</h3>
<p><code>listingType</code> is the field a consumer's logic branches on:</p>
<pre><code class="language-plaintext">spot_listing        spot_delisting
futures_listing     futures_delisting
hodler_airdrop      caution_released
monitoring_tag_extend
monitoring_tag_remove
wallet_listing      cex_listing         (Robinhood: added to assets / tradable)
not_listing
</code></pre>
<p><code>publisher</code> is always one of <code>binance</code>, <code>upbit</code>, <code>bithumb</code>, <code>robinhood</code>, lowercase. Match on the exact string — do not lowercase-then-compare-then-hope.</p>
<h2>The bug: only reading one ticker</h2>
<p><code>ticker</code> is a string, not an array. For a single-coin listing it is <code>"WIF"</code>. For a multi-coin listing it is <code>"WIF,PEPE,BONK"</code>. If a consumer treats it as a single symbol, it captures one coin and misses the others. Always split.</p>
<h3>Python</h3>
<pre><code class="language-python">def parse(data: dict) -&gt; dict:
    return {
        "tickers": [t for t in data["ticker"].split(",") if t],
        "publisher": data["publisher"],
        "listing_type": data["listingType"],
        "detected_us": data["detectedTimestampUs"],
        "dispatch_us": data["dispatchTimestampUs"],
    }

msg = parse(payload)
if msg["listing_type"] == "spot_listing":
    for sym in msg["tickers"]:
        handle(sym)          # whatever your downstream does, per token
</code></pre>
<h3>JavaScript / Node</h3>
<pre><code class="language-js">function parse(data) {
  return {
    tickers: data.ticker.split(",").filter(Boolean),
    publisher: data.publisher,
    listingType: data.listingType,
    detectedUs: data.detectedTimestampUs,
    dispatchUs: data.dispatchTimestampUs,
  };
}

const msg = parse(payload);
if (msg.listingType === "futures_listing") {
  msg.tickers.forEach(handle); // iterate, never index [0]
}
</code></pre>
<p>The <code>filter(Boolean)</code> / truthiness check guards against a trailing comma or stray whitespace producing an empty symbol — cheap insurance in the parse step.</p>
<h2>Branch on listingType — not every event means the same thing</h2>
<p>Branch deliberately. A <code>spot_delisting</code> or <code>monitoring_tag_remove</code> is the opposite signal from a <code>spot_listing</code>, and <code>not_listing</code> is noise you should drop before it ever reaches downstream logic. A tiny allow-list keeps interpretation honest:</p>
<pre><code class="language-python">ACT_ON = {"spot_listing", "futures_listing"}
if msg["listing_type"] in ACT_ON:
    ...
</code></pre>
<h2>Validate your parser before it matters</h2>
<p>You don't want to discover a parsing bug live during a real listing. Send a probe message and you get a deterministic <code>test_announcement</code> back with a full, well-formed payload — <code>ticker</code> is <code>DUMMYTOKEN</code> — regardless of your tier:</p>
<pre><code class="language-json">{"type": "test"}
</code></pre>
<p>Run it through your <code>parse()</code> and assert the shape. If <code>DUMMYTOKEN</code> comes out clean, your splitting, enum matching, and field access are wired correctly.</p>
<p>One note on tiers: the <strong>SpeedTrial</strong> tier redacts <code>ticker</code> and <code>title</code> (so you can benchmark detection speed without getting tradeable symbols), but <code>publisher</code>, <code>listingType</code>, and the timestamp fields stay fully accurate — which is exactly what you need to validate the routing half of your parser before upgrading. (If you want the full title and ticker, the <strong>FreeDelayed</strong> tier ships the complete feed at a +240 ms delay, free for the first month.)</p>
<h2>Recap</h2>
<ul>
<li><code>ticker</code> is a comma-separated string → <code>split(",")</code> and iterate, every time.</li>
<li>Branch on <code>listingType</code>; keep an explicit allow-list so delistings and <code>not_listing</code> are handled as the distinct signals they are.</li>
<li><code>publisher</code> is lowercase, exact-match it.</li>
<li>Probe with <code>{"type":"test"}</code> to lock your parser before a real event.</li>
</ul>
<p>Full field-by-field schema, including every <code>type</code> and edge case, lives in the public <a href="https://cryptolisting.ws/docs/book/message-reference.html">message-reference docs</a>. Grab a free SpeedTrial key to pull a live <code>test_announcement</code> through your code — tiers and public prices on <a href="https://cryptolisting.ws/pricing/">pricing</a>, keys via Telegram <a href="https://telegram.me/clwebsocket">@CLWebsocket</a> or <a href="mailto:contact@cryptolisting.ws">contact@cryptolisting.ws</a>.</p>
]]></content:encoded></item></channel></rss>