Skip to content

feat(sdk): add usdh-only spot order layer#54

Merged
sumfxn merged 3 commits into
mainfrom
feat/usdh-orders
May 11, 2026
Merged

feat(sdk): add usdh-only spot order layer#54
sumfxn merged 3 commits into
mainfrom
feat/usdh-orders

Conversation

@Yaugourt
Copy link
Copy Markdown
Collaborator

@Yaugourt Yaugourt commented May 11, 2026

What

  • Adds USDH-scoped spot order helpers: placeOrder, cancelOrder, getOpenOrders, and getOrderStatus.
  • Accepts live Hyperliquid pair names from listPairs() such as @230, plus ergonomic token aliases such as USDH/USDC and HYPE/USDH.
  • Resolves orders to the live spot asset id (10_000 + pair.index) and keeps order reads USDH-only.
  • Keeps swap() unchanged.

Why

Track 3 should make USDH spot trading usable without turning usdh-kit into a generic Hyperliquid account/order SDK.

Safety Notes

  • getOpenOrders() filters account orders to USDH-bearing spot pairs.
  • getOrderStatus({ pair, oid }) requires the expected USDH pair and rejects mismatched orders.
  • slippageBps must be an integer in [0, 10000]; fractional values reject with InvalidInputError.
  • No live write-path trading was performed; signing/exchange behavior is covered by unit tests.

Tests

  • pnpm lint
  • pnpm build
  • pnpm typecheck
  • pnpm test
  • git diff --check
  • pnpm changeset status --since=origin/main
  • Live read-only probes for mainnet/testnet spotMeta, frontendOpenOrders, and orderStatus

Expose placeOrder, cancelOrder, getOpenOrders, and getOrderStatus on
the kit, gated to USDH-bearing spot pairs via discovery. placeOrder
takes a limit price (with tif) or runs as a slippage-tolerant market
IOC when omitted. swap() is unchanged. InfoClient gains
frontendOpenOrders and orderStatus reads to back the new methods.
@Yaugourt Yaugourt requested a review from sumfxn as a code owner May 11, 2026 09:00
@sumfxn sumfxn merged commit 836f873 into main May 11, 2026
4 checks passed
@sumfxn sumfxn deleted the feat/usdh-orders branch May 11, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants