Extended Documentation
  • ABOUT EXTENDED
    • Vision and Roadmap
    • Technical Architecture
    • Team
  • EXTENDED Resources
    • Trading
      • Trading Accounts and Margin
      • Trading Rules
      • Margin Schedule
      • Order Cost
      • Order Types
      • Trading Fees and Rebates
      • Liquidation Logic
      • Funding Payments
      • Oracle Prices
      • TradFi Markets
    • Account Operations
      • Account Creation
      • Deposits and Withdrawals
    • Vault
    • Referrals and Affiliates
    • Points
    • More
      • Testers Program
      • Leaderboard
      • Platform Outage
      • Testnet
      • Troubleshooting Guide
      • Smart Contract Audits
      • Bounty program
      • Brand Kit
    • Legal
      • Terms of Use
      • Statement of Risk
      • Restricted Countries
      • Privacy Policy
  • Extended API
    • API Documentation
Powered by GitBook
On this page
  • Order Placement
  • Orders Cancellation
  1. EXTENDED Resources
  2. Trading

Order Cost

Order Placement

When a user places a new order, we check that the Available Balance for Trading is greater than or equal to the Order Cost, where:

  • Available Balance for Trading = Equity - Initial Margin for Open Positions and Orders

  • Order Cost for Buy Orders = max(Initial Margin Rate * New Order Price * (New Order Size + min(0, 2 * (Open Position Size + Triggered Buy Order Size 1+ … + Triggered Buy Order Size N))) - Open Loss, 0)

  • Order Cost for Sell Orders = max(-Initial Margin Rate * New Order Price * (New Order Size + max(0, 2 * (Open Position Size + Triggered Sell Order Size 1+ … + Triggered Sell Order Size N))) - Open Loss, 0)

In the equations above:

  • Open Loss = min(New Order Size * (Mark Price - New Order Price), 0)

  • Position / Order Size is positive for Long and Negative for Short

Orders Cancellation

If the Available Balance for Trading becomes less than 0, all open orders except for reduce-only orders are canceled. Additionally, as long as the Available Balance is less than 0, the user can only place orders that reduce the size of existing positions.

PreviousMargin ScheduleNextOrder Types

Last updated 4 days ago