List with nested maps - Part Deux

I think your main conceptual problem is trying to destructure a map in more of a Javascript way rather than pattern matching in an Elixir way. You could use pattern matching here, though I find it less readable than my previous example:

Enum.map(items, fn %{amountAsset: asset, priceAsset: priced_in, data: %{lastPrice: last, volumeWaves: volume}} ->
  %{asset: asset, priced_in: priced_in, last: last, volume: volume}
end)
2 Likes