LogoLogo
Get FlexGitHubSDKTelegram
  • FLEX DEX
  • Guides
    • Get EVERs and Prepare Wallet
    • Web DApp
      • Connect Your Wallet
      • Trade on Flex
      • Keep Up Gas Balance
    • Desktop DApp
      • Install Flex DApp
      • Connect Your Wallet
      • Trade on Flex
      • Keep up Gas Balance
    • Update Flex
    • Troubleshooting
  • Integration
    • Quick Integration Guide
    • Flex SDK reference
    • Log into DApp with Trader Keys
  • Specifications
    • Flex Fees
    • Challenges of DEX
    • FLEX General Architecture
      • Main Functions
      • Market Orders
      • Limit Orders
      • Time in force
    • Economic Model
  • Technical Description
    • Overview
    • Glossary
    • Flex API
    • DApp Authorization
  • Links
    • Flex Contracts Reference
    • Flex on GitHub
    • Flex SDK on GitHub
    • TIP3 specifications
    • Everscale Developer Tools
    • Everscale Dev on Telegram
    • Flex on Telegram
Powered by GitBook
On this page
  1. Specifications
  2. FLEX General Architecture

Time in force

Good-til-cancelled (GTC) orders require a specific cancelling order and can persist indefinitely (or can be limited by say 90 days).

Immediate or cancel (IOC) orders are immediately executed or cancelled by the exchange. Unlike Fill-or-Kill orders, IOC orders allow for partial fills.

Limit Order + IOC option

# Pseudocode
while order_filled < V and there are counter-orders:
    find counter-order with best_price
    if best_price is equal or better than P:
        fill the order
    else:
				break
update balances in quote and base tokens

How it is implemented on Flex:

Price contract needs to support these types of execution flags.

PreviousLimit OrdersNextEconomic Model

Last updated 2 years ago