curl -X GET "https://starknet.api.avnu.fi/dca/v3/orders?traderAddress=0x0123...&status=ACTIVE"
// Fetch active DCA orders
const params = new URLSearchParams({
traderAddress: account.address,
status: 'ACTIVE',
page: '0',
size: '10'
});
const response = await fetch(`https://starknet.api.avnu.fi/dca/v3/orders?${params}` );
const data = await response.json();
console.log(`Found ${data.totalElements} active orders`);
console.log(`Page ${data.number + 1} of ${data.totalPages}`);
data.content.forEach(order => {
console.log(`Order ${order.orderAddress}: ${order.sellTokenAddress} -> ${order.buyTokenAddress}`);
});
import requests
params = {
'traderAddress': account_address,
'status': 'ACTIVE',
'page': 0,
'size': 10
}
response = requests.get(
'https://starknet.api.avnu.fi/dca/v3/orders',
params=params
)
data = response.json()
orders = data['content']
print(f"Found {data['totalElements']} active orders")
print(f"Page {data['number'] + 1} of {data['totalPages']}")
for order in orders:
print(f"Order {order['orderAddress'][:10]}...")
print(f" Status: {order['status']}")
print(f" Sell: {order['sellTokenAddress']}")
print(f" Buy: {order['buyTokenAddress']}")
{
"content": [
{
"id": "ae1a649c-a9fb-4130-835b-cb14e144e8c1",
"blockNumber": 860820,
"timestamp": "2024-10-31T16:01:15Z",
"traderAddress": "0x25b..",
"orderAddress": "0x50ab..",
"creationTransactionHash": "0x6b65..",
"orderClassHash": "0x2d5af3e59f6b180bb2190957b527dd4db61a2c1095d4fd1e75e3a89732c796b",
"sellTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"sellAmount": "0xde0b6b3a7640000",
"sellAmountPerCycle": "0x94079cd1a42aaa",
"buyTokenAddress": "0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",
"startDate": "2024-10-31T16:01:15Z",
"endDate": "2024-11-01T16:01:15Z",
"closeDate": "2024-11-01T15:02:27.923Z",
"frequency": "PT1H",
"iterations": 24,
"status": "CLOSED",
"pricingStrategy": {},
"amountSold": "0xde0b6b3a763fff0",
"amountBought": "0x214",
"averageAmountBought": "0x16",
"executedTradesCount": 24,
"cancelledTradesCount": 0,
"pendingTradesCount": 0,
"trades": [
{
"sellAmount": "0x94079cd1a42aaa",
"sellAmountInUsd": 0.015667,
"buyAmount": "0x17",
"buyAmountInUsd": 0.016246,
"expectedTradeDate": "2024-10-31T16:01:15Z",
"status": "SUCCEEDED",
"actualTradeDate": "2024-10-31T16:01:56.860Z",
"txHash": "0x25a006ecd.."
},
{
"sellAmount": "0x94079cd1a42aaa",
"sellAmountInUsd": 0.015561,
"buyAmount": "0x16",
"buyAmountInUsd": 0.015482,
"expectedTradeDate": "2024-10-31T17:01:15Z",
"status": "SUCCEEDED",
"actualTradeDate": "2024-10-31T17:01:57.834Z",
"txHash": "0x7972e18b2c.."
}
]
}
],
"size": 25,
"number": 0,
"totalElements": 1,
"totalPages": 1
}
Recurring Buy
Get DCA Orders
Retrieve all DCA orders for a specific trader address
GET
/
dca
/
v3
/
orders
curl -X GET "https://starknet.api.avnu.fi/dca/v3/orders?traderAddress=0x0123...&status=ACTIVE"
// Fetch active DCA orders
const params = new URLSearchParams({
traderAddress: account.address,
status: 'ACTIVE',
page: '0',
size: '10'
});
const response = await fetch(`https://starknet.api.avnu.fi/dca/v3/orders?${params}` );
const data = await response.json();
console.log(`Found ${data.totalElements} active orders`);
console.log(`Page ${data.number + 1} of ${data.totalPages}`);
data.content.forEach(order => {
console.log(`Order ${order.orderAddress}: ${order.sellTokenAddress} -> ${order.buyTokenAddress}`);
});
import requests
params = {
'traderAddress': account_address,
'status': 'ACTIVE',
'page': 0,
'size': 10
}
response = requests.get(
'https://starknet.api.avnu.fi/dca/v3/orders',
params=params
)
data = response.json()
orders = data['content']
print(f"Found {data['totalElements']} active orders")
print(f"Page {data['number'] + 1} of {data['totalPages']}")
for order in orders:
print(f"Order {order['orderAddress'][:10]}...")
print(f" Status: {order['status']}")
print(f" Sell: {order['sellTokenAddress']}")
print(f" Buy: {order['buyTokenAddress']}")
{
"content": [
{
"id": "ae1a649c-a9fb-4130-835b-cb14e144e8c1",
"blockNumber": 860820,
"timestamp": "2024-10-31T16:01:15Z",
"traderAddress": "0x25b..",
"orderAddress": "0x50ab..",
"creationTransactionHash": "0x6b65..",
"orderClassHash": "0x2d5af3e59f6b180bb2190957b527dd4db61a2c1095d4fd1e75e3a89732c796b",
"sellTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"sellAmount": "0xde0b6b3a7640000",
"sellAmountPerCycle": "0x94079cd1a42aaa",
"buyTokenAddress": "0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",
"startDate": "2024-10-31T16:01:15Z",
"endDate": "2024-11-01T16:01:15Z",
"closeDate": "2024-11-01T15:02:27.923Z",
"frequency": "PT1H",
"iterations": 24,
"status": "CLOSED",
"pricingStrategy": {},
"amountSold": "0xde0b6b3a763fff0",
"amountBought": "0x214",
"averageAmountBought": "0x16",
"executedTradesCount": 24,
"cancelledTradesCount": 0,
"pendingTradesCount": 0,
"trades": [
{
"sellAmount": "0x94079cd1a42aaa",
"sellAmountInUsd": 0.015667,
"buyAmount": "0x17",
"buyAmountInUsd": 0.016246,
"expectedTradeDate": "2024-10-31T16:01:15Z",
"status": "SUCCEEDED",
"actualTradeDate": "2024-10-31T16:01:56.860Z",
"txHash": "0x25a006ecd.."
},
{
"sellAmount": "0x94079cd1a42aaa",
"sellAmountInUsd": 0.015561,
"buyAmount": "0x16",
"buyAmountInUsd": 0.015482,
"expectedTradeDate": "2024-10-31T17:01:15Z",
"status": "SUCCEEDED",
"actualTradeDate": "2024-10-31T17:01:57.834Z",
"txHash": "0x7972e18b2c.."
}
]
}
],
"size": 25,
"number": 0,
"totalElements": 1,
"totalPages": 1
}
Overview
Fetches all DCA orders created by a trader, with filtering options for order status and pagination support. Each order includes execution history, remaining cycles, and current status.Request
string
required
Trader’s wallet address (hex format)
string
Filter by order status (
INDEXING, ACTIVE, or CLOSED)number
default:0
Page number for pagination
number
default:20
Number of orders per page (max: 50)
string
default:"createdAt,desc"
Sort order. Format:
field,direction- Fields:
createdAt,status,remainingCycles - Direction:
ascordesc
Response
array
required
Array of DCA order objects
Show Order Object
Show Order Object
string
required
The order identifier (UUID format)
number
required
The block number when the order was created
string
required
The timestamp when the order was created (ISO 8601 format)
string
required
The trader address (hex format)
string
required
The order address (hex format)
string
required
The transaction hash of the order creation
string
required
The order class hash
string
required
The sell token address (hex format)
string
required
The total amount you want to invest (hex format)
string
required
The amount that will be sold at each iteration (hex format)
string
required
The buy token address (hex format)
string
required
The start date of the order (ISO 8601 format)
string
required
The end date of the order (ISO 8601 format)
string
The close date of the order (ISO 8601 format)
string
required
The duration between each iteration. Follows ISO 8601 standard
integer
required
The number of iterations
string
required
The order status (
INDEXING, ACTIVE, or CLOSED)object
string
required
The amount already sold
string
required
The amount already bought
string
required
The average amount bought
integer
required
The number of executed trades
integer
required
The number of cancelled trades
integer
required
The number of pending trades
array
required
The trades
Show Trade Object
Show Trade Object
string
required
The amount sold
number
The amount sold in USD
string
The amount bought
number
The amount bought in USD
string
required
The expected trade date (ISO 8601 format)
string
required
The trade status (
PENDING, SUCCEEDED, or CANCELLED)string
The actual trade date (ISO 8601 format)
string
The transaction hash of the trade
string
The error reason. Defined only if the trade failed
integer
required
Page size
integer
required
Current page number (zero-based)
integer
required
Total number of orders
integer
required
Total pages available
curl -X GET "https://starknet.api.avnu.fi/dca/v3/orders?traderAddress=0x0123...&status=ACTIVE"
// Fetch active DCA orders
const params = new URLSearchParams({
traderAddress: account.address,
status: 'ACTIVE',
page: '0',
size: '10'
});
const response = await fetch(`https://starknet.api.avnu.fi/dca/v3/orders?${params}` );
const data = await response.json();
console.log(`Found ${data.totalElements} active orders`);
console.log(`Page ${data.number + 1} of ${data.totalPages}`);
data.content.forEach(order => {
console.log(`Order ${order.orderAddress}: ${order.sellTokenAddress} -> ${order.buyTokenAddress}`);
});
import requests
params = {
'traderAddress': account_address,
'status': 'ACTIVE',
'page': 0,
'size': 10
}
response = requests.get(
'https://starknet.api.avnu.fi/dca/v3/orders',
params=params
)
data = response.json()
orders = data['content']
print(f"Found {data['totalElements']} active orders")
print(f"Page {data['number'] + 1} of {data['totalPages']}")
for order in orders:
print(f"Order {order['orderAddress'][:10]}...")
print(f" Status: {order['status']}")
print(f" Sell: {order['sellTokenAddress']}")
print(f" Buy: {order['buyTokenAddress']}")
{
"content": [
{
"id": "ae1a649c-a9fb-4130-835b-cb14e144e8c1",
"blockNumber": 860820,
"timestamp": "2024-10-31T16:01:15Z",
"traderAddress": "0x25b..",
"orderAddress": "0x50ab..",
"creationTransactionHash": "0x6b65..",
"orderClassHash": "0x2d5af3e59f6b180bb2190957b527dd4db61a2c1095d4fd1e75e3a89732c796b",
"sellTokenAddress": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"sellAmount": "0xde0b6b3a7640000",
"sellAmountPerCycle": "0x94079cd1a42aaa",
"buyTokenAddress": "0x3fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",
"startDate": "2024-10-31T16:01:15Z",
"endDate": "2024-11-01T16:01:15Z",
"closeDate": "2024-11-01T15:02:27.923Z",
"frequency": "PT1H",
"iterations": 24,
"status": "CLOSED",
"pricingStrategy": {},
"amountSold": "0xde0b6b3a763fff0",
"amountBought": "0x214",
"averageAmountBought": "0x16",
"executedTradesCount": 24,
"cancelledTradesCount": 0,
"pendingTradesCount": 0,
"trades": [
{
"sellAmount": "0x94079cd1a42aaa",
"sellAmountInUsd": 0.015667,
"buyAmount": "0x17",
"buyAmountInUsd": 0.016246,
"expectedTradeDate": "2024-10-31T16:01:15Z",
"status": "SUCCEEDED",
"actualTradeDate": "2024-10-31T16:01:56.860Z",
"txHash": "0x25a006ecd.."
},
{
"sellAmount": "0x94079cd1a42aaa",
"sellAmountInUsd": 0.015561,
"buyAmount": "0x16",
"buyAmountInUsd": 0.015482,
"expectedTradeDate": "2024-10-31T17:01:15Z",
"status": "SUCCEEDED",
"actualTradeDate": "2024-10-31T17:01:57.834Z",
"txHash": "0x7972e18b2c.."
}
]
}
],
"size": 25,
"number": 0,
"totalElements": 1,
"totalPages": 1
}
Order Status
- INDEXING: Order is being indexed after creation (temporary state)
- ACTIVE: Order is currently active and executing
- CLOSED: Order has been completed or cancelled
Was this page helpful?
⌘I