 (defn pick-winner-and-second-price [floor-price resps]
   ;; TODO: second price
   (->> resps
+       ;; shuffle
+       ;; sort
+       ;; take2
        (argmaxes-and-second floor-price :bidPrice)
        ;; branch the size of maxes
        (rand-nth)))

(ns s7p.core
  (:require [clojure.data.json :as json]
            [org.httpkit.client :as http]
            [core.async :refer [go]]))

(def options {:timeout 100
              :keepalive 3000})

   :user "user-1"
   :test 1})

(defn validate [{:keys [status body error]}]
  ;; FIXME: implement
  (and
   (= status 200)
   ;; TODO: treat 204 and the others

   (:id body)
   ;; and string

   (:bidPrice body)
   ;; and double

   (:advertiserId body)
   ;; and string

   )
  {:valid body}
  )

(defn succeed? [res]
  ;; FIXME: implement
  {:valid res}
  true
  )

