   require Logger
   alias Ecto.Adapters.SQL
   # @blocks_per_tick 100
-  @tick_duration 300_000
+  @tick_duration 30_000
   @lookback_max_blocks 201_600
 
   def start_link(args, options) do

    config = config
      |> Map.put_new(:starting_block, head_block)
      |> Map.put_new(:current_block, head_block)
    Process.send_after(self(), :next_blocks, 60_000)
    {:producer, config, dispatcher: GenStage.BroadcastDispatcher, buffer_size: 100_000}
  end


    delta = current_height - blocks
    if delta < 1, do: 1, else: delta
  end

  def handle_info(msg, state) do
    Logger.info("unexpected msg: #{inspect msg}")
  end
