From 24519e69921617d1f9639ef3e65a19539e640a78 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 17 Dec 2020 11:13:00 -0800 Subject: configurable maker prices --- config/samples/index.sample.js | 4 ++++ routes/swaps.js | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/samples/index.sample.js b/config/samples/index.sample.js index 9ab7f42a..aeda15c7 100644 --- a/config/samples/index.sample.js +++ b/config/samples/index.sample.js @@ -60,12 +60,16 @@ module.exports = { c2: cadasset, currency: "CAD". amount: 0.001, + askMultiplier: 1.01, + bidMultiplier: 0.99, }, { c1: btcasset, c2: usdtasset, currency: 'USD', amount: 0.001, + askMultiplier: 1.01, + bidMultiplier: 0.99, } ], } diff --git a/routes/swaps.js b/routes/swaps.js index feaa2ad2..f825ef55 100644 --- a/routes/swaps.js +++ b/routes/swaps.js @@ -756,7 +756,7 @@ app.post( ); if (config.maker) - config.maker.map(({ amount, c1, c2, currency }) => { + config.maker.map(({ amount, c1, c2, currency, askMultiplier, bidMultiplier }) => { setInterval(async () => { if (!app.get("rates")) return; @@ -798,7 +798,7 @@ if (config.maker) SATS * (((app.get("ask") * app.get("rates")[currency]) / app.get("rates")["USD"]) * - 1.01) + askMultiplier) ) }; @@ -881,7 +881,7 @@ if (config.maker) SATS * ((app.get("bid") * app.get("rates")[currency]) / app.get("rates")["USD"]) * - 0.99 + bidMultiplier ), v2: amount * SATS }; -- cgit v1.2.3