Skip to main content
Learn how to place limit and market orders on Vita CLOB with this comprehensive guide.

Prerequisites

Before You Start

  • Near wallet connected (Near Wallet, Meteor, or Sender)
  • Sufficient token balance for trading
  • Gas fees: approximately 0.003-0.007 NEAR per transaction

Placing a Limit Order

Limit orders allow you to set your exact buy or sell price.
1

Select Market

Choose your trading pair from the market selector
Market Selector

Market selection interface showing available trading pairs

2

Choose Order Type

Select “Limit Order” and choose Buy or Sell
Order Placement Form

Order form with limit order selected

3

Enter Order Details

Fill in your order parameters:
  • Limit price: Your desired execution price
  • Quantity: Amount to trade
  • Review the platform fee
  • Check total value
Check the order book to see current bid/ask prices before setting your limit price
4

Review and Confirm

  • Check order details carefully
  • Review estimated fees
  • Click Place order button
  • Confirm the transaction in your wallet

Limit Order Example

// Direct contract interaction - No SDK available
const web3 = new Web3(window.ethereum);
const vitaCLOB = new web3.eth.Contract(VITA_CLOB_ABI, "[TBD]");

// Place buy limit order
await vitaCLOB.methods.placeLimitBidOrder({
  market_id: 1,                    // NEAR-USDC market
  price: "495000000",              // 4.95 USDC (6 decimals)
  quantity: "1000000000000000000000000", // 1 NEAR (24 decimals)
  match_limit: 50                  // Default match limit
}).send({ 
  from: userAddress,
  value: web3.utils.toWei('0.1', 'ether') // Deposit
});

Placing a Market Order

Market orders execute immediately at the best available price.
1

Select Market Order

Choose “Market Order” instead of limit order
Market orders don’t require a price - only the quantity
2

Enter Quantity

Specify how much you want to buy or sell
  • The system will show estimated execution price
  • Check for price impact on large orders
3

Review Price Impact

Large market orders may move the price significantly. Review the order book depth before placing large orders.
4

Execute Order

Confirm the transaction to execute immediately

Market Order Example

// Direct contract interaction - No SDK available
const web3 = new Web3(window.ethereum);
const vitaCLOB = new web3.eth.Contract(VITA_CLOB_ABI, "[TBD]");

// Place market buy order
await vitaCLOB.methods.placeMarketBidOrder({
  market_id: 1,                    // NEAR-USDC market
  quantity: "1000000000000000000000000", // 1 NEAR
  match_limit: 50                  // Default match limit
}).send({ 
  from: userAddress,
  value: web3.utils.toWei('0.1', 'ether') // Deposit
});

Trading Flow Visualization

Mobile Trading

Vita CLOB is optimized for mobile trading with responsive interfaces.

Mobile Order Book

Mobile order book view

Mobile Place Order

Mobile order placement

Understanding Order Parameters

Market ID

Each trading pair has a unique market ID:
  • Generated from base and quote token addresses
  • Includes decimal configurations
  • Example: 1 for NEAR-USDC pair

Price Formatting

Prices must account for token decimals:
DescriptionFormula/Example
Actual Priceprice / (10 ^ quote_token_decimals)
Example495000000 = 4.95 USDC (with 6 decimals)

Quantity Formatting

Quantities use the base token’s decimal precision:
DescriptionFormula/Example
Actual Quantityquantity / (10 ^ base_token_decimals)
Example1000000000000000000000000 = 1 NEAR (24 decimals)
Minimum order size1 lot
Lot size10^lot_decimals (varies by market)

Match Limit

  • Default: 50 matches per order
  • Prevents excessive gas consumption
  • Can be adjusted based on needs

Fee Calculation

Trading fees are automatically calculated and deductedFor buy orders, fees are deducted from the quote token amount:
  • Formula: net_amount = gross_amount * 10000 / (10000 + fee_rate)
  • Fee rates are set per market by the market creator
  • Check specific market fees: near view [TBD] get_market '{"market_id": "1"}'

Order Validation

Before submitting, the system validates:
  • Sufficient token balance
  • Valid price (limit orders must be > 0)
  • Market is active
  • No self-trading

Troubleshooting

Ensure you have enough tokens in your wallet:
  • For buy orders: Need quote token (e.g., USDC) + fees
  • For sell orders: Need base token (e.g., NEAR)
The selected market may be paused. Check market status or try another pair.
You cannot trade with your own orders. Cancel existing orders on the opposite side first.
Common causes:
  • Insufficient gas fees
  • Network congestion
  • Wallet connection issues
Try increasing gas or waiting a moment before retrying.

Next Steps