Git Product home page Git Product logo

Comments (12)

jimdanz avatar jimdanz commented on June 19, 2024 1

Awesome!!! 💯
Very stoked to give this a try. Thanks @nikhilsaraf !

from kelp.

Reidmcc avatar Reidmcc commented on June 19, 2024

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.

from kelp.

nikhilsaraf avatar nikhilsaraf commented on June 19, 2024

@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 trade command.

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.

from kelp.

Reidmcc avatar Reidmcc commented on June 19, 2024

@nikhilsaraf Right, and priceFeed calculates center price off of two GetPrice() calls in GetCenterPrice(). Are the GetPrice() calls not pulling fresh data from the DEX during GetCenterPrice()? Or is the priceFeed generated long enough before staticSpreadLevelProvider runs that it's out of date?

from kelp.

nikhilsaraf avatar nikhilsaraf commented on June 19, 2024

@Reidmcc GetPrice() does not pull from the DEX :)
it pulls from data sources outside the DEX (such as coinmarketcap, kraken, binance, etc.)

from kelp.

Reidmcc avatar Reidmcc commented on June 19, 2024

@nikhilsaraf Ah, misunderstanding on my part. Thanks.

from kelp.

jimdanz avatar jimdanz commented on June 19, 2024

@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.

from kelp.

nikhilsaraf avatar nikhilsaraf commented on June 19, 2024

@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?

from kelp.

jimdanz avatar jimdanz commented on June 19, 2024

@nikhilsaraf sounds great -- thanks! I'll be eager to try it out once it's available.

from kelp.

Reidmcc avatar Reidmcc commented on June 19, 2024

@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.

from kelp.

nikhilsaraf avatar nikhilsaraf commented on June 19, 2024

blocked on #97 which introduces the GetOrderBook API method on sdex.go

from kelp.

nikhilsaraf avatar nikhilsaraf commented on June 19, 2024

@jimdanz fyi, you can use this feature now once you check out the master branch.
just add SUBMIT_MODE="maker_only" in the trader.cfg file.

See the sample_trader.cfg file as an example. let me know if you run into any issues.

from kelp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.