undo whitespace changes
This commit is contained in:
parent
0b99ea8641
commit
806be41826
|
@ -485,11 +485,11 @@ impl Rebalancer {
|
||||||
};
|
};
|
||||||
|
|
||||||
let Ok(dust_threshold) = dust_threshold_res
|
let Ok(dust_threshold) = dust_threshold_res
|
||||||
else {
|
else {
|
||||||
let e = dust_threshold_res.unwrap_err();
|
let e = dust_threshold_res.unwrap_err();
|
||||||
error!("Cannot rebalance token {}, probably missing USDC market ? - error: {}", token.name, e);
|
error!("Cannot rebalance token {}, probably missing USDC market ? - error: {}", token.name, e);
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Some rebalancing can actually change non-USDC positions (rebalancing to SOL)
|
// Some rebalancing can actually change non-USDC positions (rebalancing to SOL)
|
||||||
// So re-fetch the current token position amount
|
// So re-fetch the current token position amount
|
||||||
|
@ -739,9 +739,9 @@ impl Rebalancer {
|
||||||
quote: &TokenContext,
|
quote: &TokenContext,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let Ok(open_orders) = account.serum3_orders(*market_index).map(|x| x.open_orders)
|
let Ok(open_orders) = account.serum3_orders(*market_index).map(|x| x.open_orders)
|
||||||
else {
|
else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
||||||
let oo_acc = self.account_fetcher.fetch_raw(&open_orders)?;
|
let oo_acc = self.account_fetcher.fetch_raw(&open_orders)?;
|
||||||
let oo = serum3_cpi::load_open_orders_bytes(oo_acc.data())?;
|
let oo = serum3_cpi::load_open_orders_bytes(oo_acc.data())?;
|
||||||
|
@ -843,13 +843,13 @@ impl Rebalancer {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(
|
#[instrument(
|
||||||
skip_all,
|
skip_all,
|
||||||
fields(
|
fields(
|
||||||
perp_market_name = perp.name,
|
perp_market_name = perp.name,
|
||||||
base_lots = perp_position.base_position_lots(),
|
base_lots = perp_position.base_position_lots(),
|
||||||
effective_lots = perp_position.effective_base_position_lots(),
|
effective_lots = perp_position.effective_base_position_lots(),
|
||||||
quote_native = %perp_position.quote_position_native()
|
quote_native = %perp_position.quote_position_native()
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
async fn rebalance_perp(
|
async fn rebalance_perp(
|
||||||
&self,
|
&self,
|
||||||
|
|
Loading…
Reference in New Issue