NOTE
- Lite URL:
https://lite-api.jup.ag/recurring/v1/createOrder
- Pro URL:
https://api.jup.ag/recurring/v1/createOrder
Create Order
This is a POST request to/createOrder
endpoint, where you pass in the necessary parameters and our backend will create the transaction for you to sign and send to the network seamlessly.
INFOThe Recurring API supports both Time-based and Price-based (DEPRECATED) strategies.The
createOrder
endpoint is used to create both types of orders based on the parameters you pass in.Time-based Order
Pass in thetime
object in the params
field.
Some notes to help you understand the parameters.
- The amount to be spent per cycle is calculated based on your input amount and the total number of orders.
- The total time to complete is definite as the amount to be spent per cycle is fixed.
Price-based Order (DEPRECATED)
Pass in theprice
object in the params
field.
CAUTIONPrice-based orders via API is deprecated.
NOTESome notes to help you understand the parameters.
- Price-based orders are opened indefinitely until the user closes them.
- Once low on funds, the order will not be closed and can continue to execute if the user deposits more into the order. Refer to the Deposit Price Order endpoint to deposit more funds into the order.
- Alternatively, the user can also withdraw funds from the order without closing it. Refer to the Withdraw Price Order endpoint to withdraw funds from the order.
- Do note that the price-based orders auto withdraws the output tokens to the user’s wallet every time the order is executed.
- The total time to use up all funds is not definite as the amount to be spent per cycle is variable based on the USDC value of the input token.
/execute
endpoint to do it for you.
Create Order Response
The response from thecreateOrder
endpoint is as follows.
INFODo note that both time-based and price-based orders will return the same response structure.