Auto Trade Feature
The Auto Trade module in ShillBill enables automated trading of Solana-based tokens via programmable triggers for buying and selling. It operates through a chat-based interface and integrates with wallet state, real-time market feeds, and configurable execution parameters.
Summary
Interface: Chat-based interaction with bot backend
Trigger Types: Conditional Buy, Conditional Sell (Take Profit, Stop Loss)
Execution Layer: Direct integration with user wallet via transaction signing
Pricing Feeds: Real-time token data via on-chain and third-party APIs
1. Entry Point
Users initiate a session by sending a token contract address to the bot. This triggers the loading of the Token Info Screen, where relevant metrics and actions become available.
User ➝ Bot: <Token CA>
Bot ➝ UI: Load Token Info Screen
2. Token Info Screen
Data Fields Displayed (conditional rendering):
Static:
Token Name, Chart Link, Explorer URL
Mintable / Freezable flags
Dynamic (if token held):
Balance (Token + SOL)
Current Value (USD, SOL)
P/L metrics (percentage and absolute)
Market:
Market Cap, Liquidity (USD), Volume (USD)
Price change deltas (5m, 1h, 6h, 24h)
Wallet:
Current SOL balance
3. Buy Workflow
Input Options:
Fixed amount (e.g., 0.05, 0.1 SOL)
Custom amount
Trigger: auto-buy if price drops to a defined threshold
Trigger Logic:
if token_price <= current_price * (1 - trigger_pct):
execute_buy(wallet, amount_SOL)
Trigger Parameters:
trigger_pct
: % drop from initial pricetrigger_price
: optional absolute USD price override
Execution:
Uses available wallet SOL balance
Respects slippage tolerance setting
4. Sell Workflow
Manual Sells:
Fixed %: 50%, 75%, 100%
Custom %
Auto Sell Configuration:
Two independent conditions:
Take Profit (TP)
Stop Loss (SL)
{
"tp_enabled": true,
"tp_pct": 2.5, // e.g., 250%
"tp_sell_pct": 100,
"sl_enabled": true,
"sl_pct": 0.1, // e.g., 10%
"sl_sell_pct": 75,
"slippage": 0.05 // 5%
}
Trigger Mechanics:
# On-chain listener or off-chain polling
if price >= avg_buy_price * (1 + tp_pct):
sell(wallet, 100%)
if price <= avg_buy_price * (1 - sl_pct):
sell(wallet, 75%)
All values in USD unless explicitly set in %
Slippage controls are applied per tx
5. Trigger System
Trigger Evaluation Engine runs on price deltas using polling or webhooks.
Trigger types:
PRICE >= TP
: fires full/partial sellPRICE <= SL
: fires full/partial sellPRICE <= Buy Trigger
: initiates buy order
Execution Considerations:
Wallet must have sufficient funds
Tokens must not be frozen or illiquid
Slippage tolerance is enforced via transaction settings
Orders may fail if:
Insufficient liquidity
RPC/network error
Price has already moved beyond tolerance
6. Button/Trigger Customization
All UI buttons and trigger presets are user-configurable, including:
Buy/Sell fixed values
TP/SL percentages
Slippage (default: 10%)
Order percentages (partial/full sell)
Presets stored locally or server-side.
7. Failure Modes & Troubleshooting
Token Info doesn’t load
Invalid CA / RPC delay
Retry or validate address
Trigger doesn’t execute
Insufficient balance / price never reached / slippage too tight
Adjust slippage or monitor market manually
Order fails
Token frozen, liquidity issues
Verify mintable/freezable flags; reduce amount
8. Example Use Case

1. User sends Token CA in chat.
2. Bot returns token info (market stats + wallet data).
3. User buys 0.1 SOL worth of Token.
4. Sets Auto Buy if price drops 20% below current.
5. Configures:
- Take Profit: +250%, sell 100%
- Stop Loss: -10%, sell 75%
6. System monitors triggers; executes trades accordingly.
Notes
All trade actions invoke wallet prompts (user-side signature required unless auto-authorized).
On-chain reads use standard Quicknode RPC and price oracles.
Last updated