Coder Social home page Coder Social logo

Comments (6)

hoakbuilds avatar hoakbuilds commented on August 23, 2024

Hey @SpaceMonkeyForever, thanks for reporting this. The mango program implementation here is defaulting to MainNet and currently there's no way to switch to test/devnet despite changing the RpcClient cluster, we're working on making this a possibility in other program implementations in the main library and as soon as we have an intuitive way of doing this it will also be added here and to the Serum library.

from solnet.mango.

SpaceMonkeyForever avatar SpaceMonkeyForever commented on August 23, 2024

Thank you. I really appreciate your work on this. The only libraries available right now are the official TS client, mango-explorer (Python) and this client. C#/dotnet is a far better choice compared to those two other options, so I really hope I can use this client instead of having to use the Python client for now.

from solnet.mango.

hoakbuilds avatar hoakbuilds commented on August 23, 2024

Are you looking to use first on testnet/devnet and then migrating to mainnet usage? I could give you some pointers on how we're thinking about doing this if you'd like to help and maybe submit a PR.

I know there's also a few other issues in the lib wrt calculating account equity and some other things when there are several perps positions open and stuff (it messes up the math and I haven't really figured out where the bug is despite countless hours of debugging it).

from solnet.mango.

SpaceMonkeyForever avatar SpaceMonkeyForever commented on August 23, 2024

Yes, I have to test my idea on devnet first. To be honest, at the moment, I'm focused on getting the main logic done in Python as fast as possible as a prototype/PoC then I will work on rewriting it dotnet/Rust to make it robust. It would be fun to help you and submit a PR tho

from solnet.mango.

hoakbuilds avatar hoakbuilds commented on August 23, 2024

We were using the program classes as being static for pretty much everything, but recently in order to accomodate testnet and devnet we made some changes to Solnet by adding a BaseProgram class that all program implementations should subclass, and then you'd instantiate the program class by passing it the program id key of the program you want to use like this.

This way you would need to instantiate the program, yes, but you could do something like

var mangoProgram = new MangoProgram(MangoProgram.TestNetProgramIdKey)

to be able to do this, the library needs to undergo some refactoring because the instructions always refers to the static program id key for mango v3 as it is here. I know I abstracted it with the overloads but ideally that wouldn't be the case and you wouldn't need to pass in the program id because you have already instantiated the class for the specific program (and network) you want.

The same thing goes for the MangoClient, it's defaulting to use the mango v3 program id key from mainnet here, we should change this to take in the program id key on the client factory.

If you'd like to try to help with this do tell me, maybe I can give you some more pointers/ideas/snippets, and any question feel free to ask

from solnet.mango.

hoakbuilds avatar hoakbuilds commented on August 23, 2024

@SpaceMonkeyForever this issue has been resolved with the latest updates to the library, a lot of things were fixed (errors in health/equity calculations, bunch of decoding errors that were still hanging around etc), there were also new instructions added (some of these are still untested, like the ones for advanced orders) and you now have the ability to use this on devnet (a lot of the tests added by the test suite were done on devnet)

going to close this and ship v0.1 which is way more robust than it was previously, enjoy the fixes and if anything else comes up feel free to open an issue :)

from solnet.mango.

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.