Skip to content

feat(sdk): add useful usdh flows#56

Merged
sumfxn merged 2 commits into
mainfrom
feat/useful-usdh-flows
May 11, 2026
Merged

feat(sdk): add useful usdh flows#56
sumfxn merged 2 commits into
mainfrom
feat/useful-usdh-flows

Conversation

@sumfxn
Copy link
Copy Markdown
Owner

@sumfxn sumfxn commented May 11, 2026

Summary

Track 4 adds the missing useful USDH flows while keeping the SDK USDH-scoped:

  • swap({ from: 'USDH', to: 'USDC' }) for reverse HyperCore swaps
  • getQuote() / getRoute() support for the reverse direction
  • bridgeFromCore({ asset: 'USDC' | 'USDH', amount }) via Hyperliquid sendAsset
  • docs + changeset for the new SDK surface

Safety

  • Reverse swaps are HyperCore-only; HyperEVM direct swap remains out of scope.
  • Reverse swaps reject slippageBps >= 10000 before reads/signing so the sell limit price cannot collapse to zero.
  • bridgeFromCore() requires signer.address === accountAddress because the HyperEVM recipient is the Core action sender.
  • bridgeFromCore() returns status: 'submitted' once Hyperliquid accepts sendAsset; it does not wait for the later HyperEVM credit.
  • Bridge-out amount formatting derives EVM decimals from spotMeta instead of assuming six decimals.
  • No live write-path test was run. Live validation was read-only against Hyperliquid mainnet/testnet metadata, books, quotes, and routes.
  • USDC bridge-out uses the Circle-documented bare USDC token form; linked USDH uses tokenName:tokenId per Hyperliquid sendAsset docs.

References:

Validation

  • pnpm lint
  • pnpm build
  • pnpm typecheck
  • pnpm test
  • git diff --check
  • pnpm changeset status --since=origin/main
  • live read-only probes on mainnet/testnet spotMeta, l2Book, SDK getQuote(), and SDK getRoute()

@sumfxn sumfxn marked this pull request as ready for review May 11, 2026 12:04
@sumfxn sumfxn merged commit 73fc0e5 into main May 11, 2026
4 checks passed
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.

1 participant