Coder Social home page Coder Social logo

solnet.mango's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

solnet.mango's Issues

Roadmap for Mango V4?

Hey - seems Mango V4 UI is now in open alpha, are there any plans for a Mango V4 client?

Implement new instructions

Mango v3.1 added advanced orders such as stop losses along with other instructions.

  • InitAdvancedOrders
  • AddPerpTriggerOrder
  • RemoveAdvancedOrder
  • ExecutePerpTriggerOrder
  • CloseMangoAccount
  • CloseAdvancedOrders
  • CancelPerpOrdersSide

See instruction code in ts lib and layout

[Bug] Cannot connect to devnet

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>()

Fix `GetUiMarketMarginAvailable` and `GetUiAvailableBalance`

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.

Add timeInForce and PlacePerpOrder2

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) 

Improve test suite

Test suite still needs improvements.

  • Add tests for remaining instructions (mainly related to advanced orders)
  • Add tests for streaming client parts

Having latest block hash already available at time of order submission

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.

Get List of all Markets with symbol

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.

Orderbook doesnt match between Subscribe event and website

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
image
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):

  • OS: Windows
  • Browser Edge

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.