 
 
 (defn auction [floor-price resps]
-  (case  (count resps)
-    0 nil
-    1 (let [{dsp :dsp res :response} (first resps)
-            fp (or floor-price (:bidPrice res))]
-        {:dsp dsp :response res :win-price fp})
-    (let [[{dsp :dsp res :response} {win-price :response}]
-          (->> resps
-               (shuffle)
-               (sort-by (comp :bidPrice :response) >)
-               (take 2))]
-      {:dsp dsp :response res :win-price (:bidPrice win-price)})))
+  (let [floor-price (and floor-price (* 1000 floor-price))]
+   (case  (count resps)
+     0 nil
+     1 (let [{dsp :dsp res :response} (first resps)
+             fp (or floor-price (:bidPrice res))]
+         {:dsp dsp :response res :win-price (float (/ fp 1000))})
+     (let [[{dsp :dsp res :response} {win-price :response}]
+           (->> resps
+                (shuffle)
+                (sort-by (comp :bidPrice :response) >)
+                (take 2))]
+       {:dsp dsp :response res :win-price (float (/ (:bidPrice win-price) 1000))}))))
 
 (defn click? [result response]
   (result (.indexOf (map :id advertisers) (:advertiserId response))))

               (not bidPrice)
               {:status :invalid :reason "no bid price"}
               
               (not (instance? Double bidPrice))
               {:status :invalid :reason "bidPrice not double" :bidPrice bidPrice}
               
               (not (over-floor? (:floorPrice request) bidPrice))

   [com.fasterxml.jackson.core JsonParseException]))

(def options {:timeout 100
              :keepalive 3000
              :headers {"Content-Type" "application/json"}})

(defn json-request-option [hash]
  (assoc options :as :text :body (json/generate-string hash)))
