npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openclaw-sidex-kit

v1.0.0

Published

SDK for building autonomous AI trading agents on Sidex — with survival mechanics, multi-LLM support, risk management, and multi-exchange pipelines.

Downloads

94

Readme


About Sidex

Sidex is turning trading into a game.

We provide a cutting-edge platform featuring 1v1 Duels, Battle Royale, Tap Trading, and other gamified financial experiences. Our mission is to make high-frequency trading accessible, engaging, and competitive.

Developer Ecosystem (devs.sidex.fun)

This repository is the official starter kit for OpenClaw, the autonomous agent framework for Sidex.

The Sidex Developer Platform allows engineers to build, test, and refine automated trading strategies in a Real-Time Simulated Crypto Futures Environment.

  • Real Market Conditions: We stream live market data to ensure your algorithms face reality.
  • Risk-Free Testing: limitless paper trading environment to perfect your strategy before deployment.
  • Universal Architecture: Once tested, your agent is ready to deploy on any major exchange using our standardized pipelines.

Universal Pipelines

The OpenClaw Kit features a modular pipeline architecture, allowing your agent to interface with major Decentralized (DEX) and Centralized (CEX) exchanges using a unified command structure.

| Exchange | Type | Support | | :--- | :--- | :--- | | Hyperliquid | DEX (Perps) | Model Included | | Binance | CEX (Futures) | Model Included | | Bybit | CEX (Unified) | Model Included | | Solana (Jupiter) | DEX (Spot) | Model Included | | Uniswap | DEX (EVM) | Model Included | | Polymarket | Prediction (Polygon) | Model Included |

Autonomous Economics (x402)

OpenClaw Agents are equipped with an integrated Economic Core powered by the x402 Protocol. This allows agents to autonomously buy and sell resources machine-to-machine.

  • Self-Sufficiency: Agents can pay for premium trading signals, news feeds, or computational power using their own crypto wallet.

  • Auto-Negotiation: The kit automatically handles 402 Payment Required responses, paying the vendor and retrieving the data in a single flow.

  • Multichain: Built on viem, supporting payments on any EVM chain (Base, Polygon, Arbitrum, etc.).

Survival Mode (Evolutionary Logic)

Inspired by biological systems, the Survival Manager adjusts the agent's behavior based on its PnL health. It uses hysteresis to prevent rapid state oscillation and emits events via the internal EventBus for all modules to react.

| State | Trigger | Behavior | | :--- | :--- | :--- | | Growth | Profit > 20% | Aggressive scanning, higher leverage allowed, x402 budget unlocked | | Survival | Neutral zone | Balanced risk, normal operation | | Recovery | Improving from Defensive | Cautious optimism, gradual risk increase | | Defensive | Loss > 15% | Reduced risk, frozen x402 budget, slower loop | | Critical | Loss > 50% | Graceful shutdown — closes all positions and preserves capital |

Note: This works on both Simulations (Sidex Devs) and Real Exchanges.

Quick Start

Option A: One-Command Full Install (Recommended)

The full installer handles everything — system dependencies, Node.js, npm packages, Ollama (local AI), LLaMA 3.3 model download, and .env configuration — in a single interactive script.

git clone https://github.com/sidex-fun/openclaw-sidex-kit.git
cd openclaw-sidex-kit
bash quick-setup/install.sh

What it installs: curl, git, wget, Node.js (v20+), all npm dependencies, Ollama for local AI, and the LLaMA 3.3 model. It also walks you through configuring your .env with Sidex tokens, exchange keys, and wallet setup.

Option B: Manual Installation

If you prefer to install things yourself:

git clone https://github.com/sidex-fun/openclaw-sidex-kit.git
cd openclaw-sidex-kit
npm install

Then run the interactive configuration wizard:

npm run setup

This wizard will generate your .env file with the correct API keys and features enabled.

AI Model Setup

OpenClaw agents work best with a local LLM via Ollama. This avoids API costs and content-policy restrictions that external providers (GPT, Claude) impose on trading-related prompts.

# Install Ollama (Linux)
curl -fsSL https://ollama.com/install.sh | sh

# Download the recommended model
ollama pull llama3.3

# Start the server
ollama serve

⚠ External APIs (GPT, Claude, etc.): You can configure them in .env, but they have content filters and rate limits that may block trading analysis prompts. Local LLaMA 3.3 is strongly recommended for full, unrestricted functionality.

Usage

Autonomous Mode — Start the full agent loop (recommended):

npm start

The agent will connect to live market data, consult the LLM every cycle, and execute trades autonomously based on risk parameters.

Manual Pipeline Commands — Execute individual trades directly:

# Binance Pipeline
node pipelines/binance/scripts/trade.mjs --symbol="BTCUSDT" --side="buy" --amount="0.01" --api_key="..."

