Giter VIP home page Giter VIP logo

Comments (5)

nikhilsaraf avatar nikhilsaraf commented on August 30, 2024

@Reidmcc this is a good idea.
The change should probably be made in balancedLevelProvider.go

balancedLevelProvider can save (in memory) it's asset balances and the levels it returns from the GetLevels call. Anytime we call GetLevels it can first check if the asset balances have changed from what it has saved in memory:

  • if it has changed then it can recompute new levels
  • otherwise it can return the levels it has saved in memory.

This will be a pretty quick and simple code change.

The suggested approach will not consider amount tolerances since any balance change will trigger levels to be recomputed. Adjusting this to handle amount tolerances can be worked on as a separate issue which is a relatively small improvement over the suggested approach.

from kelp.

Reidmcc avatar Reidmcc commented on August 30, 2024

That makes sense. Do you have the code change planned out or shall I take a crack at it?

from kelp.

nikhilsaraf avatar nikhilsaraf commented on August 30, 2024

@Reidmcc The approach described above is what I had been thinking about for a while but never got to making the change. Would be great if you could take a crack at it!

from kelp.

Reidmcc avatar Reidmcc commented on August 30, 2024

Ok, will do.

from kelp.

nikhilsaraf avatar nikhilsaraf commented on August 30, 2024

@Reidmcc I've uploaded the fill tracking and handling logic, you can take a look at how that works for the mirror strategy as an example: https://github.com/interstellar/kelp/blob/master/plugins/mirrorStrategy.go#L312

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.