Skip to content

Commit e8d39c9

Browse files
committed
Add sorting active options positions by expiry time
1 parent 904d9c3 commit e8d39c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/cli-client/src/cli/positions.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,10 @@ async fn build_active_options_displays(
486486
btc_price: Option<f64>,
487487
) -> Vec<ActiveOptionsDisplay> {
488488
let now = current_timestamp();
489-
let contract_states = fetch_active_contract_states(wallet, option_tokens, grantor_tokens, network, now).await;
489+
let mut contract_states = fetch_active_contract_states(wallet, option_tokens, grantor_tokens, network, now).await;
490490

491+
contract_states.sort_by_key(|state| state.expiry_time());
492+
491493
contract_states
492494
.into_iter()
493495
.enumerate()

0 commit comments

Comments
 (0)