Enum.flat_map Workaround?

(Please note: Elixir/Ecto Experience Level: Begiiner)

iex(9)> results = HTTPoison.get!("https://api.wavesplatform.com/v0/pairs")      %HTTPoison.Response{                                             
  body: "{\"__type\":\"list\",\"data\":[{\"__type\":\"pair\",\"data\":{\"firstPrice\":0.00011026,\"lastPrice\":0.00010499,\"low\":0.0001048,\"high\":0.00011383,\"weightedAveragePrice\":0.000106971036782957,\"volume\":74509.8062083899,\"quoteVolume\":7.97039122060866,\"volumeWaves\":74509.8062083899,\"txsCount\":1328},\"amountAsset\":\"WAVES\",\"priceAsset\":\"8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":0.15765601,\"lastPrice\":0.22153331,\"low\":0.15500002,\"high\":0.24,\"weightedAveragePrice\":0.214157531515537,\"volume\":157842.540000001,\"quoteVolume\":33803.1687345425,\"volumeWaves\":33803.1687345425,\"txsCount\":5814},\"amountAsset\":\"3QvxP6YFBKpWJSMAfYtL8Niv8KmmKsnpb9uQwQpg8QN2\",\"priceAsset\":\"WAVES\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":207.41,\"lastPrice\":212.46478799,\"low\":198.51,\"high\":213.95513488,\"weightedAveragePrice\":206.493389969896,\"volume\":162.83528274,\"quoteVolume\":33624.4095396892,\"volumeWaves\":33624.4095396892,\"txsCount\":700},\"amountAsset\":\"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\"priceAsset\":\"WAVES\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":0.16002589,\"lastPrice\":0.170008,\"low\":0.15812475,\"high\":0.17780304,\"weightedAveragePrice\":0.168479063733717,\"volume\":105792.30179714,\"quoteVolume\":17823.7879570169,\"volumeWaves\":17823.7879570169,\"txsCount\":3499},\"amountAsset\":\"4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8\",\"priceAsset\":\"WAVES\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":0.02258058,\"lastPrice\":0.02237766,\"low\":0.02202483,\"high\":0.02274066,\"weightedAveragePrice\":0.0223420860092187,\"volume\":60.25300657,\"quoteVolume\":1.34617785510096,\"volumeWaves\":12584.507877888,\"txsCount\":225},\"amountAsset\":\"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\"priceAsset\":\"8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":0.99,\"lastPrice\":0.95,\"low\":0.93,\"high\":1.02,\"weightedAveragePrice\":0.963090809571169,\"volume\":11834.11770453,\"quoteVolume\":11397.3300006163,\"volumeWaves\":11834.11770453,\"txsCount\":205},\"amountAsset\":\"WAVES\",\"priceAsset\":\"Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":0.00518329,\"lastPrice\":0.00566829,\"low\":0.00448786,\"high\":0.00599983,\"weightedAveragePrice\":0.00534974048062616,\"volume\":1911281.97286964,\"quoteVolume\":10224.8625401517,\"volumeWaves\":10224.8625401517,\"txsCount\":452},\"amountAsset\":\"bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD\",\"priceAsset\":\"WAVES\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":0.13770998,\"lastPrice\":0.13800957,\"low\":0.136002,\"high\":0.14499976,\"weightedAveragePrice\":0.138947804944918,\"volume\":63667.4200000002,\"quoteVolume\":8846.44825550623,\"volumeWaves\":8846.44825550623,\"txsCount\":2739},\"amountAsset\":\"DHgwrRvVyqJsepd32YbBqUeDH4GJ1N984X8QoekjgH8J\",\"priceAsset\":\"WAVES\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":8997.99,\"lastPrice\":9000,\"low\":8800.01,\"high\":9149.99,\"weightedAveragePrice\":9049.38845425333,\"volume\":0.73014713,\"quoteVolume\":6607.3850081282,\"volumeWaves\":6860.60436094312,\"txsCount\":119},\"amountAsset\":\"8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS\",\"priceAsset\":\"Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":199,\"lastPrice\":202.49,\"low\":195.01,\"high\":203.5,\"weightedAveragePrice\":202.391495756358,\"volume\":31.41856356,\"quoteVolume\":6358.8500734246,\"volumeWaves\":6602.54465127331,\"txsCount\":70},\"amountAsset\":\"474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu\",\"priceAsset\":\"Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":62.89086962,\"lastPrice\":63.77798951,\"low\":60.70727777,\"high\":64.34844549,\"weightedAveragePrice\":62.6940058251126,\"volume\":103.38509285,\"quoteVolume\":6481.62561336771,\"volumeWaves\":6481.62561336771,\"txsCount\":236},\"amountAsset\":\"HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk\",\"priceAsset\":\"WAVES\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":1.1,\"lastPrice\":0.3,\"low\":0.3,\"high\":1.1,\"weightedAveragePrice\":0.924990638899287,\"volume\":6917.63960238,\"quoteVolume\":6398.75187548049,\"volumeWaves\":6398.75187548049,\"txsCount\":81},\"amountAsset\":\"3k6vM987VAEVKJdD1J9eaXB2qi48Q7iYTEct7g9DMmtv\",\"priceAsset\":\"WAVES\"},{\"__type\":\"pair\",\"data\":{\"firstPrice\":18,\"lastPrice\":19,\"low\":18" <> ...,
  headers: [
    {"Date", "Fri, 11 Oct 2019 01:04:07 GMT"},
    {"Content-Type", "application/json; charset=utf-8"},
    {"Transfer-Encoding", "chunked"},
    {"Connection", "keep-alive"},
    {"Set-Cookie",
     "__cfduid=d3375054f573d5d4ae085ad4e1639c8b11570755847; expires=Sat, 10-Oct-20 01:04:07 GMT; path=/; domain=.wavesplatform.com; HttpOnly"},
    {"vary", "Accept-Encoding"},
    {"vary", "Origin"},
    {"x-request-id", "68c30f5c-2d16-4141-8deb-bf90842acfe0"},
    {"x-cache-status", "EXPIRED"},
    {"Access-Control-Allow-Origin", "*"},
    {"Access-Control-Allow-Credentials", "true"},
    {"Access-Control-Allow-Methods", "PUT, GET, POST, OPTIONS"},
    {"Access-Control-Allow-Headers",
     "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization"},
    {"Strict-Transport-Security", "max-age=15724800; includeSubDomains"},
    {"CF-Cache-Status", "DYNAMIC"},
    {"Expect-CT",
     "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""},
    {"Server", "cloudflare"},
    {"CF-RAY", "523ceb0fd96cc7d5-DEN"}
  ],
  request: %HTTPoison.Request{
    body: "",
    headers: [],
    method: :get,
    options: [],
    params: %{},
    url: "https://api.wavesplatform.com/v0/pairs"
  },
  request_url: "https://api.wavesplatform.com/v0/pairs",
  status_code: 200
}
iex(10)> json_keys_into_atoms = Poison.decode!(results.body, keys: :atoms)      %{                                                                
  __type: "list", 
  data: [
    %{
      __type: "pair",
      amountAsset: "WAVES",
      data: %{
        firstPrice: 1.1026e-4,
        high: 1.1383e-4,
        lastPrice: 1.0499e-4,
        low: 1.048e-4,
        quoteVolume: 7.97039122060866,
        txsCount: 1328,
        volume: 74509.8062083899,
        volumeWaves: 74509.8062083899,
        weightedAveragePrice: 1.06971036782957e-4
      },
      priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
    },
    %{
      __type: "pair",
      amountAsset: "3QvxP6YFBKpWJSMAfYtL8Niv8KmmKsnpb9uQwQpg8QN2",
      data: %{
        firstPrice: 0.15765601,
        high: 0.24,
        lastPrice: 0.22153331,
        low: 0.15500002,
        quoteVolume: 33803.1687345425,
        txsCount: 5814,
        volume: 157842.540000001,
        volumeWaves: 33803.1687345425,
        weightedAveragePrice: 0.214157531515537
      },
      priceAsset: "WAVES" 
    },
    %{
      __type: "pair",
      amountAsset: "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
      data: %{
        firstPrice: 207.41,
        high: 213.95513488,
        lastPrice: 212.46478799,
        low: 198.51,
        quoteVolume: 33624.4095396892,
        txsCount: 700,
        volume: 162.83528274,
        volumeWaves: 33624.4095396892,
        weightedAveragePrice: 206.493389969896
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8",
      data: %{
        firstPrice: 0.16002589,
        high: 0.17780304,
        lastPrice: 0.170008,
        low: 0.15812475, 
        quoteVolume: 17823.7879570169,
        txsCount: 3499,
        volume: 105792.30179714,
        volumeWaves: 17823.7879570169,
        weightedAveragePrice: 0.168479063733717
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
      data: %{
        firstPrice: 0.02258058,
        high: 0.02274066,
        lastPrice: 0.02237766,
        low: 0.02202483,
        quoteVolume: 1.34617785510096,
        txsCount: 225,
        volume: 60.25300657,
        volumeWaves: 12584.507877888,
        weightedAveragePrice: 0.0223420860092187
      },
      priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
    },
    %{
      __type: "pair",
      amountAsset: "WAVES",
      data: %{
        firstPrice: 0.99,
        high: 1.02,
        lastPrice: 0.95,
        low: 0.93,
        quoteVolume: 11397.3300006163,
        txsCount: 205,
        volume: 11834.11770453,
        volumeWaves: 11834.11770453,
        weightedAveragePrice: 0.963090809571169
      },
      priceAsset: "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck"
    },
    %{
      __type: "pair",
      amountAsset: "bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD",
      data: %{
        firstPrice: 0.00518329,
        high: 0.00599983,
        lastPrice: 0.00566829,
        low: 0.00448786,
        quoteVolume: 10224.8625401517,
        txsCount: 452,
        volume: 1911281.97286964,
        volumeWaves: 10224.8625401517,
        weightedAveragePrice: 0.00534974048062616
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "DHgwrRvVyqJsepd32YbBqUeDH4GJ1N984X8QoekjgH8J",
      data: %{
        firstPrice: 0.13770998,
        high: 0.14499976,
        lastPrice: 0.13800957,
        low: 0.136002,
        quoteVolume: 8846.44825550623,
        txsCount: 2739,
        volume: 63667.4200000002,
        volumeWaves: 8846.44825550623,
        weightedAveragePrice: 0.138947804944918
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
      data: %{
        firstPrice: 8997.99,
        high: 9149.99,
        lastPrice: 9000,
        low: 8800.01,
        quoteVolume: 6607.3850081282,
        txsCount: 119,
        volume: 0.73014713,
        volumeWaves: 6860.60436094312,
        weightedAveragePrice: 9049.38845425333
      },
      priceAsset: "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck"
    },
    %{
      __type: "pair",
      amountAsset: "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
      data: %{
        firstPrice: 199,
        high: 203.5,
        lastPrice: 202.49,
        low: 195.01,
        quoteVolume: 6358.8500734246,
        txsCount: 70,
        volume: 31.41856356,
        volumeWaves: 6602.54465127331,
        weightedAveragePrice: 202.391495756358
      },
      priceAsset: "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck"
    },
    %{
      __type: "pair",
      amountAsset: "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk",
      data: %{
        firstPrice: 62.89086962,
        high: 64.34844549,
        lastPrice: 63.77798951,
        low: 60.70727777,
        quoteVolume: 6481.62561336771,
        txsCount: 236,
        volume: 103.38509285,
        volumeWaves: 6481.62561336771,
        weightedAveragePrice: 62.6940058251126
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "3k6vM987VAEVKJdD1J9eaXB2qi48Q7iYTEct7g9DMmtv",
      data: %{
        firstPrice: 1.1,
        high: 1.1,
        lastPrice: 0.3,
        low: 0.3,
        quoteVolume: 6398.75187548049,
        txsCount: 81,
        volume: 6917.63960238,
        volumeWaves: 6398.75187548049,
        weightedAveragePrice: 0.924990638899287 
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "GSFvcF6ycBfXwPJLLKMExRsHWnvVdZQFHtGiYu4A2kZP",
      data: %{
        firstPrice: 18,
        high: 19,
        lastPrice: 19,
        low: 18,
        quoteVolume: 55820,
        txsCount: 2,
        volume: 3100,
        volumeWaves: 6140.2,
        weightedAveragePrice: 18.0064516129032
      },
      priceAsset: "5f1txDysSx2fVDjgXMdNpuprpdgXKjoHPtebL3SrMGzE"
    },
    %{
      __type: "pair",
      amountAsset: "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8",
      data: %{
        firstPrice: 1.717e-5,
        high: 1.959e-5,
        lastPrice: 1.704e-5,
        low: 1.61e-5,
        quoteVolume: 0.491020890123835,
        txsCount: 1752,
        volume: 27390.32552558,
        volumeWaves: 4590.2227826408,
        weightedAveragePrice: 1.79268000909762e-5
      },
      priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
    },
    %{
      __type: "pair",
      amountAsset: "EYz8Zvs62D4d7F5ZgXHCWuzuFaZg63FYnfVQrTWQoLSK", 
      data: %{
        firstPrice: 0.56969932,
        high: 0.5775,
        lastPrice: 0.57002529,
        low: 0.5625,
        quoteVolume: 3169.14150023681,
        txsCount: 936,
        volume: 5551.65379999999,
        volumeWaves: 3169.14150023681,
        weightedAveragePrice: 0.570846384592068 
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "B3uGHFRpSUuGEDWjqB9LWWxafQj8VTvpMucEyoxzws5H",
      data: %{
        firstPrice: 77,
        high: 80.89777459,
        lastPrice: 80.89777459,
        low: 74.06121095,
        quoteVolume: 2940.01879828528,
        txsCount: 172,
        volume: 37.78763376,
        volumeWaves: 2940.01879828528,
        weightedAveragePrice: 77.8037285149469
      },
      priceAsset: "WAVES" 
    },
    %{
      __type: "pair",
      amountAsset: "DCveqdzoQG1h6ED28UsdHaegweRx9RMcPxLH2tzpTbCG",
      data: %{
        firstPrice: 1.0955e-4,
        high: 1.0959e-4,
        lastPrice: 1.0959e-4,
        low: 1.0955e-4,
        quoteVolume: 0.291925891753,
        txsCount: 4,
        volume: 2664.2567,
        volumeWaves: 2729.01806444407,
        weightedAveragePrice: 1.09571233039594e-4
      },
      priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
    },
    %{
      __type: "pair",
      amountAsset: "EdDvbhk4wJ1kL6pMCq1V36GbQE2nGE7Metb87zbaY2JL",
      data: %{
        firstPrice: 1501,
        high: 1750,
        lastPrice: 1750,
        low: 1499.99999999,
        quoteVolume: 2527.59499990864,
        txsCount: 14,
        volume: 1.5535,
        volumeWaves: 2527.59499990864,
        weightedAveragePrice: 1627.0325071829
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk",
      data: %{
        firstPrice: 0.00690594,
        high: 0.00694493,
        lastPrice: 0.00670825,
        low: 0.00670806,
        quoteVolume: 0.260717473404344,
        txsCount: 110,
        volume: 38.14271636,
        volumeWaves: 2437.27163207119,
        weightedAveragePrice: 0.0068353147936196
      },
      priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
    },
    %{
      __type: "pair",
      amountAsset: "5WvPKSJXzVE2orvbkJ8wsQmmQKqTv9sGBPksV4adViw3",
      data: %{
        firstPrice: 0.00670577,
        high: 0.00674134,
        lastPrice: 0.00647507,
        low: 0.00645989,
        quoteVolume: 0.253438532180282,
        txsCount: 77,
        volume: 38.33075652,
        volumeWaves: 2369.22572503907,
        weightedAveragePrice: 0.00661188442884095
      },
      priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
    },
    %{
      __type: "pair",
      amountAsset: "GSFvcF6ycBfXwPJLLKMExRsHWnvVdZQFHtGiYu4A2kZP",
      data: %{
        firstPrice: 9.5,
        high: 10,
        lastPrice: 10,
        low: 9.5,
        quoteVolume: 14850,
        txsCount: 2, 
        volume: 1550,
        volumeWaves: 1633.5,
        weightedAveragePrice: 9.58064516129032
      },
      priceAsset: "FP2rjWYBQfqBpdLCDBaZvCtzikMozEyDbxsKyaWA76oB"
    },
    %{
      __type: "pair",
      amountAsset: "7x5Efh41w4k2Q2ikxHQtAa9uR91qnmGQMVkqcb2SPfde",
      data: %{ 
        firstPrice: 1.2e-5,
        high: 1.2e-5,
        lastPrice: 9.01e-6,
        low: 8.0e-6,
        quoteVolume: 1549.8450033626,
        txsCount: 4, 
        volume: 144835275.993,
        volumeWaves: 1549.8450033626,
        weightedAveragePrice: 1.07007425693552e-5
      },
      priceAsset: "WAVES"
    },
    %{
      __type: "pair",
      amountAsset: "5WvPKSJXzVE2orvbkJ8wsQmmQKqTv9sGBPksV4adViw3",
      data: %{
        firstPrice: 61.51458401,
        high: 62.01010243,
        lastPrice: 61.46624121,
        low: 58.8456866,
        quoteVolume: 1376.2805447267,
        txsCount: 98,
        volume: 22.77978031,
        volumeWaves: 1376.2805447267,
        weightedAveragePrice: 60.416761092403
      },
      priceAsset: "WAVES"
    }
}
iex(11)> volume_waves_greater_than_500 = Enum.filter(json_keys_into_atoms.data, fn pairs -> pairs.data.volumeWaves >= 500.0 end)
[
  %{
    __type: "pair",
    amountAsset: "WAVES",
    data: %{
      firstPrice: 1.1026e-4,
      high: 1.1383e-4,
      lastPrice: 1.0499e-4,
      low: 1.048e-4,
      quoteVolume: 7.97039122060866,
      txsCount: 1328,
      volume: 74509.8062083899,
      volumeWaves: 74509.8062083899,
      weightedAveragePrice: 1.06971036782957e-4
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "3QvxP6YFBKpWJSMAfYtL8Niv8KmmKsnpb9uQwQpg8QN2",
    data: %{
      firstPrice: 0.15765601,
      high: 0.24,
      lastPrice: 0.22153331,
      low: 0.15500002,
      quoteVolume: 33803.1687345425,
      txsCount: 5814,
      volume: 157842.540000001,
      volumeWaves: 33803.1687345425,
      weightedAveragePrice: 0.214157531515537
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
    data: %{
      firstPrice: 207.41,
      high: 213.95513488,
      lastPrice: 212.46478799,
      low: 198.51,
      quoteVolume: 33624.4095396892,
      txsCount: 700,
      volume: 162.83528274,
      volumeWaves: 33624.4095396892,
      weightedAveragePrice: 206.493389969896
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8",
    data: %{
      firstPrice: 0.16002589,
      high: 0.17780304,
      lastPrice: 0.170008,
      low: 0.15812475,
      quoteVolume: 17823.7879570169,
      txsCount: 3499,
      volume: 105792.30179714,
      volumeWaves: 17823.7879570169,
      weightedAveragePrice: 0.168479063733717
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
    data: %{
      firstPrice: 0.02258058,
      high: 0.02274066,
      lastPrice: 0.02237766,
      low: 0.02202483,
      quoteVolume: 1.34617785510096,
      txsCount: 225,
      volume: 60.25300657,
      volumeWaves: 12584.507877888,
      weightedAveragePrice: 0.0223420860092187
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "WAVES",
    data: %{
      firstPrice: 0.99,
      high: 1.02,
      lastPrice: 0.95,
      low: 0.93,
      quoteVolume: 11397.3300006163,
      txsCount: 205,
      volume: 11834.11770453,
      volumeWaves: 11834.11770453,
      weightedAveragePrice: 0.963090809571169
    },
    priceAsset: "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck"
  },
  %{
    __type: "pair",
    amountAsset: "bPWkA3MNyEr1TuDchWgdpqJZhGhfPXj7dJdr3qiW2kD",
    data: %{
      firstPrice: 0.00518329,
      high: 0.00599983, 
      lastPrice: 0.00566829,
      low: 0.00448786,
      quoteVolume: 10224.8625401517,
      txsCount: 452,
      volume: 1911281.97286964,
      volumeWaves: 10224.8625401517,
      weightedAveragePrice: 0.00534974048062616
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "DHgwrRvVyqJsepd32YbBqUeDH4GJ1N984X8QoekjgH8J",
    data: %{
      firstPrice: 0.13770998,
      high: 0.14499976,
      lastPrice: 0.13800957,
      low: 0.136002,
      quoteVolume: 8846.44825550623,
      txsCount: 2739,
      volume: 63667.4200000002,
      volumeWaves: 8846.44825550623,
      weightedAveragePrice: 0.138947804944918
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS",
    data: %{
      firstPrice: 8997.99,
      high: 9149.99,
      lastPrice: 9000,
      low: 8800.01,
      quoteVolume: 6607.3850081282,
      txsCount: 119,
      volume: 0.73014713,
      volumeWaves: 6860.60436094312,
      weightedAveragePrice: 9049.38845425333
    },
    priceAsset: "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck"
  },
  %{
    __type: "pair",
    amountAsset: "474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu",
    data: %{
      firstPrice: 199,
      high: 203.5,
      lastPrice: 202.49,
      low: 195.01,
      quoteVolume: 6358.8500734246,
      txsCount: 70,
      volume: 31.41856356,
      volumeWaves: 6602.54465127331,
      weightedAveragePrice: 202.391495756358
    },
    priceAsset: "Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck"
  },
  %{
    __type: "pair",
    amountAsset: "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk", 
    data: %{
      firstPrice: 62.89086962,
      high: 64.34844549,
      lastPrice: 63.77798951,
      low: 60.70727777,
      quoteVolume: 6481.62561336771,
      txsCount: 236,
      volume: 103.38509285,
      volumeWaves: 6481.62561336771,
      weightedAveragePrice: 62.6940058251126
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "3k6vM987VAEVKJdD1J9eaXB2qi48Q7iYTEct7g9DMmtv",
    data: %{
      firstPrice: 1.1,
      high: 1.1,
      lastPrice: 0.3,
      low: 0.3,
      quoteVolume: 6398.75187548049,
      txsCount: 81,
      volume: 6917.63960238,
      volumeWaves: 6398.75187548049,
      weightedAveragePrice: 0.924990638899287
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "GSFvcF6ycBfXwPJLLKMExRsHWnvVdZQFHtGiYu4A2kZP",
    data: %{
      firstPrice: 18,
      high: 19,
      lastPrice: 19,
      low: 18,
      quoteVolume: 55820,
      txsCount: 2,
      volume: 3100,
      volumeWaves: 6140.2,
      weightedAveragePrice: 18.0064516129032
    },
    priceAsset: "5f1txDysSx2fVDjgXMdNpuprpdgXKjoHPtebL3SrMGzE"
  },
  %{
    __type: "pair",
    amountAsset: "4LHHvYGNKJUg5hj65aGD5vgScvCBmLpdRFtjokvCjSL8",
    data: %{
      firstPrice: 1.717e-5,
      high: 1.959e-5,
      lastPrice: 1.704e-5,
      low: 1.61e-5,
      quoteVolume: 0.491020890123835,
      txsCount: 1752,
      volume: 27390.32552558,
      volumeWaves: 4590.2227826408,
      weightedAveragePrice: 1.79268000909762e-5
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "EYz8Zvs62D4d7F5ZgXHCWuzuFaZg63FYnfVQrTWQoLSK",
    data: %{
      firstPrice: 0.56969932,
      high: 0.5775,
      lastPrice: 0.57002529,
      low: 0.5625,
      quoteVolume: 3169.14150023681,
      txsCount: 936,
      volume: 5551.65379999999,
      volumeWaves: 3169.14150023681,
      weightedAveragePrice: 0.570846384592068
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "B3uGHFRpSUuGEDWjqB9LWWxafQj8VTvpMucEyoxzws5H",
    data: %{
      firstPrice: 77,
      high: 80.89777459,
      lastPrice: 80.89777459,
      low: 74.06121095,
      quoteVolume: 2940.01879828528,
      txsCount: 172,
      volume: 37.78763376,
      volumeWaves: 2940.01879828528,
      weightedAveragePrice: 77.8037285149469
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "DCveqdzoQG1h6ED28UsdHaegweRx9RMcPxLH2tzpTbCG",
    data: %{
      firstPrice: 1.0955e-4,
      high: 1.0959e-4,
      lastPrice: 1.0959e-4,
      low: 1.0955e-4,
      quoteVolume: 0.291925891753,
      txsCount: 4,
      volume: 2664.2567,
      volumeWaves: 2729.01806444407,
      weightedAveragePrice: 1.09571233039594e-4
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "EdDvbhk4wJ1kL6pMCq1V36GbQE2nGE7Metb87zbaY2JL",
    data: %{
      firstPrice: 1501,
      high: 1750,
      lastPrice: 1750,
      low: 1499.99999999,
      quoteVolume: 2527.59499990864,
      txsCount: 14,
      volume: 1.5535,
      volumeWaves: 2527.59499990864,
      weightedAveragePrice: 1627.0325071829
    }, 
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk",
    data: %{
      firstPrice: 0.00690594,
      high: 0.00694493,
      lastPrice: 0.00670825,
      low: 0.00670806,
      quoteVolume: 0.260717473404344,
      txsCount: 110,
      volume: 38.14271636,
      volumeWaves: 2437.27163207119,
      weightedAveragePrice: 0.0068353147936196
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "5WvPKSJXzVE2orvbkJ8wsQmmQKqTv9sGBPksV4adViw3",
    data: %{
      firstPrice: 0.00670577,
      high: 0.00674134,
      lastPrice: 0.00647507,
      low: 0.00645989,
      quoteVolume: 0.253438532180282,
      txsCount: 77, 
      volume: 38.33075652,
      volumeWaves: 2369.22572503907,
      weightedAveragePrice: 0.00661188442884095
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "GSFvcF6ycBfXwPJLLKMExRsHWnvVdZQFHtGiYu4A2kZP",
    data: %{ 
      firstPrice: 9.5,
      high: 10,
      lastPrice: 10,
      low: 9.5,
      quoteVolume: 14850,
      txsCount: 2,
      volume: 1550,
      volumeWaves: 1633.5,
      weightedAveragePrice: 9.58064516129032
    },
    priceAsset: "FP2rjWYBQfqBpdLCDBaZvCtzikMozEyDbxsKyaWA76oB"
  },
  %{
    __type: "pair",
    amountAsset: "7x5Efh41w4k2Q2ikxHQtAa9uR91qnmGQMVkqcb2SPfde",
    data: %{
      firstPrice: 1.2e-5,
      high: 1.2e-5,
      lastPrice: 9.01e-6,
      low: 8.0e-6,
      quoteVolume: 1549.8450033626,
      txsCount: 4,
      volume: 144835275.993,
      volumeWaves: 1549.8450033626,
      weightedAveragePrice: 1.07007425693552e-5
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "5WvPKSJXzVE2orvbkJ8wsQmmQKqTv9sGBPksV4adViw3",
    data: %{
      firstPrice: 61.51458401,
      high: 62.01010243,
      lastPrice: 61.46624121,
      low: 58.8456866,
      quoteVolume: 1376.2805447267,
      txsCount: 98,
      volume: 22.77978031,
      volumeWaves: 1376.2805447267,
      weightedAveragePrice: 60.416761092403
    },
    priceAsset: "WAVES"
  },
  %{
    __type: "pair",
    amountAsset: "B3uGHFRpSUuGEDWjqB9LWWxafQj8VTvpMucEyoxzws5H",
    data: %{
      firstPrice: 0.00861672,
      high: 0.00864451,
      lastPrice: 0.00846115,
      low: 0.00834637,
      quoteVolume: 0.107530102394846,
      txsCount: 52,
      volume: 12.76714001,
      volumeWaves: 1005.22632694515,
      weightedAveragePrice: 0.00842241115164568
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "EYz8Zvs62D4d7F5ZgXHCWuzuFaZg63FYnfVQrTWQoLSK",
    data: %{
      firstPrice: 6.323e-5,
      high: 6.449e-5,
      lastPrice: 6.016e-5,
      low: 5.939e-5,
      quoteVolume: 0.105659200611,
      txsCount: 88,
      volume: 1714.6867,
      volumeWaves: 987.736529331595,
      weightedAveragePrice: 6.16201202301272e-5
    },
    priceAsset: "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"
  },
  %{
    __type: "pair",
    amountAsset: "dACACFaoLaRMNGocg5aas4Md9aFP8jdAbLJvF5rqqrV",
    data: %{
      firstPrice: 6.04467741,
      high: 6.04467741,
      lastPrice: 6.04467741,
      low: 6.04467741,
      quoteVolume: 916.999999972398,
      txsCount: 1,
      volume: 151.70371184,
      volumeWaves: 916.999999972398,
      weightedAveragePrice: 6.04467741
    },
    priceAsset: "WAVES"
  }
]

Goal: To Repo.insert_all to the postgres table Asset_Pairs with amountAsset, priceAsset and lastPrice for each trading pair.

Here’s what I’ve got so far in preparation for this-

def save_to_db([_, Asset, _, _, Last, _, _, _, _, _, _, Priced], Asset_Pairs) do
	
	%{
	amountAsset: Asset,
	amountPrice: Priced,
	lastPrice: Last
	}
	
	end

Enum.flat_map(volume_waves_greater_than_500) won’t flatten this list of lists because it’s an arity 2 function. What arity 1 function can I use instead? If none exists, how do I go about flattening the results of volume_waves_greater_than_500 as quickly and efficiently as possible?

Finally, it’s my understanding that Repo.insert_all will itterate over the entire flattened list and enter each trading pair as an individual record into Asset_Pairs. Is this incorrect? If so, what is the recommended approach to achieve this?

Thank you all for your patience and wonderful guidance! :slight_smile:

Elixir is really good for data transformations and I think the following pattern should head you in the right direction:

# Pattern match to deconstruct the results of decoding
%{data: items} = Poison.decode!(results.body, keys: :atoms)
  
# Extract the data from each item then
# Filter the items with volumeWaves > 500
# And then do whatever action is required
items
|> Enum.map(&(&1.data))
|> Enum.filter(fn map -> map.volumeWaves > 500 end)
|> .....

You refer to flattening a list but in fact your list is flat - its a list of maps. If you mean to change that to some other form then you would use Enum.map/2 so perhaps

items
|> Enum.map(&(&1.data))
|> Enum.filter(fn map -> map.volumeWaves > 500 end)
|> Enum.map(&Map.to_list/1)

This is only intended as an example - I’m not really clear on what transformations you need into order to insert into your DB.

1 Like

Would replacing Enum with Stream in your example prevent looping through list three times? I ask since I’m trying to better understand how Stream works and this seems like a place where it could serve as a drop-in replacement.

Output:

[
  %{
    firstPrice: 29000,
    high: 290000,
    lastPrice: 290000,
    low: 29000,
    quoteVolume: 19.57036,
    txsCount: 2,
    volume: 6.842e-5,
    volumeWaves: 107546.719990209,
    weightedAveragePrice: 286032.738965215
  },
  %{
    firstPrice: 1.1243e-4,
    high: 1.1383e-4,
    lastPrice: 1.0511e-4,
    low: 1.048e-4,
    quoteVolume: 7.82311171050725,
    txsCount: 1135,
    volume: 73290.3596211601,
    volumeWaves: 73290.3596211601,
    weightedAveragePrice: 1.06741347033159e-4
  },
  %{
    firstPrice: 9000,
    high: 190001,
    lastPrice: 190001,
    low: 9000,
    quoteVolume: 8.28654349,
    txsCount: 2,
    volume: 4.609e-5,
    volumeWaves: 45537.7710172793,
    weightedAveragePrice: 179790.485788674
  },
  %{
    firstPrice: 0.15765601,
    high: 0.24999999,
    lastPrice: 0.2248,
    low: 0.15500002,
    quoteVolume: 36009.1049297078,
    txsCount: 6165,
    volume: 167006.72,
    volumeWaves: 36009.1049297078,
    weightedAveragePrice: 0.215614706580118
  },
  %{
    firstPrice: 201.25895842,
    high: 213.95513488,
    lastPrice: 212.6649167,
    low: 198.51,
    quoteVolume: 31599.2410891596,
    txsCount: 575,
    volume: 152.84636324, 
    volumeWaves: 31599.2410891596,
    weightedAveragePrice: 206.73858650822
  },
  %{
    firstPrice: 9900,
    high: 99900,
    lastPrice: 99900,
    low: 9900,
    quoteVolume: 4.752495,
    txsCount: 2,
    volume: 4.805e-5,
    volumeWaves: 26116.8036264979, 
    weightedAveragePrice: 98907.2840790843
  },
  %{
    firstPrice: 0.15812475,
    high: 0.17780304,
    lastPrice: 0.17599964,
    low: 0.15812475,
    quoteVolume: 15036.7003965736,
    txsCount: 2412,
    volume: 88368.0120364197,
    volumeWaves: 15036.7003965736,
    weightedAveragePrice: 0.170159993984887
  },
  %{
    firstPrice: 1,
    high: 1.02,
    lastPrice: 0.93,
    low: 0.93,
    quoteVolume: 11480.52000061,
    txsCount: 203,
    volume: 11923.90930793,
    volumeWaves: 11923.90930793,
    weightedAveragePrice: 0.962815105694814
  },
  %{
    firstPrice: 0.02253862,
    high: 0.02253862,
    lastPrice: 0.022332,
    low: 0.02202483,
    quoteVolume: 1.2327395483516,
    txsCount: 169,
    volume: 55.25617945,
    volumeWaves: 11548.8475891976,
    weightedAveragePrice: 0.0223095328092141
  },
  %{
    firstPrice: 0.00509418,
    high: 0.00599983,
    lastPrice: 0.00566116,
    low: 0.00448786,
    quoteVolume: 9871.37770879144,
    txsCount: 440,
    volume: 1841743.72271525,
    volumeWaves: 9871.37770879144,
    weightedAveragePrice: 0.00535979983916451
  },
  %{
    firstPrice: 0.13770998,
    high: 0.14499976,
    lastPrice: 0.13875369,
    low: 0.136002,
    quoteVolume: 8997.73146317455,
    txsCount: 2766,
    volume: 64699.2900000002,
    volumeWaves: 8997.73146317455,
    weightedAveragePrice: 0.139070018591773
  },
  %{
    firstPrice: 8821,
    high: 9149.99,
    lastPrice: 8800,
    low: 8800,
    quoteVolume: 6703.1548783436,
    txsCount: 117,
    volume: 0.74107493,
    volumeWaves: 6962.03750719748,
    weightedAveragePrice: 9045.17830382361
  },
  %{
    firstPrice: 199,
    high: 203.5,
    lastPrice: 198.01,
    low: 195.01,
    quoteVolume: 6398.5100745138,
    txsCount: 71,
    volume: 31.61885648,
    volumeWaves: 6645.62701256783,
    weightedAveragePrice: 202.363740717855
  },
  %{
    firstPrice: 1.1,
    high: 1.1,
    lastPrice: 0.888,
    low: 0.3,
    quoteVolume: 6487.64067548049,
    txsCount: 84,
    volume: 7017.73960238,
    volumeWaves: 6487.64067548049,
    weightedAveragePrice: 0.924463009895703
  },
  %{
    firstPrice: 18,
    high: 19,
    lastPrice: 19,
    low: 18,
    quoteVolume: 55820,
    txsCount: 2,
    volume: 3100,
    volumeWaves: 6140.2,
    weightedAveragePrice: 18.0064516129032
  },
  %{
    firstPrice: 61.61,
    high: 64.34844549,
    lastPrice: 63.97297726,
    low: 60.70727777,
    quoteVolume: 5540.58398960368,
    txsCount: 161,
    volume: 88.22613478,
    volumeWaves: 5540.58398960368,
    weightedAveragePrice: 62.799804201098
  },
  %{
    firstPrice: 1.61e-5,
    high: 1.959e-5,
    lastPrice: 1.815e-5,
    low: 1.61e-5,
    quoteVolume: 0.425720570107898,
    txsCount: 1471,
    volume: 23627.64857509,
    volumeWaves: 3988.33799591877,
    weightedAveragePrice: 1.80178983429068e-5
  },
  %{
    firstPrice: 0.57188,
    high: 0.5775,
    lastPrice: 0.5712268,
    low: 0.5625,
    quoteVolume: 3107.58337036444,
    txsCount: 906,
    volume: 5442.04420000001,
    volumeWaves: 3107.58337036444,
    weightedAveragePrice: 0.571032365074218
  },
  %{
    firstPrice: 1.0955e-4,
    high: 1.0959e-4,
    lastPrice: 1.0959e-4,
    low: 1.0955e-4,
    quoteVolume: 0.291925891753,
    txsCount: 4,
    volume: 2664.2567, 
    volumeWaves: 2734.89046060394,
    weightedAveragePrice: 1.09571233039594e-4
  },
  %{
    firstPrice: 76.14802268,
    high: 81.28339726,
    lastPrice: 80.75379814,
    low: 75.41664612,
    quoteVolume: 2581.09098757683,
    txsCount: 136,
    volume: 32.8932921,
    volumeWaves: 2581.09098757683,
    weightedAveragePrice: 78.4686123763463
  },
  %{
    firstPrice: 1501,
    high: 1750, 
    lastPrice: 1750,
    low: 1499.99999999,
    quoteVolume: 2527.76999990864,
    txsCount: 15,
    volume: 1.5536,
    volumeWaves: 2527.76999990864,
    weightedAveragePrice: 1627.0404221863
  },
  %{
    firstPrice: 0.00668484,
    high: 0.00674134,
    lastPrice: 0.00647507,
    low: 0.00645989,
    quoteVolume: 0.247600201670861,
    txsCount: 63,
    volume: 37.46021498,
    volumeWaves: 2319.62785324365,
    weightedAveragePrice: 0.00660968448267195
  },
  %{
    firstPrice: 0.00691798,
    high: 0.00691798,
    lastPrice: 0.00670766,
    low: 0.00670766,
    quoteVolume: 0.177761291463094,
    txsCount: 55,
    volume: 26.22248203,
    volumeWaves: 1665.34615127045,
    weightedAveragePrice: 0.00677896513608915
  },
  %{
    firstPrice: 9.5,
    high: 10,
    lastPrice: 10,
    low: 9.5,
    quoteVolume: 14850,
    txsCount: 2,
    volume: 1550,
    volumeWaves: 1633.5,
    weightedAveragePrice: 9.58064516129032
  },
  %{
    firstPrice: 59.81440384,
    high: 62.01010243,
    lastPrice: 61.46624121,
    low: 59.21028303,
    quoteVolume: 1195.43766551638, 
    txsCount: 65,
    volume: 19.78608355,
    volumeWaves: 1195.43766551638,
    weightedAveragePrice: 60.4181045983899
  },
  %{
    firstPrice: 0.00855338, 
    high: 0.00855475,
    lastPrice: 0.00849196,
    low: 0.00834637,
    quoteVolume: 0.107685431949877,
    txsCount: 46,
    volume: 12.79304105,
    volumeWaves: 1008.84460373565,
    weightedAveragePrice: 0.00841750069658981
  },
  %{
    firstPrice: 6.355e-5,
    high: 6.449e-5,
    lastPrice: 5.982e-5,
    low: 5.939e-5,
    quoteVolume: 0.106292870511,
    txsCount: 86,
    volume: 1733.7339,
    volumeWaves: 995.79847421244,
    weightedAveragePrice: 6.13086417188936e-5
  },
  %{
    firstPrice: 6.04467741,
    high: 6.04467741,
    lastPrice: 6.04467741,
    low: 6.04467741,
    quoteVolume: 916.999999972398,
    txsCount: 1,
    volume: 151.70371184,
    volumeWaves: 916.999999972398,
    weightedAveragePrice: 6.04467741
  },
  %{
    firstPrice: 7.0001e-4,
    high: 8.1988e-4,
    lastPrice: 7.111e-4,
    low: 6.5e-4,
    quoteVolume: 622.02592687722,
    txsCount: 109,
    volume: 814531.815996,
    volumeWaves: 622.02592687722,
    weightedAveragePrice: 7.63660687847551e-4
  },
  %{
    firstPrice: 249.6351317,
    high: 257.26153358,
    lastPrice: 256.206453,
    low: 247.08595473,
    quoteVolume: 611.095978702297,
    txsCount: 62,
    volume: 2.41637419,
    volumeWaves: 611.095978702297,
    weightedAveragePrice: 252.897908457753
  },
  %{
    firstPrice: 8.0e-6,
    high: 9.01e-6,
    lastPrice: 9.01e-6,
    low: 8.0e-6,
    quoteVolume: 549.8450033666,
    txsCount: 3,
    volume: 61501942.66,
    volumeWaves: 549.8450033666,
    weightedAveragePrice: 8.94028675494525e-6
  },
  %{
    firstPrice: 0.01,
    high: 0.01,
    lastPrice: 0.01,
    low: 0.01,
    quoteVolume: 515.29,
    txsCount: 12,
    volume: 51529, 
    volumeWaves: 535.191021570171,
    weightedAveragePrice: 0.01
  },
  %{
    firstPrice: 2.8e-4,
    high: 2.8e-4,
    lastPrice: 2.8e-4,
    low: 2.7e-4,
    quoteVolume: 0.0560932000046,
    txsCount: 3,
    volume: 206.18997753,
    volumeWaves: 525.505828469402,
    weightedAveragePrice: 2.72046200676454e-4
  }
]

Definitely a step in the right direction! :slight_smile:

Now, how do I recover amountAsset and priceAsset from the parent map?

Something like:

items 
|> Enum.map(&(&1.data |> Map.put(:amount_asset, &1.amountAsset) |> Map.put(:price_asset, &1.priceAsset)))
|> Enum.filter(fn map -> map.volumeWaves > 500 end)

Should do the trick.

Excellent!

(I had a heck of a time trying to figure out what the “&” operator meant but I think I figured it out . . . maybe, lol :slight_smile: )