Skip to content

--ascending flag has no counterpart; sort defaults to ascending with no way to sort descending #17

Open

Description

@alan-purring

Summary

The markets list and events list commands sort results in ascending order by default. The --ascending flag exists but only reinforces ascending — there is no --descending flag or way to reverse the sort direction.

The help text implies descending should be the default ("Sort ascending instead of descending"), but results are always ascending regardless of whether --ascending is passed.

Steps to reproduce

# Without --ascending flag (should default to descending per help text)
polymarket markets list --active true --order volume --limit 5

# Returns markets with $0.00 volume (ascending order)

# With --ascending flag (no difference)
polymarket markets list --active true --order volume --limit 5 --ascending

# Same result — still ascending

Expected behavior

  • Default sort direction should be descending (as the help text implies)
  • Or: add a --descending flag to allow explicit control

Actual behavior

Sort is always ascending. The --ascending flag is a no-op since ascending is already the default. There is no way to retrieve e.g. the highest-volume markets without fetching a large result set and sorting client-side.

Workaround

polymarket -o json markets list --active true --order volume --limit 100 | \
  jq 'sort_by(.volume | gsub("[^0-9.]";"" ) | tonumber) | reverse | .[:10]'

Environment

  • polymarket v0.1.4 (Homebrew, macOS arm64)

Activity

  1. added a commit that references this issue on Mar 1, 2026
    d8e4636
  2. added a commit that references this issue on Mar 10, 2026
    b6da0e5
  3. mvanhorn commented on Mar 10, 2026

    @mvanhorn

    I've submitted a fix for this in PR #43. Changed all list commands to use maybe_ascending() so the parameter is only sent when --ascending is explicitly passed, letting the API default to descending sort.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions