Skip to content

Commit

Permalink
workers: temporarily debug ws messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Oct 21, 2023
1 parent 72a9ffb commit ad543ce
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions workers/price-reporter/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ impl PriceReporter {
loop {
if system_bus.has_listeners(&topic_name) {
if let PriceReporterState::Nominal(report) = self.get_state() {
if (self.base_token.clone(), self.quote_token.clone())
== (Token::from_ticker("WETH"), Token::from_ticker("USDC"))
{
log::info!(
"Median price update: {price}",
price = report.midpoint_price
);
}
system_bus.publish(
topic_name.clone(),
SystemBusMessage::PriceReportMedian(report),
Expand Down Expand Up @@ -394,6 +402,9 @@ impl ConnectionMuxer {
self.exchange_state
.new_price(exchange, price, ts);

if (self.base_token.clone(), self.quote_token.clone()) == (Token::from_ticker("WETH"), Token::from_ticker("USDC")) {
log::info!("Price update from {exchange}: {price}", exchange = exchange, price = price);
}
// Stream a price update to the bus
self.config.system_bus.publish(
price_report_topic_name(&exchange.to_string(), &self.base_token, &self.quote_token),
Expand Down

0 comments on commit ad543ce

Please sign in to comment.