[feature] Improve advanced swap queue scoring and sorting
Summary
Two improvements to the advanced swap queue:
-
Score based on sub-swap size: Streaming swaps are now scored based on their next sub-swap size instead of total deposit, ensuring fair queue prioritization
-
Sort limit swaps before market swaps: Limit swaps are prioritized over market swaps while preserving score-based ordering within each type group
Changes
-
x/thorchain/manager_adv_swap_queue_current.go: UpdatedscoreMsgs()to useNextSize()for streaming swap scoring -
x/thorchain/manager_swap_queue.go: Added type-based sorting inSort()method -
x/thorchain/manager_adv_swap_queue_current_test.go: Added 4 new tests
Testing
- All existing unit tests pass
- Added new tests:
TestScoreMsgsUsesSubSwapSizeTestScoreMsgsPartiallyExecutedStreamingSwapTestLimitSwapsSortedBeforeMarketSwapsTestLimitSwapsPreserveScoreOrderWithinType