SetNet.Marketplace
1.2.0
dotnet add package SetNet.Marketplace --version 1.2.0
NuGet\Install-Package SetNet.Marketplace -Version 1.2.0
<PackageReference Include="SetNet.Marketplace" Version="1.2.0" />
<PackageVersion Include="SetNet.Marketplace" Version="1.2.0" />
<PackageReference Include="SetNet.Marketplace" />
paket add SetNet.Marketplace --version 1.2.0
#r "nuget: SetNet.Marketplace, 1.2.0"
#:package SetNet.Marketplace@1.2.0
#addin nuget:?package=SetNet.Marketplace&version=1.2.0
#tool nuget:?package=SetNet.Marketplace&version=1.2.0
<p align="center"> <img src="https://raw.githubusercontent.com/Povstalez/SetNet/master/assets/icon.png" alt="SetNet" width="96"> </p>
SetNet.Marketplace
A continuous order-book marketplace for SetNet — like a stock exchange for your game economy.
Players post limit buy and sell orders; the server runs a double-sided order book per item with price-time priority. Crossing orders match instantly at the resting order's price and the remainder rests on the book — no timers, no per-item auctions. Items and currency are escrowed on post and moved through SetNet.Inventory / SetNet.Wallet, and a marketable order can only improve on its limit (the buyer is refunded the difference). Added by composition — no base class.
Install
dotnet add package SetNet
dotnet add package SetNet.Inventory
dotnet add package SetNet.Wallet
dotnet add package SetNet.Marketplace
Usage
Call InventoryRuntime.Enable(), WalletRuntime.Enable(), and MarketplaceRuntime.Enable() at startup.
// server
InventoryRuntime.Enable(); WalletRuntime.Enable(); MarketplaceRuntime.Enable();
var inventory = server.UseInventory();
var wallet = server.UseWallet();
server.UseMarketplace(inventory, wallet);
// client
InventoryRuntime.Enable(); WalletRuntime.Enable(); MarketplaceRuntime.Enable();
var market = client.UseMarketplace();
market.Filled += f => Toast($"{f.Side} {f.Quantity}× {f.ItemId} @ {f.Price}");
await market.PostSellAsync("iron_ore", quantity: 100, price: 5); // ask
await market.PostBuyAsync ("iron_ore", quantity: 40, price: 6); // bid — crosses, trades at 5, 5 refunded/unit
MarketBook book = await market.GetBookAsync("iron_ore"); // aggregated levels
foreach (var o in await market.MyOrdersAsync()) Show(o);
await market.CancelAsync(orderId);
API
Server: server.UseMarketplace(InventoryServer, WalletServer) → MarketplaceServer.
Client: client.UseMarketplace() → MarketplaceClient
| Member | Purpose |
|---|---|
Task<string> PostBuyAsync(itemId, quantity, price, currency = "gold") |
bid (escrows currency) |
Task<string> PostSellAsync(itemId, quantity, price, currency = "gold") |
ask (escrows items) |
Task CancelAsync(orderId) |
cancel + return remaining escrow |
Task<MarketBook> GetBookAsync(itemId, currency = "gold") |
aggregated bids/asks |
Task<IReadOnlyList<MarketOrder>> MyOrdersAsync() |
your open orders |
event Action<MarketFill> Filled |
one of your orders (partially) filled |
InventoryRuntime.Enable() + WalletRuntime.Enable() + MarketplaceRuntime.Enable() — one-time bootstrap.
Notes
- Rides the unified SetNet.Protocol messaging layer on the
Channels.Marketplacechannel (all modules share one envelope wire type,65447) — no per-module wire ids to reserve. Serializer-agnostic: the control protocol is hand-framedbyte[], your payloads use yourSetNetSerializer. - Price-time priority. Best price first, ties broken by who posted earlier. A trade executes at the resting order's price, so an incoming order never does worse than its limit; a buyer whose limit beats the ask is refunded the difference per unit.
- Escrow on post. A buy escrows
price × quantitycurrency; a sell escrowsquantityitems. Matching is decided under a per-book lock; the item/currency moves run afterward throughSetNet.Inventory/SetNet.Wallet— nothing is created or lost, and a cancel returns the remaining escrow. - Marketplace vs Auction vs Trade: Marketplace is a continuous many-to-many exchange (fungible goods, instant matching); Auction is timed bidding on one specific listing; Trade is a direct two-party swap. Use Marketplace for commodity economies.
- Node-local books. The book lives on the marketplace node; run one endpoint (or shard by item) so escrow stays consistent. Back
SetNet.Inventory/SetNet.Walletwith durable stores for persistence.
Documentation & source
- 🐙 https://github.com/Povstalez/SetNet — full catalog in docs/MODULES.md
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- SetNet (>= 1.2.0)
- SetNet.Inventory (>= 1.2.0)
- SetNet.Wallet (>= 1.2.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.2.0 | 90 | 8/5/2026 |