// First check for expiring_at
ensure!(position.expiring_at.is_some(), ContractError::Unauthorized);

// Second check which includes the same is_some() check
ensure!(
    position.is_expired(current_time),
    ContractError::PositionNotExpired
);
pub fn is_expired(&self, current_time: u64) -> bool {
    self.expiring_at.is_some() && self.expiring_at.unwrap() <= current_time
}
ensure!(
    position.is_expired(current_time),
    ContractError::PositionNotExpired
);
