diff --git a/Examples/ai-friendly/01-shared-clients-quickstart.cs b/Examples/ai-friendly/01-shared-clients-quickstart.cs index c8ced227..458b2d3f 100644 --- a/Examples/ai-friendly/01-shared-clients-quickstart.cs +++ b/Examples/ai-friendly/01-shared-clients-quickstart.cs @@ -54,12 +54,12 @@ var sub2 = await okxTickerSocket.SubscribeToTickerUpdatesAsync( Console.WriteLine("Press Enter to exit"); Console.ReadLine(); -if (sub1.Success) await binanceTickerSocket.UnsubscribeAsync(sub1.Data); -if (sub2.Success) await okxTickerSocket.UnsubscribeAsync(sub2.Data); +if (sub1.Success) await sub1.Data.CloseAsync(); +if (sub2.Success) await sub2.Data.CloseAsync(); // Common variations: -// Add Bybit: ITickerRestClient bybit = new BybitRestClient().V5Api.SharedClient; -// Add Kraken: ITickerRestClient kraken = new KrakenRestClient().SpotApi.SharedClient; -// Add Coinbase: ITickerRestClient cb = new CoinbaseRestClient().AdvancedTradeApi.SharedClient; +// Add Bybit: ISpotTickerRestClient bybit = new BybitRestClient().V5Api.SharedClient; +// Add Kraken: ISpotTickerRestClient kraken = new KrakenRestClient().SpotApi.SharedClient; +// Add Coinbase: ISpotTickerRestClient cb = new CoinbaseRestClient().AdvancedTradeApi.SharedClient; // Other interfaces: ISpotOrderRestClient (place/cancel orders), IBalanceRestClient (balances), // IFuturesOrderRestClient, IPositionRestClient, IOrderBookSocketClient, etc. diff --git a/Examples/ai-friendly/02-multi-exchange-tickers.cs b/Examples/ai-friendly/02-multi-exchange-tickers.cs index 0e3da316..b0a8e61a 100644 --- a/Examples/ai-friendly/02-multi-exchange-tickers.cs +++ b/Examples/ai-friendly/02-multi-exchange-tickers.cs @@ -56,7 +56,7 @@ async Task FetchAsync(ISpotTickerRestClient client, SharedSymbo Exchange: client.Exchange, Symbol: result.Data.Symbol, LastPrice: result.Data.LastPrice ?? 0, - Volume: result.Data.Volume ?? 0); + Volume: result.Data.Volume); } record TickerSnapshot(string Exchange, string Symbol, decimal LastPrice, decimal Volume); diff --git a/Examples/ai-friendly/03-cross-exchange-arbitrage-skeleton.cs b/Examples/ai-friendly/03-cross-exchange-arbitrage-skeleton.cs index d1b9916a..1db5467d 100644 --- a/Examples/ai-friendly/03-cross-exchange-arbitrage-skeleton.cs +++ b/Examples/ai-friendly/03-cross-exchange-arbitrage-skeleton.cs @@ -89,13 +89,13 @@ async Task ScanSymbolAsync(SharedSymbol symbol, List clie async Task GetBookAsync(IBookTickerRestClient client, SharedSymbol symbol) { var result = await client.GetBookTickerAsync(new GetBookTickerRequest(symbol)); - if (!result.Success || result.Data?.BestBidPrice == null || result.Data.BestAskPrice == null) + if (!result.Success || result.Data == null) return null; return new Quote( Exchange: client.Exchange, - BidPrice: result.Data.BestBidPrice.Value, - AskPrice: result.Data.BestAskPrice.Value); + BidPrice: result.Data.BestBidPrice, + AskPrice: result.Data.BestAskPrice); } record Quote(string Exchange, decimal BidPrice, decimal AskPrice); @@ -107,6 +107,6 @@ record Quote(string Exchange, decimal BidPrice, decimal AskPrice); // ✓ Track inventory on both venues — can't sell what you don't have // ✓ Account for withdrawal delays if rebalancing inventory // ✓ Set hard P&L stops, position limits, maximum exposure per pair -// ✓ Use ISpotOrderRestClient with reduce-only / IOC order types for atomic execution +// ✓ Use ISpotOrderRestClient with exchange-supported IOC/fill-or-kill order options where available // ✓ Monitor connection health and have failover logic // ✓ Log everything — arbitrage P&L analysis requires complete audit trails