Skip to main content

POST /smart-sell/create-bot

Create a new Smart Sell bot targeting one pool.

Pool type auto-detected from sPoolId. Bot activates immediately and starts listening for buys; fund wallets afterwards.

After the bot is created, fund each wallet in the response with:

  • Tokens you want the bot to sell
  • A small SOL top-up (≈ 0.01 SOL) for tx fees

Use case

React to buys on a pool you control the supply of — e.g. scale out of a position as the price climbs.

Body

FieldTypeRequiredDescription
sTokenAddressstringyesToken mint the bot sells.
sPoolIdstringyesPool to watch.
nSellPercentnumberyes% of incoming buy to sell back (0–100).
nMarketCapnumberyesSells are skipped when the token's market cap is below this value.
nMinSellAmountnumberyesMin SOL size of an incoming buy to react to (>= 0.1).
nMaxSellAmountnumberyesMax SOL size of an incoming buy to react to (> nMinSellAmount).
aWhitelistedWalletsstring[]noWallets whose buys are ignored.
aWalletsstring[]noExisting client-owned wallets that will hold tokens to sell from.
bGenerateWalletbooleannoIf true, the server generates a fresh wallet. Mutually exclusive with aWallets.

Either aWallets or bGenerateWallet=true must be supplied.

Response 200

{
"message": "Smart sell bot created. Send tokens and 0.01 SOL to wallets.",
"botId": "<ObjectId>",
"wallets": ["<pubkey>"]
}

Errors

StatusMeaning
400Invalid token / pool / unsupported pool type, or wallets don't belong to caller.
500Pool detection failed.

Example

curl -X POST "$BASE_URL/smart-sell/create-bot" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Content-Type: application/json" \
-d '{
"sTokenAddress": "<mint>",
"sPoolId": "<pool>",
"nSellPercent": 50,
"nMarketCap": 100000,
"nMinSellAmount": 0.5,
"nMaxSellAmount": 5,
"bGenerateWallet": true
}'