control how many orders to display on the UI

This commit is contained in:
vixidev99
2022-03-02 15:18:05 +05:30
parent 49d35bbed9
commit 2ffe12fa99
2 changed files with 19 additions and 1 deletions

View File

@@ -177,6 +177,24 @@ Example:
} }
``` ```
###### numOrdersIndicated
On the UI, when indicating liquidity, by default will indicate the liquidity in 10 separate orders spaced evenly apart. To change the number of orders indicated, you can use the `numOrdersIndicated` setting.
Example:
```
"ETH-USDC": {
"mode": "pricefeed",
"side": "b",
"priceFeedPrimary": "cryptowatch:6631",
"priceFeedSecondary": "cryptowatch:588",
"slippageRate": 1e-5,
"maxSize": 100,
"minSize": 0.0003,
"minSpread": 0.0005,
"active": true,
"numOrdersIndicated": 5
}
```
## Pair Setting Examples ## Pair Setting Examples

View File

@@ -645,7 +645,7 @@ function indicateLiquidity (pairs = MM_CONFIG.pairs) {
const maxSellSize = Math.min(baseBalance, mmConfig.maxSize); const maxSellSize = Math.min(baseBalance, mmConfig.maxSize);
const maxBuySize = Math.min(quoteBalance / midPrice, mmConfig.maxSize); const maxBuySize = Math.min(quoteBalance / midPrice, mmConfig.maxSize);
const splits = 10; const splits = mmConfig.numOrdersIndicated || 10;
const liquidity = []; const liquidity = [];
for (let i=1; i <= splits; i++) { for (let i=1; i <= splits; i++) {
const buyPrice = midPrice * (1 - mmConfig.minSpread - (mmConfig.slippageRate * maxBuySize * i/splits)); const buyPrice = midPrice * (1 - mmConfig.minSpread - (mmConfig.slippageRate * maxBuySize * i/splits));