Fix backfill freshness

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-03-14 12:47:52 +00:00
parent 0d276d537c
commit 8202255132
9 changed files with 101 additions and 74 deletions

View File

@@ -34,15 +34,13 @@ pub async fn check_account(config: &Arc<Config>) {
warn!("Account cash is zero, qrust will not be able to trade.");
}
warn!(
"qrust active on {} account with {} {}, avoid transferring funds without shutting down.",
info!(
"qrust running on {} account with {} {}, avoid transferring funds without shutting down.",
*ALPACA_API_BASE, account.currency, account.cash
);
}
pub async fn rehydrate_orders(config: &Arc<Config>) {
info!("Rehydrating order data.");
let mut orders = vec![];
let mut after = OffsetDateTime::UNIX_EPOCH;
@@ -77,13 +75,9 @@ pub async fn rehydrate_orders(config: &Arc<Config>) {
)
.await
.unwrap();
info!("Rehydrated order data.");
}
pub async fn rehydrate_positions(config: &Arc<Config>) {
info!("Rehydrating position data.");
let positions_future = async {
alpaca::positions::get(
&config.alpaca_client,
@@ -135,6 +129,4 @@ pub async fn rehydrate_positions(config: &Arc<Config>) {
position.symbol, position.qty
);
}
info!("Rehydrated position data.");
}