Skip to main content

Overview

Limit orders are a native feature of THORChain and MAYAChain — they’re stored as memo-encoded transactions on the source chain, and the protocol’s outbound vault settles them when the target price is met. The SDK exposes both the high-level client methods (recommended) and the low-level building blocks (for custom flows). LIMIT_ORDER_NATIVE_ASSETS lists the assets eligible as the order’s source/destination. Currently this includes RUNE, BTC.BTC, ETH.ETH, ETH.USDC, BCH.BCH, LTC.LTC, DOGE.DOGE, AVAX.AVAX, BSC.BNB, MAYA.CACAO, and others.

High-Level API

Submit

Returns the protocol-assigned order ID. The SDK builds the memo, signs the deposit transaction with the active wallet, and broadcasts it.

Cancel

The cancel transaction is signed and broadcast for you. Returns the memo string used (useful for receipts/logs).

Low-Level Utilities

For custom flows where you don’t want the SDK to sign or broadcast:
toBaseUnits (under the limit-orders namespace) is a thin wrapper that handles THORChain’s 1e8 normalization correctly across decimals — use it instead of generic amount math when building memos by hand.

Types

All types are exported from the main leokit-sdk entry point.

Notes

  • Limit orders only work for protocols that support them (THORChain, MAYAChain). Other protocols throw on submitLimitOrder.
  • The SDK handles asset normalization (THORChain uses ASSET~ suffix in some memos); you don’t need to format the memo yourself when using submitLimitOrder / cancelLimitOrder.
  • Use getLimitOrderStatus (or sdk.watchTransaction(orderId, ...) if your status feed exposes the order id) for fill tracking.