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.
# 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
Price contract needs to support these types of execution flags.
Last modified 3mo ago