[bisq-network/bisq-docs] Produce the simplest-possible getting started guide for the Bisq HTTP API (#54)

Bernard Labno notifications at github.com
Wed May 23 07:20:29 UTC 2018


blabno commented on this pull request.



> +
+The `getPriceFilter` function creates the actual filter function and looks like this:
+
+[source,javascript]
+----
+function getPriceFilter(marketPrice) {
+    const maxPrice = marketPrice * (1 - threshold) * 10000;
+    return offer => {
+        if (offer.useMarketBasedPrice)
+            return offer.marketPriceMargin >= threshold;
+        return offer.price < maxPrice;
+    }
+}
+----
+
+We are multiplying `marketPrice` by `10000` because that is the format in which the API returns the price.

done

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq-docs/pull/54#discussion_r190144652
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20180523/0943a203/attachment-0002.html>


More information about the github mailing list