curl -X POST "https://starknet.api.avnu.fi/dca/v3/orders/0x0a1b2c3d.../cancel"
// Cancel a DCA order
const orderAddress = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789";
const response = await fetch(
`https://starknet.api.avnu.fi/dca/v3/orders/${orderAddress}/cancel`,
{
method: 'POST',
}
);
const { calls } = await response.json();
// Execute the cancellation
const tx = await account.execute(calls);
console.log(`Order cancelled: ${tx.transaction_hash}`);
// Remaining funds are automatically returned to your wallet
import requests
order_address = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789"
response = requests.post(
f'https://starknet.api.avnu.fi/dca/v3/orders/{order_address}/cancel'
)
calls = response.json()['calls']
# Execute cancellation through your account
# Remaining funds will be returned
{
"chainId": "0x534e5f4d41494e",
"calls": [
{
"contractAddress": "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789",
"entrypoint": "cancel_order",
"calldata": []
}
]
}
Recurring Buy
Cancel DCA Order
Generate calldata to cancel an active DCA order and return remaining funds
POST
/
dca
/
v3
/
orders
/
{address}
/
cancel
curl -X POST "https://starknet.api.avnu.fi/dca/v3/orders/0x0a1b2c3d.../cancel"
// Cancel a DCA order
const orderAddress = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789";
const response = await fetch(
`https://starknet.api.avnu.fi/dca/v3/orders/${orderAddress}/cancel`,
{
method: 'POST',
}
);
const { calls } = await response.json();
// Execute the cancellation
const tx = await account.execute(calls);
console.log(`Order cancelled: ${tx.transaction_hash}`);
// Remaining funds are automatically returned to your wallet
import requests
order_address = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789"
response = requests.post(
f'https://starknet.api.avnu.fi/dca/v3/orders/{order_address}/cancel'
)
calls = response.json()['calls']
# Execute cancellation through your account
# Remaining funds will be returned
{
"chainId": "0x534e5f4d41494e",
"calls": [
{
"contractAddress": "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789",
"entrypoint": "cancel_order",
"calldata": []
}
]
}
Overview
Cancels an active DCA order and returns any remaining funds to the trader. This endpoint generates the calldata needed to execute the cancellation on-chain.Request
string
required
DCA order contract address to cancel
Response
string
required
Network identifier (e.g., “0x534e5f4d41494e”)
array
required
curl -X POST "https://starknet.api.avnu.fi/dca/v3/orders/0x0a1b2c3d.../cancel"
// Cancel a DCA order
const orderAddress = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789";
const response = await fetch(
`https://starknet.api.avnu.fi/dca/v3/orders/${orderAddress}/cancel`,
{
method: 'POST',
}
);
const { calls } = await response.json();
// Execute the cancellation
const tx = await account.execute(calls);
console.log(`Order cancelled: ${tx.transaction_hash}`);
// Remaining funds are automatically returned to your wallet
import requests
order_address = "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789"
response = requests.post(
f'https://starknet.api.avnu.fi/dca/v3/orders/{order_address}/cancel'
)
calls = response.json()['calls']
# Execute cancellation through your account
# Remaining funds will be returned
{
"chainId": "0x534e5f4d41494e",
"calls": [
{
"contractAddress": "0x0a1b2c3d4e5f6789abcdef0123456789abcdef0123456789abcdef0123456789",
"entrypoint": "cancel_order",
"calldata": []
}
]
}
Was this page helpful?
⌘I