Skip to main content

PATCH /flexi/stop/bulk

Schedule stop-and-withdraw for multiple bots. Each bot finishes its current swap, then withdraws remaining funds.

Async: each bot finishes its current swap, then drains remaining funds to sWithdrawWalletAddress.

Use case​

Campaign over or funds need to move — end the whole group cleanly and reclaim SOL in one call.

Body​

FieldTypeRequiredDescription
botIdsstring[]yes1–20 bot ids, no duplicates.
sWithdrawWalletAddressstringyesDestination for remaining funds. Must be a valid Solana public key and not the system program address (11111111111111111111111111111111).

Response 200​

{ "message": "Bots marked to be stopped" }

Errors​

StatusMeaning
400Validation failed, or one of the running bots is already merging, splitting or scheduled to stop.
404None of the ids is a running bot of the caller.

Example​

curl -X PATCH "$BASE_URL/flexi/stop/bulk" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Content-Type: application/json" \
-d '{ "botIds": ["<id1>", "<id2>"], "sWithdrawWalletAddress": "<wallet>" }'