POST /smart-sell/create-bot
Create a new Smart Sell bot targeting one pool.
Pool type auto-detected from sPoolId. The pool may be quoted in SOL or
in any other token that has a pool to convert to SOL. Bot activates
immediately and starts listening; fund wallets afterwards.
After the bot is created, fund each wallet in the response with:
- Sell bot (
eMode: "SELL"): the tokens you want the bot to sell, plus a small SOL top-up (≈ 0.01 SOL) for tx fees. - Buy bot (
eMode: "BUY"): SOL only — at least 0.02 SOL per wallet on SOL-quoted pools, 0.1 SOL on token-quoted pools, plus what it should spend.
Use case
React to buys on a pool you control the supply of — e.g. scale out of a position as the price climbs — or, with a buy bot, absorb sells to cushion the price.
Body
| Field | Type | Required | Description |
|---|---|---|---|
sTokenAddress | string | yes | Token mint the bot sells. |
sPoolId | string | yes | Pool to watch. |
nSellPercent | number | yes | % of the triggering trade to trade back (0–100). |
nMarketCap | number | yes | Reactions are skipped when the token's market cap (USD) is below this value. Must be > 0. |
nMinSellAmount | number | yes | Min size of a triggering trade, in eAmountUnit. Must be > 0 and at least the equivalent of 0.1 SOL (see below). |
nMaxSellAmount | number | yes | Max size of a triggering trade, in eAmountUnit (> nMinSellAmount). |
eMode | SELL | BUY | no | SELL (default) reacts to buys by selling; BUY reacts to sells by buying. |
eAmountUnit | QUOTE | SOL | USD | no | Unit of nMinSellAmount / nMaxSellAmount. Default SOL on SOL-quoted pools, USD on token-quoted pools. |
nMaxMarketCap | number | no | BUY bots only: reactions are skipped when the market cap (USD) is above this value. 0 (default) means no ceiling. Must be > nMarketCap when set. |
bConvertProceedsToSol | boolean | no | Default false. For a sell bot on a token-quoted pool: periodically sell the accumulated quote-token proceeds back to SOL. |
eStopPolicy | KEEP | STOP_SAME | STOP_ALL | no | Default KEEP. After the new bot is saved, STOP_SAME stops the caller's other active bots on the same pool with the same eMode; STOP_ALL stops all of them regardless of mode. |
aWhitelistedWallets | string[] | no | Wallets whose trades are ignored. |
aWallets | string[] | no | Existing client-owned wallets the bot trades from. |
bGenerateWallet | boolean | no | If true, the server generates a fresh wallet. Mutually exclusive with aWallets. |
Either aWallets or bGenerateWallet=true must be supplied.
Minimum trigger size
nMinSellAmount must be at least 0.1 SOL of value, expressed in
eAmountUnit: 0.1 for SOL, 0.1 × the SOL price for USD, 0.1 × the
quote's SOL rate for QUOTE. Figures above half a unit are rounded up
to a whole unit. The error message states the exact minimum.
Response 200
{
"nStoppedBots": 0,
"message": "Smart sell bot created. Send tokens and 0.01 SOL to wallets.",
"botId": "<id>",
"wallets": ["<pubkey>"]
}
| Field | Description |
|---|---|
nStoppedBots | Number of other bots stopped because of eStopPolicy. 0 for KEEP. |
message | For a buy bot: Smart buy bot created. Fund the wallets with SOL (at least 0.02 SOL each on SOL pairs, 0.1 SOL on token-quoted pairs, plus what it should spend). |
Errors
| Status | Meaning |
|---|---|
400 | Validation failed (including nMaxMarketCap set on a SELL bot); invalid token / pool / unsupported pool type; the pool's quote token has no SOL pool to convert on; nMinSellAmount below the minimum for the unit; or wallets don't belong to caller. |
500 | Pool 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
}'