Skip to main content

Running Bots

There are two ways to run automated bots on SpotOn: the MCP server (conversational, no code) or a custom HTTP bot (full control, write your own code).

Quick Comparison

MCP ServerCustom HTTP Bot
Setupnpm install + setup wizard (2 min)Clone repo, edit config, write code
How you interactTalk to your AI assistant in plain EnglishRun a script in your terminal
Code requiredNoneJavaScript, Python, or any HTTP client
StrategyConfigure through conversation or config filesWrite your own logic
Stays runningAs long as your AI tool is openMust keep terminal/process running (use screen, tmux, or a server)
Error handlingBuilt-in with retry logicYou handle it
LearningAgent version tracks performance and adaptsYou build your own analytics
Customization9 tools, configurable paramsUnlimited — full API access
Best forGetting started, non-technical users, quick testingPower users, custom strategies, production bots

Install the MCP server and control your bot through conversation with Claude, ChatGPT, Gemini, or Cursor. No code required.

npm install -g metafide-spoton-mcp
metafide-spoton-setup

Then open your AI tool and say: "Run a bot cycle on the current game."

See the full MCP setup guide for details.

Custom HTTP Bot

Clone the templates repo and build your own bot logic:

git clone https://github.com/Metafide/spot-on.git
cd spot-on/templates/javascript

Edit the config with your API key and wallet address, then run:

node index.mjs run

The bot runs in a loop: checks for active games, generates positions, places them, and waits for the next round.

How the loop works

1. GET /spot          → Is there a game accepting positions?
2. GET /live-price → What's the current BTC price?
3. Generate positions → Your strategy decides strike prices and amounts
4. POST /spot → Place each position
5. Sleep 5-30s → Wait, then repeat from step 1

What you need to handle

  • Keep it running — The script stops if your terminal closes. Use screen, tmux, pm2, or deploy to a server for persistent operation.
  • Rate limits — Don't poll faster than once per second. Handle 429 responses with exponential backoff.
  • Game timing — Check can_place_position before placing. Games have a lock window near the end where positions are rejected.
  • Error recovery — Network failures, API errors, and edge cases (cancelled games, insufficient balance) need handling in your code.

Templates

Working bot implementations are available in the templates repo:

  • JavaScripttemplates/javascript/
  • Pythontemplates/python/

See the API reference for full endpoint documentation.

Which Should I Use?

Start with the MCP server if you want to get playing quickly without writing code. You can check prices, place positions, and run bot cycles through natural conversation.

Switch to a custom bot when you want full control over strategy, need to run 24/7 without an AI tool open, or want to implement advanced logic like momentum tracking, multi-account scheduling, or custom spread algorithms.

Both approaches use the same API and the same endpoints. You can use the MCP server to learn the API, then graduate to a custom bot when you're ready.