Method Signature
Parameters
The market application ID on Algorand
The position to trade:
1 for Yes, 0 for NoPrice in microunits (e.g.,
500_000 = $0.50). Must be between 0 and 1,000,000.Quantity in microunits (e.g.,
1_000_000 = 1 share)Whether this is a buy order (
true) or sell order (false)Fee base in microunits (e.g.,
70_000 = 7%). If omitted, reads from market’s on-chain global state.Return Type
The escrow app ID of the newly created order
Array of transaction IDs from the atomic group
The confirmed round number on the blockchain
Total quantity that was immediately matched (in microunits). For limit orders, this is non-zero if there were matching counterparty orders at your exact price.
Volume-weighted average fill price in microunits. Accounts for complementary matching (e.g., 1,000,000 - noPrice for YES buys).
Example
Behavior Notes
- Zero Slippage: Limit orders execute only at your exact price. They will not match against less favorable prices.
- Immediate Matching: If there are existing counterparty orders at your price or better, your limit order will immediately match against them. The remaining quantity (if any) sits on the orderbook.
- Collateral Requirements:
- Buy orders: Require USDC equal to
(quantity * price / 1,000,000) + fee - Sell orders: Require outcome tokens equal to
quantity
- Buy orders: Require USDC equal to
- Asset Opt-in: The SDK automatically opts-in to required assets (USDC or outcome tokens) if needed.
- Escrow Creation: Each order creates a new escrow application (957,000 microAlgos MBR) which is returned when the order is cancelled or fully filled.
