EasyTrading.Core 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package EasyTrading.Core --version 1.0.2
                    
NuGet\Install-Package EasyTrading.Core -Version 1.0.2
                    
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="EasyTrading.Core" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyTrading.Core" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="EasyTrading.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EasyTrading.Core --version 1.0.2
                    
#r "nuget: EasyTrading.Core, 1.0.2"
                    
#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.
#:package EasyTrading.Core@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EasyTrading.Core&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=EasyTrading.Core&version=1.0.2
                    
Install as a Cake Tool

EasyTrading

A .NET client for decentralised perpetual and spot exchanges. One IExchangeClient interface across every supported DEX; per-DEX clients add only what's venue-specific (e.g. vaults and staking on HyperLiquid).

NuGet Build License

Status

Exchange Package REST WebSocket Signing Latest
HyperLiquid EasyTrading.HyperLiquid 1.0.0
Aster EasyTrading.Aster reads only wip wip 1.1.0-alpha.1 (wip)
dYdX v4 EasyTrading.Dydx (planned)

HyperLiquid coverage at 1.0.0:

  • All Info (read) and Exchange (write) endpoints, including TWAP, scheduled cancel, sub-accounts, vaults, and staking.
  • EIP-712 L1 and user-signed actions; byte-identical msgpack encoding with the Python reference SDK.
  • WebSocket: 9 channels, per-subscriber back-pressure, automatic reconnect with exponential backoff.
  • Pre-flight order validation (tick / lot / min-notional) — invalid orders are rejected client-side.
  • REST retry policy with backoff + jitter, honours Retry-After on 429.
  • WebSocket gap recovery: on reconnect, user streams (MyFills / MyOrders / MyFundings) auto-fetch missed events via REST and deduplicate against the live feed.
  • 89 unit tests + 5 read-only integration tests against live mainnet, all green.

Install

dotnet add package EasyTrading.HyperLiquid

This pulls EasyTrading.Abstractions and EasyTrading.Core transitively.

Quick start

using EasyTrading.Abstractions;
using EasyTrading.HyperLiquid;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var host = Host.CreateApplicationBuilder(args);

host.Services
    .AddEasyTrading()
    .AddHyperLiquid(options =>
    {
        options.Network = HyperLiquidNetwork.Mainnet;
        options.Credentials = new HyperLiquidCredentials(
            masterAddress: "0xYourMasterAddress",
            privateKey:    Environment.GetEnvironmentVariable("HL_PRIVATE_KEY")!,
            agentName:     "easy-bot");
    });

using var app = host.Build();
var ex = app.Services.GetRequiredService<IHyperLiquidExchange>();

// Read (no signing needed)
var mids = await ex.Markets.GetAllMidsAsync();
var book = await ex.Markets.GetOrderBookAsync("BTC", depth: 20);

// Write (signed)
var placed = await ex.Orders.PlaceLimitAsync(
    symbol: "BTC", side: OrderSide.Buy,
    price:  60_000m, size: 0.01m,
    tif:    TimeInForce.Alo);

// Stream
await foreach (var trade in ex.Streams.TradesAsync("BTC", default))
    Console.WriteLine($"{trade.Trade.Price} {trade.Trade.Size}");

A more complete walk-through with credential setup, agent wallets, and testnet-first guidance lives in docs/getting-started.md. Common patterns are collected in docs/recipes.md.

API surface

Methods are grouped by entity. Everything about orders is on Orders; everything about positions is on Positions; and so on.

Group What it covers
Markets Symbols, order book, candles, mids, funding
Orders Place / modify / cancel / batch / TWAP / open / history
Positions Read positions, set leverage, add/reduce margin, close
Trades Your fills (by symbol, by order, by time)
Account Balances, fees, portfolio, sub-accounts, agents, rate limit
Transfers Withdraw, internal transfers, spot ↔ perp, sub-account moves
Streams WebSocket subscriptions (public + user) via IAsyncEnumerable
Vaults (HL only) Vault details, deposit, withdraw
Staking (HL only) Delegate / undelegate / rewards

