Vertr.Exchange.Client.SignalR
1.0.0
dotnet add package Vertr.Exchange.Client.SignalR --version 1.0.0
NuGet\Install-Package Vertr.Exchange.Client.SignalR -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Vertr.Exchange.Client.SignalR" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Vertr.Exchange.Client.SignalR --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Vertr.Exchange.Client.SignalR, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Vertr.Exchange.Client.SignalR as a Cake Addin #addin nuget:?package=Vertr.Exchange.Client.SignalR&version=1.0.0 // Install Vertr.Exchange.Client.SignalR as a Cake Tool #tool nuget:?package=Vertr.Exchange.Client.SignalR&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
vertr-exchange
Simple NET Exchange Engine
Inspired by
Samples
Simple console app with embedded exchange engine
public static async Task Main()
{
var sp = ServicePorviderBuilder.BuildServiceProvider();
var idGen = sp.GetRequiredService<IOrderIdGenerator>();
var api = sp.GetRequiredService<IExchangeCommandsApi>();
// Add Symbols
api.Send(new AddSymbolsCommand(
orderId: idGen.NextId,
timestamp: DateTime.UtcNow,
Symbols.AllSymbolSpecs));
// Add Users and Accounts
api.Send(new AddAccountsCommand(
orderId: idGen.NextId,
timestamp: DateTime.UtcNow,
users: UserAccounts.All));
// Place ASK order
api.Send(new PlaceOrderCommand(
orderId: idGen.NextId,
timestamp: DateTime.UtcNow,
price: 120.45m,
size: 10,
action: OrderAction.ASK,
orderType: OrderType.GTC,
uid: Users.Alice.Id,
symbol: Symbols.MSFT.Id));
// Place BID order
api.Send(new PlaceOrderCommand(
orderId: idGen.NextId,
timestamp: DateTime.UtcNow,
price: 123.56m,
size: 7,
action: OrderAction.BID,
orderType: OrderType.GTC,
uid: Users.Bob.Id,
symbol: Symbols.MSFT.Id));
// wait to end processing
await Task.Delay(2000);
}
Console app communicating with Exchange host via SignalR
private static async Task PlaceAsk(IExchangeApiClient api, ILogger<Program> logger)
{
var askOrderId = await api.GetNextOrderId();
var askOrderResult = await api.PlaceOrder(
new PlaceOrderRequest
{
OrderId = askOrderId,
OrderType = OrderType.GTC,
Action = OrderAction.ASK,
UserId = Users.Alice.Id,
Price = NextRandomPrice(123),
Size = NextRandomQty(10),
Symbol = Symbols.MSFT.Id
});
logger.LogWarning("ASK order result: {orderResult}", askOrderResult);
}
private static async Task PlaceBid(IExchangeApiClient api, ILogger<Program> logger)
{
var bidOrderId = await api.GetNextOrderId();
var bidOrderResult = await api.PlaceOrder(
new PlaceOrderRequest
{
OrderId = bidOrderId,
OrderType = OrderType.GTC,
Action = OrderAction.BID,
UserId = Users.Bob.Id,
Price = NextRandomPrice(123),
Size = NextRandomQty(10),
Symbol = Symbols.MSFT.Id
});
logger.LogWarning("BID order result: {orderResult}", bidOrderResult);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- MediatR (>= 12.2.0)
- Microsoft.AspNetCore.SignalR.Client (>= 8.0.1)
- Microsoft.AspNetCore.SignalR.Protocols.MessagePack (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Vertr.Exchange.Contracts (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 139 | 1/28/2024 |
First release