Placing Orders at the Best Price or with a Minimum Spread
Orders are placed either with a spread around the current price or at the best price if the spread exceeds the minimum set value.
In this example, the order price is determined as the average of three values:
The last market trade.
The best ask price.
The best bid price.
(
orderbook
().ask[0].price +
orderbook
().bid[0].price +
ticker
())/3
Orders are then placed either at the best price or with a 2% spread if the current spread is smaller.
The price increment is defined as (
order_pos
+ 1) * gap
for bids and (
order_pos
- 1) * gap
for asks, where gap is set to 0.5%.
Each order is placed for the equivalent of 20 counter tokens without increasing the volume for subsequent orders. To enable volume increments, replace 0 with the desired increment value.
20/
execute_price
+ 0 *
abs
(
order_pos
)/
execute_price
Last updated