Design notes

  • decimal everywhere for money — never double / float.
  • DTOs are immutable record types.
  • Async methods end with Async; CancellationToken ct = default is the last parameter on every method.
  • WebSocket subscriptions are IAsyncEnumerable<T> — iterate with await foreach and cancel by cancelling the token.
  • Optional venue features are gated by client.Capabilities.HasFlag(ExchangeCapabilities.X).
  • Typed exceptions only: RateLimitException, InsufficientFundsException, InvalidOrderException, AuthenticationException, SigningException, ExchangeApiException.

Roadmap

  • HyperLiquid — REST + WebSocket + EIP-712 signing + hardening → 1.0.0
  • Aster — EasyTrading.Aster (in progress: scaffold + Markets reads landed in 1.1.0-alpha.1; signed reads, writes via EIP-712, and WebSocket pending)
  • dYdX v4 — EasyTrading.Dydx (STARK signatures)

Documentation

Getting started (tutorial) docs/getting-started.md
Recipes (common patterns) docs/recipes.md
API reference (auto-generated) easytrading.pw
Changelog CHANGELOG.md
Contributing CONTRIBUTING.md
Security policy SECURITY.md

For AI coding assistants

The repo ships first-class instructions so IDE assistants generate correct code without prompting:

Tool File
Universal (any AI) AGENTS.md
Claude Code CLAUDE.md
GitHub Copilot .github/copilot-instructions.md
Cursor IDE .cursor/rules/easytrading.mdc
LLM crawlers / RAG llms.txt

These files travel with the source; any fork or clone inherits the same guidance.

Disclaimer

This software is provided "as is", without warranty of any kind. Trading derivatives carries significant financial risk; use at your own responsibility. The authors are not affiliated with HyperLiquid, Aster, dYdX, or any other exchange.

The HyperLiquid client attaches a 0.5 bps (0.005%) builder fee to every order by default — this funds continued development. The fee is well below typical taker rates and visible on-chain as a separate field on each order action. The library calls approveBuilderFee once per account on the first order; nothing else is required from the consumer. To route fees to your own address set HyperLiquidClientOptions.BuilderFee; to opt out entirely, set its FeeRate to 0m.

License

MIT © 2026 EasyTrading.pw

Product 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.  net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on EasyTrading.Core:

Package Downloads
EasyTrading.HyperLiquid

HyperLiquid DEX client for .NET — REST (Info + Exchange) and WebSocket with EIP-712 signing (L1 action-signed via the phantom-agent struct, plus user-signed flavour for transfers/approvals), pre-flight order validation (tick / lot / min-notional), REST retry policy with backoff + jitter (honours Retry-After on 429), automatic builder-fee routing with one-shot approveBuilderFee, and WebSocket gap recovery on user streams (REST catch-up + dedup on reconnect). Implements EasyTrading.Abstractions plus HyperLiquid-specific surface (vaults, staking, builder fees).

EasyTrading.Aster

Aster Finance (asterdex.com) perpetual DEX client for .NET — REST V3 + Binance-style WebSocket (multiplex market data + listenKey-bound user streams with 30-min keepalive), EIP-712 signing under the AsterSignTransaction domain, pre-flight order validation against /fapi/v3/exchangeInfo filters (PRICE_FILTER / LOT_SIZE / MIN_NOTIONAL), REST retry policy with backoff + jitter. Implements EasyTrading.Abstractions for cross-DEX strategies.

EasyTrading.Dydx

dYdX v4 perpetual DEX client for .NET — Indexer REST + public WebSocket + signed Indexer reads + full Cosmos SDK transaction signing (BIP-39 mnemonic → BIP-32 derivation at Cosmos default path m/44'/118'/0'/0/0 → secp256k1 with RFC-6979 deterministic-k → bech32 `dydx1…` address → protobuf TxRaw → REST broadcast to the validator). End-to-end verified on testnet. Implements EasyTrading.Abstractions for cross-DEX strategies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 41 5/15/2026
1.1.1 49 5/14/2026
1.1.0 47 5/14/2026
1.0.3 46 5/14/2026
1.0.2 35 5/14/2026
1.0.1 41 5/14/2026
1.0.0 37 5/14/2026
1.0.0-rc.2 34 5/14/2026
1.0.0-rc.1 32 5/14/2026
0.4.0-alpha.1 39 5/14/2026