Skip to content

fix(client): resolve closed markets for redeem#138

Merged
cesarenaldi merged 1 commit into
mainfrom
fix/dev-347-redeem-closed-markets
Jul 6, 2026
Merged

fix(client): resolve closed markets for redeem#138
cesarenaldi merged 1 commit into
mainfrom
fix/dev-347-redeem-closed-markets

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve market context for redeem calls with closed markets included.
  • Keep split and merge market lookups unchanged.
  • Update sync and async redeem workflow tests to assert closed-market lookup behavior.

Verification

  • uv run ruff format --check .
  • uv run ruff check .
  • uv run pyright
  • uv run pytest tests/unit/test_relayer_redeem_positions.py tests/unit/test_sync_relayer_workflows.py tests/unit/test_relayer_position_workflows.py -q
  • uv run pytest -q -m "not integration"

Notes

  • Full uv run pytest completed with one unrelated live sports stream integration failure: tests/integration/test_sports_stream.py::test_live_sports_stream_survives_past_heartbeat_stale_window.

Note

Medium Risk
Changes on-chain redeem transaction routing (adapter selection) for resolved markets; wrong lookup could still submit redeem to the wrong contract, but scope is narrow and covered by updated unit tests.

Overview
Market redeems now resolve Gamma market metadata with closed=True on list_markets, so settled markets are found instead of failing lookup when only open markets are returned by default.

_resolve_market_position_context gains an optional closed flag (async and sync secure clients) and forwards it to list_markets when set. Only redeem_positions passes closed=True; split, merge, and batch merge paths are unchanged.

Unit tests for async and sync redeem workflows were updated to expect closed: True in market lookup kwargs.

Reviewed by Cursor Bugbot for commit 205f989. Bugbot is set up for automated code reviews on this repo. Configure here.

@cesarenaldi cesarenaldi merged commit 58fc121 into main Jul 6, 2026
7 checks passed
@cesarenaldi cesarenaldi deleted the fix/dev-347-redeem-closed-markets branch July 6, 2026 12:20
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.

1 participant