Forkast Knowledge Center
Platform Mechanics
Order Matching Mechanism
4 min
forkast employs a robust order matching system that prioritizes efficiency and fairness in its prediction markets the matching engine follows specific rules to match buy and sell orders, ensuring seamless trade execution standard matching rules normal matching (priority 1) matches buy orders (bids) with sell orders (asks) based on the following rules price priority buy orders with higher bid prices are matched first with sell orders having lower ask prices refunds if a buy order's bid price exceeds the matched sell order's ask price, the buyer is refunded the price difference example sellers seller a 0 6 yes (30 shares) seller b 0 7 yes (30 shares) buyer buyer c 0 8 yes (30 shares) matching buyer c is matched with seller a at 0 6, and buyer c receives a refund for the price difference mint matching (priority 2) if no normal match is possible, the system matches two bids from "yes" and "no" buyers, provided their combined prices equal 1 pc the system mints yes no tokens for both buyers example buyer a 0 6 yes (30 shares) buyer b 0 4 no (30 shares) matching tokens are minted as yes price (0 6) + no price (0 4) = 1 pc merge matching (priority 3) if no normal match is available, the system matches two asks from "yes" and "no" sellers, provided their combined prices equal 1 pc tokens are merged, and sellers are paid in pc example seller a 0 7 yes (30 shares) seller b 0 3 no (30 shares) matching orders are merged as yes price (0 7) + no price (0 3) = 1 pc additional matching rules first come, first served if multiple orders have the same price, the matching engine prioritizes them based on the time they were submitted redundant matching market orders remaining unmatched amounts are canceled and refunded immediately limit orders remaining unmatched amounts stay on the order book and continue in the order queue until expiration or market closure what happens to unfulfilled buy orders when a market resolves? if a market resolves before your buy order is fulfilled, the order is automatically canceled, and your funds are fully refunded order matching examples partial fill seller places a limit order sell yes @ 0 7 (30 shares) buyer places a market order buy yes (20 shares) result 20 shares are matched at 0 7 the remaining 10 shares stay on the order book excess demand seller places a limit order sell yes @ 0 7 (30 shares) buyer places a market order buy yes (50 shares) result 30 shares are matched at 0 7 the remaining 20 shares are canceled and refunded this matching system ensures efficient and fair trade execution while maintaining transparency and encouraging active participation