robosats
robosats copied to clipboard
feat: Implement dynamic default sorting for offer book
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, thenpre-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.
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.