Moonbase Docs
Guides

Order Types

Understanding spot trading order types and parameters

Overview

Moonbase is a spot exchange supporting standard order types for buying and selling cryptocurrencies. Unlike perpetual exchanges, there is no leverage, funding rates, or margin.

Order Types

Limit Order

Execute at a specific price or better.

{
  "product": "BTC-VND",
  "side": "BUY",
  "type": "LIMIT",
  "base_size": "0.001",
  "limit_price": "2500000000"
}
ParameterDescription
typeLIMIT
limit_priceMaximum price to buy / minimum price to sell
base_sizeAmount of base asset (e.g., BTC)

Use cases:

  • Enter positions at desired price levels
  • Provide liquidity (maker orders)
  • Control execution price

Market Order

Execute immediately at best available price.

{
  "product": "BTC-VND",
  "side": "BUY",
  "type": "MARKET",
  "base_size": "0.001"
}
ParameterDescription
typeMARKET
base_sizeAmount of base asset to buy/sell
quote_sizeAlternative: amount of quote asset to spend/receive

Important:

  • Market orders use IOC (Immediate or Cancel) time in force
  • Cannot be post_only
  • limit_price must be 0 or omitted

Use cases:

  • Quick entry/exit
  • Guaranteed execution (subject to liquidity)

Stop Orders

Trigger when price reaches a threshold.

{
  "product": "BTC-VND",
  "side": "SELL",
  "type": "LIMIT",
  "base_size": "0.001",
  "limit_price": "2400000000",
  "order_stop_type": "STOP_LOSS",
  "trigger_price": "2450000000"
}
Stop TypeDescription
STOP_LOSSSell when price drops below trigger
TAKE_PROFITSell when price rises above trigger

Order Sides

SideDescription
BUYPurchase base asset using quote asset
SELLSell base asset for quote asset

For BTC-VND:

  • BUY: Spend VND to get BTC
  • SELL: Sell BTC to get VND

Time in Force

Controls how long an order remains active.

ValueNameDescription
GTCGood Til CanceledRemains active until filled or canceled
IOCImmediate or CancelFill immediately, cancel unfilled portion
FOKFill or KillFill entirely or cancel completely
GTTGood Til TimeActive until specified expiry time

Default Behavior

  • Limit orders: Default to GTC
  • Market orders: Must be IOC

Examples

IOC Order - Partial fills allowed:

{
  "product": "BTC-VND",
  "side": "BUY",
  "type": "LIMIT",
  "base_size": "1.0",
  "limit_price": "2500000000",
  "time_in_force": "IOC"
}

FOK Order - All or nothing:

{
  "product": "BTC-VND",
  "side": "BUY",
  "type": "LIMIT",
  "base_size": "1.0",
  "limit_price": "2500000000",
  "time_in_force": "FOK"
}

Post Only

Ensures order is added to the book (maker order), never takes liquidity.

{
  "product": "BTC-VND",
  "side": "BUY",
  "type": "LIMIT",
  "base_size": "0.001",
  "limit_price": "2500000000",
  "post_only": true
}
  • Order is rejected if it would immediately match
  • Guarantees maker fee (typically lower)
  • Cannot be used with market orders

Self-Trade Prevention (STP)

Prevents your orders from trading against each other.

FlagNameBehavior
CANCEL_TAKERCancel NewerCancel the incoming (taker) order
CANCEL_MAKERCancel OlderCancel the resting (maker) order
CANCEL_BOTHCancel BothCancel both orders
{
  "product": "BTC-VND",
  "side": "BUY",
  "type": "LIMIT",
  "base_size": "0.001",
  "limit_price": "2500000000",
  "stp_flag": "CANCEL_TAKER"
}

Order Status

StatusDescription
SUBMITTEDOrder received, being processed
ACTIVEOrder on the book, awaiting fill
DONEOrder completed (filled or canceled)
SCHEDULEDStop order waiting for trigger

Size Specification

Base Size

Specify amount in base asset (e.g., BTC):

{
  "base_size": "0.001"
}

Quote Size (Market Orders)

Specify amount in quote asset (e.g., VND):

{
  "type": "MARKET",
  "side": "BUY",
  "quote_size": "100000000"
}

This buys as much BTC as 100,000,000 VND can purchase.

Exact Quote Size (Limit FOK)

For limit FOK orders, specify exact quote amount:

{
  "type": "LIMIT",
  "time_in_force": "FOK",
  "base_size": "0.001",
  "exact_quote_size": "2500000000"
}

The limit_price is calculated automatically to ensure exactly exact_quote_size is spent.

Complete Order Request

interface CreateOrderRequest {
  // Required
  product: string;           // e.g., "BTC-VND"
  side: "BUY" | "SELL";
  type: "LIMIT" | "MARKET";

  // Size (one required)
  base_size?: string;        // Amount of base asset
  quote_size?: string;       // Amount of quote asset (market orders)
  exact_quote_size?: string; // Exact quote amount (limit FOK)

  // Price
  limit_price?: string;      // Required for limit orders

  // Optional
  time_in_force?: "GTC" | "IOC" | "FOK" | "GTT";
  post_only?: boolean;
  stp_flag?: "CANCEL_TAKER" | "CANCEL_MAKER" | "CANCEL_BOTH";

  // Stop orders
  order_stop_type?: "STOP_LOSS" | "TAKE_PROFIT";
  trigger_price?: string;

  // Client reference
  client_order_id?: string;
}

Fees

Fee TypeDescription
MakerOrders that add liquidity (post_only, limit orders that rest)
TakerOrders that remove liquidity (market orders, aggressive limits)

Fee rates are returned in portfolio updates and vary by trading volume tier.

Next Steps