-
Notifications
You must be signed in to change notification settings - Fork 260
"maker only" mode for buysell #34
Comments
The behavior you describe of not matching any existing orders is already accomplished to the extent possible by the staticSpreadLevelProvider; the bot's order levels are offset from the center price based on the config settings, up and down for sell and buy respectively. By definition, there are no buy offers higher than the center price and no sell offers lower than the center price, hence checking the individual offers is not necessary. What it does not do is prevent your order from filling another order that arrives between when the bot checks the center price and when the bot's orders are placed. Another check of the orderbook would not help; another trader's order could still arrive between your book check and your order's arrival. Which is the main purpose of a maker-only order on a centralized exchange. This feature is not supported by the Stellar protocol itself, see the market guide. |
@jimdanz this is a good feature request. We can do this at the framework level to support all strategies and take this input as a command line param to the bot's Before placing any orders (submitting to the DEX) we can "delete" any orders (manageOffer operations, really) that will cross the existing orderbook. This can be done by querying the orderbook to find the intersection between the existing orders and the orders you intend on placing. Is the proposed approach a viable solution for you? @Reidmcc I think the center price in the staticSpreadLevelProvider would be taken from a priceFeed, not from the DEX itself, so it is likely to differ from the current state of the DEX's orderbook. |
@nikhilsaraf Right, and priceFeed calculates center price off of two |
@Reidmcc |
@nikhilsaraf Ah, misunderstanding on my part. Thanks. |
@nikhilsaraf thanks for taking a look here. Your proposed approach sounds great, and I'm very bullish on it being at the framework level. As a small matter of personal preference, I think it'd be easier to manage if the flag was set in strategy.cfg rather than as a command-line argument. One concrete reason I say that is that down the line, "maker only" may want to evolve into a parameter that you can tune rather than something you have to be absolute about (eg you might have a tolerance where you're willing to place orders that are up to 10% taker, rather than pure maker only). And also because for me ergonomically it's easier to keep track of changes in the version-controlled cfg file. |
@jimdanz yes, I think we can make it work by keeping it at the strategy config level -- will have to augment the interface for the strategy a little but I think it should be possible. Updated your original comment to include this in the specification section. this is something that I'll try to include in the December release (possibly November if things go quick) since I have a couple of pressing changes I'm actively working on. Is that something that would work for you? |
@nikhilsaraf sounds great -- thanks! I'll be eager to try it out once it's available. |
@nikhilsaraf With the orderbook checking code I added for my new strategy in hand, I think I could put this request together pretty easily (especially at a config file level). I don't want to get in the way of your plan if you already have the details in mind though. |
blocked on #97 which introduces the |
@jimdanz fyi, you can use this feature now once you check out the master branch. See the sample_trader.cfg file as an example. let me know if you run into any issues. |
Awesome!!! 💯 |
Desired Behavior
The bot should have a mode where it tries to only make orders that do not cross any existing orders (maker only orders).
Impact
This can help you avoid unnecessary wash trades if someone else is also market-making but your price feeds or preferences are causing you to place slightly different orders.
Feature Suggestion
Without the DEX protocol itself supporting maker-only orders, anything done in the bot will be a best effort. However, I believe that the basic flow is simply: each time re-evaluating orders to place:
References
Bots aimed at centralized exchanges will generally have this feature because centralized exchanges usually price maker vs. taker orders quite differently.
Example: https://github.com/DeviaVir/zenbot#strategies
Additional context
I believe this should be a flag/parameter for buysell. There's an argument that it could be its own strategy, but I think it's better as a parameter because it might apply to various different strategies (could apply to sell as well, maybe even to balanced).
Specification
(updated by @nikhilsaraf: flag should be optional and in the strategy config file but execution by the framework, augment the strategy interface to support this. This should be handled by either the framework or the exchange implementation but the framework can do the threading of the flag. For the SDEX implementation we can filter out orders by querying the orderbook to find and delete the intersection between existing orderbook and orders we want to create)
The text was updated successfully, but these errors were encountered: