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"
}| Parameter | Description |
|---|---|
type | LIMIT |
limit_price | Maximum price to buy / minimum price to sell |
base_size | Amount 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"
}| Parameter | Description |
|---|---|
type | MARKET |
base_size | Amount of base asset to buy/sell |
quote_size | Alternative: amount of quote asset to spend/receive |
Important:
- Market orders use
IOC(Immediate or Cancel) time in force - Cannot be
post_only limit_pricemust be0or 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 Type | Description |
|---|---|
STOP_LOSS | Sell when price drops below trigger |
TAKE_PROFIT | Sell when price rises above trigger |
Order Sides
| Side | Description |
|---|---|
BUY | Purchase base asset using quote asset |
SELL | Sell 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.
| Value | Name | Description |
|---|---|---|
GTC | Good Til Canceled | Remains active until filled or canceled |
IOC | Immediate or Cancel | Fill immediately, cancel unfilled portion |
FOK | Fill or Kill | Fill entirely or cancel completely |
GTT | Good Til Time | Active 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.
| Flag | Name | Behavior |
|---|---|---|
CANCEL_TAKER | Cancel Newer | Cancel the incoming (taker) order |
CANCEL_MAKER | Cancel Older | Cancel the resting (maker) order |
CANCEL_BOTH | Cancel Both | Cancel both orders |
{
"product": "BTC-VND",
"side": "BUY",
"type": "LIMIT",
"base_size": "0.001",
"limit_price": "2500000000",
"stp_flag": "CANCEL_TAKER"
}Order Status
| Status | Description |
|---|---|
SUBMITTED | Order received, being processed |
ACTIVE | Order on the book, awaiting fill |
DONE | Order completed (filled or canceled) |
SCHEDULED | Stop 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 Type | Description |
|---|---|
| Maker | Orders that add liquidity (post_only, limit orders that rest) |
| Taker | Orders that remove liquidity (market orders, aggressive limits) |
Fee rates are returned in portfolio updates and vary by trading volume tier.
Next Steps
- Authentication - Sign API requests
- Rate Limits - API rate limiting
- Create Order API - API reference