Alpha feature: Advanced Orders are gated and not publicly available yet. Reach out to the Mobula team to enable access for your account.
Take Profit Advanced Orders let a wallet lock in upside without giving Mobula custody of the user’s wallet or a reusable approval. The user deposits the exact tokenIn amount for the order, signs a canonical intent, and Mobula executes only when the fresh quote for amountRaw is greater than or equal to triggerAmountOutRaw.
Use this flow for Solana token take-profit automation, TP lines on charts, sell targets, and any UX where the user wants a swap to execute only after the market reaches a better output.
POST / GET
| Method | Path | Purpose |
|---|
POST | /api/2/swap/advanced-orders/intent | Build the canonical intent message to sign. |
POST | /api/2/swap/advanced-orders | Create the signed order. |
GET | /api/2/swap/advanced-orders | List owner orders. Requires a read signature. |
GET | /api/2/swap/advanced-orders/:orderId | Read one order. Requires a read signature. |
POST | /api/2/swap/advanced-orders/:orderId/cancel | Cancel an open or triggered order. |
End-to-End Flow
Advanced Orders are deposit-backed intents. The user keeps custody of their wallet keys and never gives Mobula a reusable approval, session key, or delegated signing power. The only funds Mobula can execute with are the exact tokens the user transfers to the Mobula deposit wallet for that order.
The deposited amount is held in the Mobula deposit wallet while the order is open. If the order is cancelled, expires, or cannot execute, the settlement flow refunds the confirmed deposit to the owner.
| Step | Actor | What happens |
|---|
| 1 | Integrator | Use the Mobula-provided deposit wallet for the environment. The end user must not choose this address. |
| 2 | User wallet | Transfer exactly amountRaw of tokenIn from ownerAddress to the Mobula deposit wallet. |
| 3 | Client | Call POST /api/2/swap/advanced-orders/intent with the deposit transaction hash and all order parameters. |
| 4 | Mobula API | Normalizes the payload, resolves the server deposit wallet, validates addresses and amounts, then returns the canonical message to sign. |
| 5 | User wallet | Signs the canonical message. This signature covers the chain, owner, recipient, tokens, amounts, trigger settings, expiry, deposit transaction, routing restrictions, and fees. |
| 6 | Client | Call POST /api/2/swap/advanced-orders with the same fields plus intentSignature. |
| 7 | Mobula API | Verifies the owner signature and stores the order idempotently by intent hash. |
| 8 | Mobula worker | Polls open orders every few seconds and verifies the deposit transaction on-chain. The deposit must be finalized, successful, sent by ownerAddress, sent to the Mobula deposit wallet, and match tokenIn + amountRaw. |
| 9 | Mobula worker | Watches swaps-stream for relevant token/pair updates. For TP/SL it pre-checks quote movement; for Triggers it confirms the configured Token Details fields through getTokenData. |
| 10 | Mobula execution engine | Claims the order, builds a fresh quote with the order constraints, checks minAmountOutRaw, signs only the swap transaction for the deposit wallet, and broadcasts it. |
| 11 | Mobula settlement | Confirms the broadcasted transaction. If filled, output funds are sent to recipientAddress. If cancelled, expired, or non-executable, the confirmed deposit is refunded to ownerAddress. |
Non-Custodial Guarantees
| Guarantee | How it is enforced |
|---|
| Mobula cannot trade from the user’s wallet | The user only signs an intent message, not a transaction spending future wallet balances. |
| Mobula cannot mutate the order after signing | The canonical message includes the full order payload. Changing any signed field changes the intent hash and invalidates the signature. |
| Mobula cannot use a different deposit | Deposit verification checks the exact finalized transfer: owner, deposit wallet, token, and raw amount. |
| Mobula cannot bypass the output guard | Execution always checks the fresh quote against minAmountOutRaw before sending. |
| The user can exit before execution | The owner can cancel open/triggered orders with a signed cancel message. Confirmed deposits are then handled by the refund settlement flow. |
Client Checklist
- Build and send the token transfer to the Mobula deposit wallet.
- Wait for the deposit transaction signature.
- Call
POST /advanced-orders/intent.
- Ask the owner wallet to sign
data.message.
- Call
POST /advanced-orders with intentSignature.
- Poll
GET /advanced-orders or GET /advanced-orders/:orderId.
- To cancel, sign the canonical cancel message and call
POST /advanced-orders/:orderId/cancel.
Take Profit Parameters
| Field | Value |
|---|
orderKind | take_profit |
triggerDirection | gte |
triggerAmountOutRaw | Target output threshold. |
minAmountOutRaw | Final execution guard. Must be less than or equal to the quote you are willing to accept. |
expiresAt | Future ISO date, max 90 days. |
Take Profit Intent Body
{
"chainId": "solana:solana",
"ownerAddress": "<OWNER>",
"recipientAddress": "<OWNER>",
"tokenIn": "<TOKEN_MINT>",
"tokenOut": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountRaw": "1000000000",
"minAmountOutRaw": "1180000",
"triggerAmountOutRaw": "1200000",
"triggerDirection": "gte",
"orderKind": "take_profit",
"slippage": 1,
"depositTransactionHash": "<DEPOSIT_TX_SIGNATURE>",
"expiresAt": "2026-08-01T00:00:00.000Z",
"onlyRouters": ["mobula"]
}
Create a Take Profit Order
const intent = await fetch("https://api.mobula.io/api/2/swap/advanced-orders/intent", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "<YOUR_API_KEY>",
},
body: JSON.stringify(intentBody),
}).then((res) => res.json());
const intentSignature = await wallet.signMessage(intent.data.message);
await fetch("https://api.mobula.io/api/2/swap/advanced-orders", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "<YOUR_API_KEY>",
},
body: JSON.stringify({ ...intentBody, intentSignature }),
});
Read
Read signatures use:
Mobula Advanced Order Read v1
{"ownerAddress":"<OWNER_ADDRESS>"}
curl "https://api.mobula.io/api/2/swap/advanced-orders?ownerAddress=<OWNER>&readSignature=<SIGNATURE>" \
-H "x-api-key: <YOUR_API_KEY>"