
by Sidepit
No reviews yetAI agent trading skill for Sidepit's 1-second discrete auction exchange — submit orders, subscribe to market data, manage positions, and persist all auction activity to SerenDB via NNG/protobuf API.
Skill instructions are preloaded in context when this skill is active. Do not perform filesystem searches or tool-driven exploration to rediscover them; use the guidance below directly.
Connects an AI agent to Sidepit's discrete-auction exchange. Sidepit runs 1-second auction cycles where all orders clear at a single price — no front-running, no adverse selection, no phantom liquidity. The auction timing matches LLM inference speed (100ms–2s), making it the only exchange where AI agents compete on intelligence, not co-location hardware.
All auction activity — orders, fills, market snapshots, and position state — is persisted to SerenDB for analysis, backtesting, and agent learning.
| Traditional Exchange | Sidepit | |---|---| | HFT executes in 1–10μs (co-located silicon) | 1-second auction cycles match LLM inference | | Orders front-run before fill | All orders submitted simultaneously | | Phantom liquidity vanishes under volatility | Single clearing price per auction — deterministic | | Slippage and adverse selection | No speed penalty — intelligence is the edge |
US Patent US10608825B2 — Discrete Limit Order Book (DLOB).
| Layer | Technology |
|---|---|
| Messaging | NNG (nanomsg next gen) — Push, Sub, Req/Rep patterns |
| Serialization | Protocol Buffers (protobuf) |
| Signing | ECDSA on Bitcoin secp256k1 curve (WIF private key) |
| Transport | TCP to api.sidepit.com |
| Persistence | SerenDB (Postgres) via mcp__seren__run_sql |
Immediately run a dry-run scan without asking. Do not present a menu of modes. Follow the workflow below to connect to the Sidepit price feed, capture market state, and simulate order placement. Display the full market snapshot and simulated orders to the user. Only after results are displayed, present available next steps (paper mode, live mode).
connect_feed uses connector.sidepit_exchange.subscribe_feed — subscribe to NNG price feed on port 12122fetch_depth uses connector.sidepit_exchange.get_depth — query full DLOB depth via NNG req/rep on port 12125reason uses transform.agent_inference — agent reasons on order book state within 800ms budgetsubmit_order uses connector.sidepit_exchange.send_order — submit signed order via NNG push on port 12121persist_activity uses state.auction_activity.upsert — persist orders, fills, snapshots to SerenDB| Protocol | Port | Pattern | Direction | |---|---|---|---| | Client (orders) | 12121 | Pipeline (Push) | Client → Server | | Price Feed | 12122 | Pub/Sub | Server → Client | | Echo (confirmations) | 12123 | Pub/Sub | Server → Client | | Position Query | 12125 | Req/Rep | Bidirectional |
NewOrder — submit a limit order into the next auction:
| Field | Type | Description |
|---|---|---|
| side | int | 1 = buy, -1 = sell |
| size | int | Quantity |
| price | int | Limit price |
| ticker | string | Contract symbol (e.g. USDBTCH26) |
CancelOrder — cancel a pending order by ID:
| Field | Type | Description |
|---|---|---|
| cancel_orderid | string | sidepit_id:timestamp_ns |
AuctionBid — bid for order priority within an auction epoch:
| Field | Type | Description |
|---|---|---|
| epoch | int | Auction epoch number |
| hash | string | Commitment hash |
| ordering_salt | string | Salt for ordering |
| bid | int | Bid amount in satoshis |
Received on port 12122 as MarketData protobuf messages:
| Field | Description |
|---|---|
| MarketQuote | bidsize, bid, ask, asksize, last, lastsize, upordown, symbol, epoch |
| EpochBar | symbol, epoch, open, high, low, close, volume |
| DepthItem[10] | level, bid, ask, bidsize, asksize (10 levels of book depth) |
Every order is signed with ECDSA (secp256k1):
SignedTransaction protobuf with transaction fieldsversion=1, timestamp in nanoseconds, sidepit_idtransaction bytessignature field to hex-encoded compact signatureSignedTransaction and send via NNG PushAll auction activity is persisted to SerenDB for analysis and agent learning.
auction_orders — every order submitted (or simulated in dry-run)auction_fills — fill confirmations with aggressive/passive sidesmarket_snapshots — DLOB state captured each auction cycleposition_snapshots — trader position and avg price after each cycleSchema: sql/schema.sql
Storage uses MCP-native SQL:
mcp__seren__run_sql for reads and single writesmcp__seren__run_sql_transaction for multi-table upsertssidepit-auction-tradersidepit_auction_traderThe words exit, close, unwind, cancel, and stop are immediate operator instructions. When the user issues any of these, the agent must:
Before executing any live transaction the agent must:
SIDEPIT_ID is set and validSIDEPIT_SECRET (WIF private key) is settcp://api.sidepit.com:12121All dependencies are validated at startup. If any are missing the agent prints a diagnostic and exits non-zero.
SIDEPIT_ID — Sidepit trader ID (ordinals address / pubkey)SIDEPIT_SECRET — WIF-encoded private key (never logged)SEREN_API_KEY — Seren gateway API keypynng, protobuf==3.20.1, secp256k1, base58, python-dotenv, psycopg[binary]dry-run — simulate full pipeline, persist simulated orders to SerenDB (default)live — sign and submit real orders to Sidepit exchangeDefault mode is dry-run. The agent simulates the full pipeline (subscribes to feed, reasons on state, builds orders) without sending signed transactions.
To execute live:
python scripts/agent.py --config config.json --yes-live
The --yes-live flag is the single live gate. Without it, no order is signed or submitted.
python scripts/agent.py stop --config config.json --yes-live
This will:
When this skill is invoked, immediately run:
python scripts/agent.py --config config.json
| Variable | Required | Description |
|---|---|---|
| SIDEPIT_ID | Yes | Your Sidepit trader ID (ordinals address / pubkey) |
| SIDEPIT_SECRET | Yes | WIF-encoded private key for signing orders (never logged) |
| SEREN_API_KEY | Yes | Seren API key — get from Seren Desktop or https://serendb.com |
| SERENDB_URL | No | Explicit SerenDB connection string (auto-resolved if empty) |
Before running this skill, check for an existing Seren API key in this order:
API_KEY automatically. Check: echo $API_KEY. If set, no further action is needed..env file — check if SEREN_API_KEY is already set in the skill's .env file. If set, no further action is needed.SEREN_API_KEY is exported in the current shell. If set, no further action is needed.Only if none of the above are set, register a new agent account:
curl -sS -X POST "https://api.serendb.com/auth/agent" \
-H "Content-Type: application/json" \
-d '{"name":"sidepit-auction-trader"}'
Extract the API key from the response at .data.agent.api_key — this key is shown only once. Write it to the skill's .env file:
SEREN_API_KEY=<the-returned-key>
Verify:
curl -sS "https://api.serendb.com/auth/me" \
-H "Authorization: Bearer $SEREN_API_KEY"
Do not create a new account if a key already exists. Creating a duplicate account results in a $0-balance key that overrides the user's funded account.
Reference: https://docs.serendb.com/skills.md
cd sidepit/auction-trader
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
cp config.example.json config.json
Clone the protobuf definitions and compile:
git submodule update --init
protoc --proto_path=proto/ --python_out=proto/ sidepit_api.proto
| Component | Estimated Cost | |---|---| | NNG connection | Free (direct TCP) | | Order submission | Exchange trading fees per contract | | Market data feed | Free (pub/sub) | | Position queries | Free (req/rep) | | SerenDB persistence | Included with Seren API key |
Free
npx skills add serenorg/seren-skillsSelect “Sidepit Auction Trader” when prompted
Sidepit
Added March 30, 2026