Skip to content

feat(perp-screener): add trader_type, sectors_filter, sm_label and trader_label filters (ECINT-6680)#460

Merged
gulshngill merged 2 commits into
mainfrom
feat/perp-screener-new-filters
Jun 16, 2026
Merged

feat(perp-screener): add trader_type, sectors_filter, sm_label and trader_label filters (ECINT-6680)#460
gulshngill merged 2 commits into
mainfrom
feat/perp-screener-new-filters

Conversation

@gulshngill

Copy link
Copy Markdown
Contributor

Summary

Adds CLI support for four new filter parameters on the POST /api/v1/perp-screener endpoint (ECINT-6680).

New Filters

--trader-type <type

Filter by trader type. Replaces/deprecates the old only_smart_money field on the API side.
Accepted values: all (default), sm, whale, public_figure, high_winrate_hl_perps_trader

nansen research perp screener --trader-type whale --limit 10
nansen research perp screener --trader-type sm --limit 20

--sectors-filter <sectors>

Comma-separated category:subcategory pairs. Filters results to coins in those sectors.
Example: "Crypto:AI,TradFi:Stocks" → sent as ["Crypto:AI", "TradFi:Stocks"]

nansen research perp screener --sectors-filter "Crypto:AI,Crypto:DeFi" --trader-type whale

--sm-label-filter <labels>

Comma-separated Nansen SM labels. Only applies when --trader-type is all or sm.

nansen research perp screener --trader-type sm --sm-label-filter "30D Smart Trader"

--trader-label-filter <labels>

Comma-separated HL perps trader labels. Only applies when --trader-type is all or sm.

nansen research perp screener --trader-label-filter "HL Perps Whale"

Changes

  • src/api.js: Updated perpScreener() to accept and pass traderType, sectorsFilter, smLabelFilter, traderLabelFilter
  • src/cli.js: Updated perp screener handler to parse new CLI options and forward them (comma-separated strings split to arrays)
  • src/schema.json: Added new options to commands.research.subcommands.perp.subcommands.screener.options
  • skills/nansen-perp-screener/SKILL.md: Added usage examples for all four new filters
  • src/__tests__/api.test.js: Added 6 tests for perpScreener API method
  • src/__tests__/cli.internal.test.js: Added 7 tests for CLI handler option wiring

Closes ECINT-6680

…ader_label filters (ECINT-6680)

- Add --trader-type option: all | sm | whale | public_figure | high_winrate_hl_perps_trader
- Add --sectors-filter option: comma-separated category:subcategory pairs
- Add --sm-label-filter option: comma-separated Nansen SM labels
- Add --trader-label-filter option: comma-separated HL perps trader labels
- Wire all new options into perpScreener() API method
- Update src/schema.json with new options
- Update skills/nansen-perp-screener/SKILL.md with usage examples
- Add tests in api.test.js and cli.internal.test.js
@gulshngill

Copy link
Copy Markdown
Contributor Author

Live test results ✅

Tested against the production API after merging the related backend PRs.

All filters confirmed working

Filter Result
No filters (default) ✅ Returns top coins by volume
--trader-type sm ✅ Returns smart money trader data
--trader-type whale ✅ Returns whale trader data
--trader-type public_figure ✅ Returns public figure data
--trader-type high_winrate_hl_perps_trader ✅ Returns high winrate trader data
--sectors-filter "Crypto:AI" with --trader-type whale ✅ Correctly narrows to AI sector coins
--sm-label-filter "30D Smart Trader" ✅ Correctly filters by SM label
--trader-label-filter ✅ Wired correctly

Bug fixed in this PR

Initial implementation placed the new filter fields at the top level of the request body. Fixed to nest them under filters to match the API contract. Tests updated accordingly.

Example usage

# Whale traders in the AI sector
nansen research perp screener --trader-type whale --sectors-filter "Crypto:AI" --limit 10

# Smart money with label filter
nansen research perp screener --trader-type sm --sm-label-filter "30D Smart Trader"

@gulshngill gulshngill requested a review from kome12 June 16, 2026 07:28
@gulshngill gulshngill merged commit f361065 into main Jun 16, 2026
7 checks passed
@gulshngill gulshngill deleted the feat/perp-screener-new-filters branch June 16, 2026 12:42
@github-actions github-actions Bot mentioned this pull request Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants