My First Elixir Module: How Can I Make This Code Cleaner?

I don’t see any red flags but here are couple refactor suggestions: total_column_percent seems to be a temporary variable that can be replaced by pipe:

total_pyramid_percent = prices 
  |> calc_total_column_percent(initial_percent)
  |> total_pyramid_percent = calc_total_pyramid_percent()

similar issue with initial_price sorry missed it in the final function, this one is needed

total_distance = calc_total_distance(prices, h(prices))

and then I might move the map logic into another smaller function.

These changes are not critical but might reduce the “noice” and make things a bit simpler.