pub async fn run(&mut self, mut stop_receiver: watch::Receiver<bool>) -> anyhow::Result<()> {
        let mut timer = tokio::time::interval(self.config.price_polling_interval);

        while !*stop_receiver.borrow_and_update() {
            tokio::select! {
                _ = timer.tick() => { /* continue iterations */ }
                _ = stop_receiver.changed() => break,
            }

            if let Err(err) = self.loop_iteration().await {
                tracing::warn!(
                    "Error in the base_token_ratio_persister loop interaction {}",
                    err
                );
                if self.config.halt_on_error {
                    return Err(err)
                        .context("Failed to execute a base_token_ratio_persister loop iteration");
                }
            }
        }

        tracing::info!("Stop request received, base_token_ratio_persister is shutting down");
        Ok(())
    }
Main loop for the base token ratio persister.
Orchestrates fetching a new ratio, persisting it, and conditionally updating the L1 with it.
core/node/base_token_adjuster/src/base_token_ratio_persister.rs