KOTH Specification doc Jan 2019

dexbot(46)
Published in
#dexbot
Words
409
Reading
2 min
Listen
Play
7y

1 Sat Bot - “King of the Hill” Specification
January 2019

I would like to create a bot that stays on top of the order book (closest to centre price) by beating any orders placed above mine by the smallest possible increment, it will also drop back if there is a gap as long as it is still the closest to centre price. There will also be some customisable parameters such as a range the bot works in (ie; max price the bot will buy at) and also customisable order sizes to compete with (ie; ignore dust orders). The bot will be one sided but you can choose to buy or sell (works with one asset only). You will be able to choose your order sizes which can be fixed or a percentage of balance.

Here I will give an example asset, market and settings:

The asset I want to buy is Bridge.BTC and the asset to sell is Open.BTC
The market is Open.BTC-Bridge.BTC
Balance is 1 BTC

I would like to place a buy order at 0.95 (which will give me 1.05 Bridge.BTC when filled), I dont mind getting a worse price but my limit is 0.99. I would like to stay closest to the centre price if any order is placed in front of me that is 10% of my order size (or greater).

Settings:

Order Size = Total balance (in this case 1 BTC)
Range = 0.95-0.99
Initial Order placement = 0.95 (could be in the middle of range)
Minimum Competing Order Size to consider = 10% of my order size

Here I shall attempt to describe the strategy in an “if & then” logic:

Order placed at 0.95

If: Competing order placed within range & higher than current order
Then: Check it is within competing order size limit
If: Too small
Then: Ignore
If: Within limits
Then: Replace my order at 0.000001 above competing order

(continues until top of range is hit)

If: Top of range is hit
Then: Do nothing, leave order where it is.
If: There is a gap below my order to the next order below and is within range
Then: Replace order 0.000001 above that order
If: There is a choice of dropping back within range or moving forward
Then: Move forward (toward centre price)
If: I get a partial or fully filled order
Then: Replace order
If: Any order is cancelled to be replaced
Then: Check balance to update order size

KOTH Specification doc Jan 2019 | Ecency