EasyTrading.HyperLiquid 1.2.0

dotnet add package EasyTrading.HyperLiquid --version 1.2.0
                    
NuGet\Install-Package EasyTrading.HyperLiquid -Version 1.2.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="EasyTrading.HyperLiquid" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyTrading.HyperLiquid" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="EasyTrading.HyperLiquid" />
                    
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.HyperLiquid --version 1.2.0
                    
#r "nuget: EasyTrading.HyperLiquid, 1.2.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.
#:package EasyTrading.HyperLiquid@1.2.0
                    
#: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.HyperLiquid&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=EasyTrading.HyperLiquid&version=1.2.0
                    
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.2.0
Aster EasyTrading.Aster 1.2.0
dYdX v4 EasyTrading.Dydx 1.2.0

Coverage summary:

  • HyperLiquid is stable. 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). REST retry policy with backoff + jitter, honours Retry-After on 429. WebSocket gap recovery: on reconnect, user streams auto-fetch missed events via REST and deduplicate against the live feed.
  • Aster Finance is stable. Same surface, EIP-712 signing with AsterSignTransaction domain. Pre-flight validator wired to /fapi/v3/exchangeInfo filters (PRICE_FILTER / LOT_SIZE / MIN_NOTIONAL). WebSocket: Binance-style multiplex (market + listenKey-bound user streams with 30-min keepalive).
  • dYdX v4 is stable. Indexer REST + public WebSocket + signed Indexer reads + full Cosmos SDK transaction assembly (BIP-39 → BIP-32 → secp256k1 → bech32 → protobuf TxRaw → REST broadcast). End-to-end verified on testnet: Testnet_PlaceLimit_and_Cancel places a far-from-market post-only BTC-USD buy from a freshly-faucet-funded wallet and cancels it; the chain accepts both. dydx-mainnet-1 and dydx-testnet-4 chain IDs supported out of the box.

Tests: 146 unit + 16 integration (live mainnet across HL, Aster, dYdX, plus dYdX testnet PlaceLimit + Cancel write verification), all green.

Install

dotnet add package EasyTrading.HyperLiquid
# or
dotnet add package EasyTrading.Aster

Either pulls EasyTrading.Abstractions and EasyTrading.Core transitively.

Quick start

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

var host = Host.CreateApplicationBuilder(args);

host.Services
    .AddEasyTrading()
    .AddHyperLiquid(o =>
    {
        o.Network = HyperLiquidNetwork.Mainnet;
        o.Credentials = new HyperLiquidCredentials(
            masterAddress: "0xYourMasterAddress",
            privateKey:    Environment.GetEnvironmentVariable("HL_AGENT_KEY")!,
            agentName:     "easy-bot");
    })
    .AddAster(o =>
    {
        o.Network = AsterNetwork.Mainnet;
        o.Credentials = new AsterCredentials(
            MasterAddress: "0xYourMasterAddress",
            SignerAddress: "0xYourSignerAddress",
            PrivateKey:    Environment.GetEnvironmentVariable("ASTER_SIGNER_KEY")!);
    });

using var app = host.Build();
var hl    = app.Services.GetRequiredService<IHyperLiquidExchange>();
var aster = app.Services.GetRequiredService<IAsterExchange>();

// Read — works without credentials.
var mids = await hl.Markets.GetAllMidsAsync();
var book = await aster.Markets.GetOrderBookAsync("BTCUSDT", depth: 20);

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

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

To write a strategy that doesn't care which venue it runs against, inject IExchangeClient instead of the venue-specific surface — every supported DEX implements the same shape.

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.2.0
  • Aster — REST + WebSocket + EIP-712 signing → 1.2.0
  • dYdX v4 — Indexer REST + WebSocket + Cosmos SDK signing (BIP-39 → BIP-32 → secp256k1 → bech32, full proto stack, REST broadcast), end-to-end verified on testnet → 1.2.0

Documentation

Getting started (tutorial) docs/getting-started.md
Recipes (common patterns) docs/recipes.md
API reference (auto-generated) polius2007.github.io/EasyTrading
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 Elinesoft

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

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 23 5/15/2026
1.1.1 36 5/14/2026
1.1.0 29 5/14/2026
1.0.3 44 5/14/2026
1.0.2 35 5/14/2026
1.0.1 31 5/14/2026
1.0.0 37 5/14/2026
1.0.0-rc.2 28 5/14/2026
1.0.0-rc.1 34 5/14/2026
0.4.0-alpha.1 30 5/14/2026