feat(screener): add screener routes for market data filtering and pagination#68
Conversation
|
@fadesany Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Miracle656
left a comment
There was a problem hiding this comment.
Nicely done — the screener route is well-structured and safe:
- Dynamic
ORDER BY ${sortBy} ${order}is the one spot you can't parameterize, and you correctly allowlist both (allowedSortFields+asc/desc) before interpolation, so no injection. - All filter values, the keyset cursor tuple, and
limitgo through$Nplaceholders. - Keyset pagination with
(sortBy, pair_key)row-value comparison + fetch-one-extrahasMoreis the right approach, and the base64 cursor round-trips cleanly.
Minor (non-blocking) note: market_cap is aliased to the same expression as liquidity in screener_data, so filtering/sorting by market_cap behaves identically to liquidity. Fine as a placeholder, but worth a follow-up once real market-cap data exists.
The failing Typecheck & build check is the pre-existing src/webhookDispatcher.ts error on main (direction: string not assignable to ThresholdDirection) — unrelated to this PR; screener.ts adds no new type errors. Merging through it.
closes #63