create_limit_order
Create a limit order on Solana that triggers when a target price is reached. Returns an unsigned transaction to sign and execute.
Instructions
Create a limit order that executes when target price is reached.
This function is FREE to call and does not execute any transactions. It returns an unsigned transaction that must be signed and executed.
⚠️ IMPORTANT WARNINGS:
MINIMUM ORDER SIZE: Jupiter frontend enforces $5 USD minimum to ensure keeper profitability. Programmatically, smaller orders are accepted but may never execute!
PRICE VALIDATION: The program does NOT check if your price makes sense!
Buying above market price? Order executes immediately at a LOSS
Setting wrong rate (e.g., 1000 USDC for 1 SOL)? You LOSE the difference!
Jupiter frontend warns/blocks orders >5% above market - API does NOT!
TRANSFER TAX: Tokens with transfer tax extensions are disabled on frontend but API will accept them - be careful!
SLIPPAGE: By default, trigger orders execute with 0 slippage (exact price). Add slippage for better fill probability but at worse price.
Args: input_mint: Input token mint address (token to sell) output_mint: Output token mint address (token to buy) making_amount: Amount of input token to sell in smallest unit taking_amount: Amount of output token to receive in smallest unit (sets the price) slippage_bps: Slippage in basis points (0 = exact price, >0 = accept worse price) expired_at: Unix timestamp when order expires (optional)
Returns: Dictionary containing: - success: Boolean indicating if the request was successful - data: Contains 'order' (account address), 'transaction' (unsigned), and 'requestId' - error: Error message if request failed
Note: - Uses configured wallet as maker/payer - Includes automatic referral (2.55%) - Order executes when market price reaches your target
Example: >>> # SAFE: Create limit order to sell 0.1 SOL when price reaches $200 >>> # Current market: 1 SOL = $180, so this waits for price to rise >>> result = await api.create_limit_order( ... input_mint="So11111111111111111111111111111111111111112", # SOL ... output_mint="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC ... making_amount="100000000", # 0.1 SOL (9 decimals) ... taking_amount="20000000", # 20 USDC (6 decimals) = $200/SOL rate ... slippage_bps=50 # 0.5% slippage for better fills ... ) >>> >>> # DANGEROUS: Wrong price - selling 1 SOL for only 1 USDC! >>> # This executes immediately and you LOSE ~$179! >>> # DON'T DO THIS: >>> # result = await api.create_limit_order( >>> # input_mint="So11...112", >>> # output_mint="EPj...t1v", >>> # making_amount="1000000000", # 1 SOL >>> # taking_amount="1000000" # 1 USDC - HUGE LOSS! >>> # )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expired_at | No | ||
| input_mint | Yes | ||
| output_mint | Yes | ||
| slippage_bps | No | ||
| making_amount | Yes | ||
| taking_amount | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||