Developer Shares Lessons on Designing DEX Metrics
A developer shares insights on designing a DEX metric on CoinMarketCap, discovering algebraic redundancy, and uncovers three undocumented API quirks.

Stock photo for illustration only, not from the actual event
- A developer shares the experience of building a DEX metric only to find the formula collapsed algebraically.
- Resolved the issue by switching to the /v1/dex/tokens/transactions endpoint to inspect maker addresses directly.
- An 800-swap sample of AUSD on Ethereum revealed the discrepancy between net volume sums and actual distribution.
- Uncovered three undocumented behaviors of the CoinMarketCap DEX API.
DEX flow tools typically reduce market tape down to a single signed number representing net volume. However, summing data is inherently lossy. A software developer shared on Dev.to about designing a custom metric intended to distinguish between a market maker distributing to retail versus mere wash trading, only to discover that the mathematical formula eventually degenerated into a ratio he already possessed.
The original concept involved dividing volume by trade count on each side to find the average ticket size. If buyers averaged 180 dollars while sellers averaged 27,000 dollars, it would signal market desk presence even when net flow read zero. The resulting ticket ratio formula combined volume quotients and trade count ratios.

Stock photo for illustration only, not from the actual event
However, algebra revealed that when net flow flatlines—the exact scenario where hidden market asymmetry matters most—the first factor collapses to one, and the ticket ratio degenerates entirely into the count ratio. The two supposedly independent families of fields converged into one. The developer noted that checking the formula algebraically from the start would have prevented this realization from dawning only after sweeping hundreds of tokens.
This case study offers a valuable lesson for quantitative developers and on-chain analysts: relying solely on aggregated summary data can obscure underlying mathematical dependencies. Transitioning to raw transactional data is crucial when high-precision behavioral insights are required.
The solution was not a more complex model, but rather utilizing a different endpoint: /v1/dex/tokens/transactions. This route returns individual swaps complete with side indicators, USD values, and maker addresses, transforming market concentration from an inference into a direct count.
"Same 800 swaps. The sum said balanced; the split said one desk selling to two hundred people."
Edy Cutjong
An analysis of 800 swaps for AUSD on Ethereum captured on September 7, 2026, demonstrated this clearly. While the summary sum reported a balanced market, splitting the tape exposed a single desk selling tokens to two hundred distinct participants using a keyless Python script.
Furthermore, the developer documented three undocumented behaviors of the CoinMarketCap DEX API:
- The pagination cursor data.lastId sits on the response envelope rather than the final row, easily causing infinite loops on page one.
- Rate throttling frequently arrives as an HTTP 500 status code as often as 429 for anonymous tiers, requiring explicit handling to distinguish from outages.
- Three out of four CORS headers are sent, omitting access-control-allow-origin, which causes browsers to discard valid incoming payloads.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment