Bluefin
  • Bluefin Exchange
    • Introduction
    • Roadmap
    • Getting Started
      • Onboarding
      • Depositing & Set Up
      • Tutorials
      • Perpetual Swaps
    • Trading
      • Order Types
        • TP/SL Orders
      • Orderbook Design
      • Isolated Margining
      • PnL Calculation
      • Oracle and Index Price
      • Risk Engine
        • Liquidation Process
        • Insurance Fund
        • ADL
      • Funding
      • Trading Fees
      • Gas Fees
      • Contract Specs
    • Perps API Docs
    • Pre-Launch Markets
  • Bluefin Spot CLMM
    • Introduction
    • Getting Started
    • Protocol Features
      • Swap
        • Limit Orders
      • Liquidity Pools
    • BluefinX
    • Tutorials
      • Exploring the Pools
      • Adding Liquidity (Creating a Position)
      • Managing a Position and Claiming Fees/Rewards
      • Auto-Rebalancing
      • Swapping
      • Placing Limit Orders
      • Switching from Spot to Perps Account
    • Spot API Docs
    • FAQs
  • Lending on Bluefin
    • Introduction
    • Protocol Features
    • Tutorials
      • Supply and Borrow Assets
  • Bluefin Airdrop
    • Bluefin Airdrop Explained
    • Bluefin Foundation Statement
    • Claiming and Rewards Post-TGE
    • FAQs
  • Users
    • Rewards
      • Trading Rewards
      • Bluefin Vaults
      • Leagues
      • Sui Wallet on Mobile Giveaway
      • Sui Wallet Campaign
        • List of Winners
      • Walrus Campaigns
        • Walrus LP & Trading Competition
        • Walrus Trade & Earn Campaign
  • Other
    • BLUE Token
    • On-Ramping directly to Bluefin
    • Security
      • Code Audits
      • Spot Audits
    • Governance
      • Bluefin DAO
    • Bluefin Vanguard Ambassador Program
    • Terms of Use and Privacy Policy
      • Vulnerability Disclosure Policy
      • Wash Trading
      • Address Screening
      • Risk Information
    • FAQs
      • USD vs USDC
Powered by GitBook
On this page
  • Time-in-Force (TIF) Orders
  • Placing An Order
  1. Bluefin Exchange
  2. Trading

Order Types

PreviousTradingNextTP/SL Orders

Last updated 8 months ago

Market Order: Fills the best available offers immediately up to the specified quantity. Market orders execute instantly at the prevailing market rate, so they may lead to slippage when the price changes. To minimize the effects of price fluctuations, it is advisable to use limit orders instead.

Limit Order: Posts to the Order Book to be executed at a price at least as good as the specified limit price. Upon order creation, the Cost of the order will be locked off-chain and deducted from Free Collateral.

Stop Orders: These orders are stored outside of the Order Book in a Stand-by Server and are only sent to the book once the Oracle Price hits a user-specified Trigger Price. More details on Stop Orders can be found .

These are the building blocks of Take Profit (TP) and Stop Loss (SL) orders, which are described in detail .

There are a two types of stop orders:

  • Stop-Market: requires only a stop price and size to be specified. After index price crosses the stop price, a market order is placed and executes instantly at the prevailing market rate.

  • Stop-Limit: requires two prices, a Stop price and a Limit price, and size. After index price crosses the stop price, a limit order with the limit price is placed. This option is recommended for reduced slippage.

Post Only: This is a condition on the limit order to only execute as a maker order. If any of the order quantity takes offers available on the orderbook, the entire Post Only order is canceled.

Time-in-Force (TIF) Orders

Time-in-Force Order options are available for Limit Orders. The default is GTC.

Good till Cancel (GTC). An order placed on the order book stays active until cancelled, filled or expired. The default GTC expiration time is 90 days.

Immediate or Cancel (IOC). An IOC order is a taker-only order; it immediately fills as much order quantity as possible and cancels any quantity unfilled. No order is placed in the order book.

Fill or Kill (FOK). An FOK order is a taker-only order; it immediately either fills completely or is completely cancelled. No order is placed in the order book. This order type is useful for traders looking to trade large quantities, without affecting both the market price and their average trade execution price.

Placing An Order

Every order must be cryptographically signed at creation. After orders are matched by the off-chain order matching engine, their respective signatures are sent to the smart contracts alongside the data of the trade. The signatures are verified before executing trades for the counterparties.

Signing an Order. All orders and order cancellation requests must be individually cryptographically signed.

Canceling An Order. Canceling an unfilled open order removes it from the order book and any freed up Margin is moved back to the trader's Free Collateral. After removing from the order book, the server will call the smart-contract-level cancel() method. The contract verifies the signature on the cancel request and marks the order as canceled. From then on, any attempt to trade against a canceled order will fail.

Self-trade protection

If a trader completely or partially fills their own order, the self-traded order quantity is cancelled and the signatures are invalidated on-chain.

here
here