Comments (6)
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.
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.
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.
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.
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.
@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)
- Release v5.0.0 HOT 1
- Release v6.0.0 for net6
- Make pipeline .NET version agnostic
- Add timeInForce and PlacePerpOrder2 HOT 1
- Add missing `referrer_mango_account` on `PlacePerpOrder` HOT 1
- Add missing perp stats methods and example HOT 1
- Fix ids not being incldued in nupkg HOT 1
- Fix `LoadRootBanksAsync` not using inner asyncs HOT 1
- Add missing endpoints to `MangoHistoricalDataService` HOT 1
- Add cache instructions and update `GetPerpTrades` HOT 1
- Remove dead methods from PerpMarket and break `UiToNativePriceQuantity` into two methods HOT 1
- Get List of all Markets with symbol HOT 2
- Orderbook doesnt match between Subscribe event and website HOT 5
- Fix `GetUiMarketMarginAvailable` and `GetUiAvailableBalance` HOT 1
- Add `ConsumeEvents` instruction HOT 1
- Add Fills WebSocket Feed HOT 1
- Change `Deposit` writable accounts HOT 1
- Having latest block hash already available at time of order submission HOT 2
- Fix incorrect base url for candle history on historical service
- Roadmap for Mango V4?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solnet.mango.