Add documentation to eth-gasstation-gas-price fn

This commit is contained in:
Vitaliy Vlasov 2018-04-03 11:06:18 +03:00
parent 56c067e5cf
commit 695aab317b
No known key found for this signature in database
GPG Key ID: A7D57C347F2B2964
1 changed files with 5 additions and 0 deletions

View File

@ -74,7 +74,12 @@
signed (TransactionEncoder/signMessage tx (creds))
hex-string (Numeric/toHexString signed)]
hex-string))
(defn eth-gasstation-gas-price
"Get max of average and average_calc from gas station and use that
as gas price. average_calc is computed from a larger time period than average,
so the idea is to account for both temporary dips (when average_calc > average)
and temporary rises (average_calc < average) of gas price"
[]
(let [data (json-api-request "https://ethgasstation.info/json/ethgasAPI.json")
avg-price (max