# Sidex Simulation
node skills/sidex_trader/scripts/trade.mjs --symbol="BTC/USDT" --side="buy" --amount="100" --leverage="10" --token="YOUR_TOKEN"

🤖 Autonomous Agent Architecture

The kit features a fully autonomous Agent Orchestrator that runs a continuous decision loop:

┌─────────────────────────────────────────────────┐
│              AgentOrchestrator                   │
│   gatherSignals → think → riskFilter → execute  │
│                    ↕ monitor                     │
├───────────┬───────────┬────────────┬─────────────┤
│  Market   │  Signal   │   Risk     │  Position   │
│  DataFeed │  Ingester │   Manager  │  Manager    │
│  (prices, │  (social, │  (sizing,  │ (tracking,  │
│   RSI,    │   news,   │   limits,  │  TP/SL,     │
│   EMA,    │   alpha)  │  survival) │  PnL)       │
│   ATR)    │           │            │             │
├───────────┴───────────┴────────────┴─────────────┤
│               EventBus (Internal Comms)          │
├───────────┬───────────┬────────────┬─────────────┤
│  Binance  │  Hyper-   │   Sidex    │ Polymarket  │
│  Pipeline │  liquid   │  Gateway   │  Pipeline   │
├───────────┴───────────┴────────────┴─────────────┤
│      LLM Client       │     x402 / Wallet        │
│  (Ollama/OpenAI/Claude)│    (On-chain Payments)   │
└────────────────────────┴─────────────────────────┘

Core Modules

| Module | Description | | :--- | :--- | | AgentOrchestrator | Main loop — gathers signals, consults LLM, filters risk, executes trades, monitors positions | | LLMClient | Unified interface for Ollama, OpenAI, and Anthropic. Returns structured JSON trading decisions | | MarketDataFeed | Real-time prices via Binance WebSocket. Calculates RSI(14), EMA(20/50), ATR(14) in-memory | | PositionManager | Tracks open positions, auto-triggers Stop-Loss/Take-Profit, persists state to disk | | RiskManager | Position sizing, exposure limits, per-asset caps. Adapts dynamically to Survival state | | SurvivalManager | Biological state machine with hysteresis. Emits events for all modules to react | | EventBus | Singleton event system for decoupled module communication | | X402Client | Handles 402 Payment Required flows for machine-to-machine payments |

Agent Loop Cycle

  1. Gather Signals — Reads alpha_db.json from Social Alpha Miner for recent high-confidence signals
  2. Think (Council Debate) — The Council of AI (Technician, Sentinel, Guardian) debates the trade. A Leader synthesizes the final decision.
  3. Risk Filter — Validates the decision against position limits, exposure caps, and survival state
  4. Execute — Dispatches the trade to the appropriate pipeline (Sidex, Binance, Hyperliquid, etc.)
  5. Monitor — Updates unrealized PnL, checks TP/SL levels, feeds the Survival Manager

The loop interval adapts automatically: faster in Growth (more opportunities), slower in Defensive (conserve resources).

📂 Project Structure

  • /core: The brain of the agent — Orchestrator, LLM, Market Data, Positions, Risk, Survival, x402.
  • /pipelines: Connectors for different exchanges (Hyperliquid, Binance, Bybit, Polymarket, etc.).
  • /skills: Advanced capabilities (Social Alpha Miner, Sidex Trader, MoltBook Analyst).
  • /quick-setup: Interactive configuration scripts.
  • /data: Persisted agent state and position data (auto-generated).
  • agent.js: Main entry point — run with npm start.

🧠 Social Alpha Miner

The kit includes an NLP engine that monitors social platforms for trading signals.

  • Impact Engine: Detects CRITICAL news from VIP accounts (Donald Trump, Saylor, etc.).
  • Sentiment Analysis: Converts "tweets" into actionable code instructions (URGENT_BULLISH_ACTION).
  • Sources: Twitter/X, Colosseum, and MoltBook.
  • Integration: Signals are stored in alpha_db.json and automatically consumed by the Agent Orchestrator each cycle.

🏛️ Council of AI (Multi-Persona Debate)

To ensure robust decision making, the agent uses a Multi-Persona Debate System instead of a single LLM prompt. Before every trade, a virtual council meets:

  • The Technician 📈: Analyzes pure market data (RSI, EMA, Price Action).
  • The Sentinel 📰: Analyzes social sentiment and news signals.
  • The Guardian 🛡️: A pessimist risk manager who vetoes reckless moves.
  • The Leader 👑: Synthesizes all reports and makes the final execution decision.

This "Mixture of Agents" approach reduces hallucinations and ensures balanced trading strategies.

Documentation

For full API references and architecture guides, visit the official documentation: devs.sidex.fun/documentation