-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
Extend limit order functionality to Solana using Jupiter's Limit Order API. EOA compatible.
Background
SS-5290 implemented limit orders for EVM chains via CoW Protocol. This ticket adds Solana support via Jupiter, completing multi-chain limit order coverage.
Jupiter's limit order system works differently from CoW:
- Orders are on-chain (not off-chain like CoW)
- Requires transaction to create/cancel (small SOL fee)
- Executed by Jupiter's keeper network
Third-Party API
- Jupiter Limit Order API: https://station.jup.ag/docs/limit-order/limit-order-api
- Jupiter Limit Order Program:
jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu
User Flow
User: "Set a limit order to buy SOL at $180 on Solana"
Agent: "I'll create a limit order on Jupiter:
📋 Limit Order (Solana)
• Buy: SOL
• Price: $180 or below
• Spend: USDC
• Amount: How much USDC?"
User: "$500"
Agent: [Creates Jupiter limit order]
"✅ Limit order created on Solana!
Buy SOL at $180
Spending: 500 USDC
Expected: ~2.78 SOL
Track your order: [Jupiter Link]
Note: Creating this order cost ~0.01 SOL in fees."
Tool Schema
// Extend existing limit order schema to support Solana
const createLimitOrderSchema = z.object({
sellAsset: assetInputSchema,
buyAsset: assetInputSchema,
sellAmount: z.string(),
limitPrice: z.string(),
expirationHours: z.number().optional().default(168),
// Provider auto-selected based on network
})
// Jupiter-specific create order
interface JupiterLimitOrderParams {
inputMint: string // Token to sell
outputMint: string // Token to buy
inAmount: string // Amount in base units
outAmount: string // Minimum output amount
expiredAt: number | null // Unix timestamp or null for no expiry
}Tool Output
interface CreateLimitOrderOutput {
success: boolean
orderId: string
orderUrl: string
provider: 'cow' | 'jupiter' // Now includes jupiter
summary: {
sellAsset: { symbol: string; amount: string; network: string }
buyAsset: { symbol: string; estimatedAmount: string; network: string }
limitPrice: string
expiresAt: string
}
// Jupiter-specific
createOrderTx?: TransactionData // Jupiter requires on-chain tx
}Implementation Notes
-
Provider Selection: Auto-select based on network
- EVM chains → CoW Protocol
- Solana → Jupiter
-
Key Differences from CoW:
- Jupiter orders are on-chain (require tx to create)
- Cancellation also requires tx
- No EIP-712 signing, just regular Solana transaction
-
Jupiter API Flow:
// 1. Create order POST https://api.jup.ag/limit/v2/createOrder // 2. Get orders for user GET https://api.jup.ag/limit/v2/openOrders?wallet={address} // 3. Cancel order POST https://api.jup.ag/limit/v2/cancelOrders
Acceptance Criteria
- User can create limit orders on Solana via Jupiter
- Orders appear in "get limit orders" alongside CoW orders
- User can cancel Jupiter orders
- Provider auto-selected based on asset network
- UI shows appropriate status for Jupiter orders
- Fees displayed clearly (Jupiter charges small SOL fee)
Dependencies
- SS-5290: Limit Order Tool (extend existing implementation)
- Solana wallet connection (already exists)
coderabbitai
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog