Skip to main content

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​

FieldTypeRequiredDescription
sTokenAddressstringyesToken mint the bot sells.
sPoolIdstringyesPool to watch.
nSellPercentnumberyes% of the triggering trade to trade back (0–100).
nMarketCapnumberyesReactions are skipped when the token's market cap (USD) is below this value. Must be > 0.
nMinSellAmountnumberyesMin size of a triggering trade, in eAmountUnit. Must be > 0 and at least the equivalent of 0.1 SOL (see below).
nMaxSellAmountnumberyesMax size of a triggering trade, in eAmountUnit (> nMinSellAmount).
eModeSELL | BUYnoSELL (default) reacts to buys by selling; BUY reacts to sells by buying.
eAmountUnitQUOTE | SOL | USDnoUnit of nMinSellAmount / nMaxSellAmount. Default SOL on SOL-quoted pools, USD on token-quoted pools.
nMaxMarketCapnumbernoBUY bots only: reactions are skipped when the market cap (USD) is above this value. 0 (default) means no ceiling. Must be > nMarketCap when set.
bConvertProceedsToSolbooleannoDefault false. For a sell bot on a token-quoted pool: periodically sell the accumulated quote-token proceeds back to SOL.
eStopPolicyKEEP | STOP_SAME | STOP_ALLnoDefault 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.
aWhitelistedWalletsstring[]noWallets whose trades are ignored.
aWalletsstring[]noExisting client-owned wallets the bot trades from.
bGenerateWalletbooleannoIf 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>"]
}
FieldDescription
nStoppedBotsNumber of other bots stopped because of eStopPolicy. 0 for KEEP.
messageFor 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​

StatusMeaning
400Validation 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.
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
}'