bmresearch / Solnet.Serum

Serum .NET integration library.
MIT License
35 stars 18 forks source link

[Bug] Field not found: 'Solnet.Programs.SystemProgram.SysVarRentKey'. When call NewOrderAsync #61

Closed khoangt closed 2 years ago

khoangt commented 2 years ago

Describe the bug Field not found: 'Solnet.Programs.SystemProgram.SysVarRentKey'. When call NewOrderAsync

To Reproduce Market market = await _serumClient.GetMarketAsync(AppInfo.Instance.UsdtUsdc.Address); _marketManager = MarketFactory.GetMarket( new PublicKey(AppInfo.Instance.UsdtUsdc.Address), _wallet.Account, SignRequest, serumClient: _serumClient); await _marketManager.InitAsync();

            OrderBookSide askOrderBookSide = await _serumClient.GetOrderBookSideAsync(market.Asks.Key);
            var ask = askOrderBookSide.GetOrders().Min(order => order.RawPrice) / AppInfo.Instance.UsdtUsdc.PriceDecimal;
            Order order = new OrderBuilder()
                .SetPrice((float)ask)
                .SetQuantity(5)
                .SetSide(Side.Buy)
                .SetOrderType(OrderType.Limit)
                .SetSelfTradeBehavior(SelfTradeBehavior.DecrementTake)
                .SetClientOrderId((ulong)DateTime.Now.Ticks)
                .Build();

            SignatureConfirmation sigConf = await _marketManager.NewOrderAsync(order);
hoakbuilds commented 2 years ago

Thanks for reporting this. I'll push a fix and bump Solnet version later today.

hoakbuilds commented 2 years ago

Released version 1.0.7 that bumps Solnet to 0.4.16 and fixes these issues