Vertr.Exchange.Contracts
1.0.0
dotnet add package Vertr.Exchange.Contracts --version 1.0.0
NuGet\Install-Package Vertr.Exchange.Contracts -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.Contracts" 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.Contracts --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Vertr.Exchange.Contracts, 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.Contracts as a Cake Addin #addin nuget:?package=Vertr.Exchange.Contracts&version=1.0.0 // Install Vertr.Exchange.Contracts as a Cake Tool #tool nuget:?package=Vertr.Exchange.Contracts&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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Vertr.Exchange.Contracts:
Package | Downloads |
---|---|
Vertr.Exchange.Client.SignalR
SignalR client package for Vertr Exchange Host |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 133 | 1/28/2024 |
First release