mirror of
https://github.com/ZigZagExchange/zksync-lite-market-maker.git
synced 2025-12-17 07:04:23 +01:00
control how many orders to display on the UI
This commit is contained in:
18
README.md
18
README.md
@@ -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
|
||||
|
||||
|
||||
@@ -645,7 +645,7 @@ function indicateLiquidity (pairs = MM_CONFIG.pairs) {
|
||||
const maxSellSize = Math.min(baseBalance, mmConfig.maxSize);
|
||||
const maxBuySize = Math.min(quoteBalance / midPrice, mmConfig.maxSize);
|
||||
|
||||
const splits = 10;
|
||||
const splits = mmConfig.numOrdersIndicated || 10;
|
||||
const liquidity = [];
|
||||
for (let i=1; i <= splits; i++) {
|
||||
const buyPrice = midPrice * (1 - mmConfig.minSpread - (mmConfig.slippageRate * maxBuySize * i/splits));
|
||||
|
||||
Reference in New Issue
Block a user