robosats icon indicating copy to clipboard operation
robosats copied to clipboard

feat: Implement dynamic default sorting for offer book

Open FedericoLuque opened this issue 2 weeks ago • 1 comments

What does this PR do?

Fixes #2146

This PR implements dynamic default sorting for the offer book. Offers are now automatically sorted by their premium in a way that is most favorable to the user, depending on the selected offer type.

Specifically:

  • Buy & Swap In offers are sorted by premium in ascending order (lowest premium first).
  • Sell & Swap Out offers are sorted by premium in descending order (highest premium first).

Checklist before merging

  • [x] Install pre-commit and initialize it: pip install pre-commit, then pre-commit install. Pre-commit installs git hooks that automatically check the codebase. If pre-commit fails when you commit your changes, please fix the problems it points out.

FedericoLuque avatar Dec 08 '25 01:12 FedericoLuque

Hi @KoalaSat I thought that was the intended behavior. I've modified it so that if a user selects a different order, it's retained.

FedericoLuque avatar Dec 11 '25 23:12 FedericoLuque