GithubHelp home page GithubHelp logo

Comments (12)

mschneider avatar mschneider commented on June 30, 2024

It’s probable that the value of anchor integrations could be unlocked by a simple cpi library that simplifies interacting with mango similar to how serum is integrated

from mango-v3.

dafyddd avatar dafyddd commented on June 30, 2024

I agree scrolling across all these lines is a bit cumbersome. At this point I just have to use ctrl f for everything. But one advantage of current setup is simplicity and logic. Every instruction has an equivalent function in processor.rs. A refactor that would continue to be simple and logical would be nice if you can think of one.

Do you know all the drawbacks of going to Anchor? It would be useful to even just see the difference in execution speed

Tests were started by another dev who didn't see it all the way through. I think we ultimately moved on to testing in devnet because it takes just as much time and seems more realistic. If you could clean up the tests we could start using it again. By clean up I mean removing unnecessary files and making sure all instructions are hit and it's relatively fast to run the tests.

from mango-v3.

ckamm avatar ckamm commented on June 30, 2024

Something I just came across was that some function signatures involving AccountInfo (like pub fn init_vals(..., open_orders_ais: &[AccountInfo; MAX_PAIRS]) in HealthCache) make mango logic unnecessarily hard to reuse externally.

The reason is that AccountInfos contain mut references and can sometimes be impossible to create without extra copies. Refactoring to parse these accounts outside and then only feeding in the results would simplify that a lot. I'll probably do that directly since it makes my current project easier.

from mango-v3.

dafyddd avatar dafyddd commented on June 30, 2024

@ckamm Interesting point. I believe it's the way it is right now because a lot of those AccountInfo objects are actually of the zero key. The new way of passing these in is to use Option<&OpenOrders> or a Vec of the same. But older code required users to just pass in all the open orders accounts in a big array and leave zero key for the ones not in margin basket. Just something to keep in mind when refactoring.

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

todo: cleanup branches which have been abandoned, not-relevant anymore

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

todo: some of the instructions dont have a corresponding helper instruction, useful for programs composing on top of mango, double check, and add missing ones

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

todo: something like anchor debug would be nice while developing tests, so that we dont have to manually print all the keys

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

ckamm: another thing for a cleanup/refactoring: passing these as arguments is error prone. It'd be nice if ChangeSpotMarketParams was a struct that could just be passed onwards to the executor function

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

dark green highlights are instructions which dont have a correponding test atm

image

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

whatever we do should take into account timeline for next protocol re-write, could be potential waste of effort

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

the problem with using one of the accounts not from parameters but from import confuses api users, unless one enables full debug logging its hard to know that the token program also has to be sent as a account info while cpi'ing
image

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on June 30, 2024

nice sdk like https://github.com/zetamarkets/fuze or spl-token sdk

from mango-v3.

Related Issues (16)

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.