diff options
| author | Adam Soltys <[email protected]> | 2020-12-17 11:13:00 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-12-17 11:13:00 -0800 |
| commit | 24519e69921617d1f9639ef3e65a19539e640a78 (patch) | |
| tree | d51faba1545c3c3bee036eb2b7e54b8655b382b7 | |
| parent | 3e4537cff33a27282d4c8c326c8132b9298711eb (diff) | |
| download | coinos-server-24519e69921617d1f9639ef3e65a19539e640a78.tar.gz coinos-server-24519e69921617d1f9639ef3e65a19539e640a78.zip | |
configurable maker prices
| -rw-r--r-- | config/samples/index.sample.js | 4 | ||||
| -rw-r--r-- | 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 }; |
