bmresearch / solnet.mango Goto Github PK
View Code? Open in Web Editor NEWMango Markets .NET integration library.
License: MIT License
Mango Markets .NET integration library.
License: MIT License
Hey - seems Mango V4 UI is now in open alpha, are there any plans for a Mango V4 client?
The instruction is missing the referrer's public key
Mango v3.1 added advanced orders such as stop losses along with other instructions.
See instruction code in ts lib and layout
To Reproduce
Pick any example like
https://github.com/bmresearch/Solnet.Mango/blob/master/Solnet.Mango.Examples/GetMangoAccountExample.cs
And switch MainNet to DevNet
Error message:
Unhandled exception. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Solnet.Mango.BaseClient.GetAccount[T](String accountAddress, Commitment commitment)
at Solnet.Mango.MangoClient.GetMangoGroupAsync(String account, Commitment commitment)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at Solnet.Mango.MangoClient.GetMangoGroup(String account, Commitment commitment)
at SimpleTrader.GetMangoAccountExample.Run() in D:\Code\Crypto\SimpleTrader\SimpleTrader\GetMangoAccountExample.cs:line 29
at SimpleTrader.Program.TestMango() in D:\Code\Crypto\SimpleTrader\SimpleTrader\Program.cs:line 31
at SimpleTrader.Program.Main() in D:\Code\Crypto\SimpleTrader\SimpleTrader\Program.cs:line 25
at SimpleTrader.Program.<Main>()
The PublicKey
attribute in the DecodedInstructions
is being incorrectly set to the devnet program id, see
GetUiAvailableBalance
is incorrectly using the quote token decimals to humanize the available balance, it should be using the decimals of the token that the balances refer to.
GetUiMarketMarginAvailable
is incorrectly using
I80F48.Zero - weight
as the divisor whereas it should be I80F48.One - weight
, this mistake incorrectly makes all available margins display as negative values.
Account Equity and Health Ratios are currently being incorrectly calculated.
Ideally we'd replicate this test suite from the typescript library in order to have the values match all existing client libraries.
Adds public byte TimeInForce
to LeafNode
To filter out invalid orders use
var ts = DateTime.UtcNow;
if(node.TimeInForce == 0 || ts < node.Timestamp + node.TimeInForce)
Test suite still needs improvements.
See instruction code in ts lib and layout
In all the examples I have seen so far, order submissions first requires making a request for the latest/recent block hash, eg here:
https://docs.mango.markets/development-resources/client-libraries#post-orders
This seems potentially inefficient. Is there a way to subscribe to latest block hash so it would be available at order submission time? I could create a task requesting it at a reasonable frequency, but not sure if that would be best practice.
Current Problem
While developing a seperate application, the User should only interact with symbols instead of market address.
Possible Solution
Parse all market info with address like serum provides.
Describe alternatives you've considered
I tried to look into the source code of mango ui (V3). Somewhere in the system, there must be a way to convert the Symbol name to market Name. But couldnt find a clear list of markets with symbols.
Docs here
Describe the bug
The orderbook obtainer from the mango website does not match with the example orderbook.
To Reproduce
Modify (fix) the market address of the subscribe orderbook example to Sol-Perp
(2TgaaVoHgnSeEtXvWTx13zQeTf4hYWAMEiMQdcG6EwHi).
Run the code and match it with trade.mango.markets.
I also tried to clone the UI project (mango-ui-v3) and modify the code to run on solana
=>stores/usemangostore.ts , endpointinfo (url,websocket) 'https://api.mainnet-beta.solana.com'
The UI project data matched with trade.mango.markets but the c# code (Both nuget library and source code example) orderbook does not match with web.
Expected behavior
The c# version shoud match orderbook. Multiple instance of the same c# app sometimes have different orderbook.
Screenshots
1 and 2 are the two instance of same example code. 3 is the state of orderbook from mango.
Desktop (please complete the following information):
The following dependencies have been updated:
The LoadRootBanksAsync
method isn't using LoadNodeBanksAsync
internally which causes freezes when using UI frameworks.
See method
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.