Skip to content

clawsteragent/clawster-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

   β–„β–ˆβ–ˆβ–ˆβ–ˆβ–„   β–ˆβ–ˆβ–“    β–„β–„β–„       β–ˆ     β–ˆβ–‘  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–“β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  β–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆ  
  β–’β–ˆβ–ˆβ–€ β–€β–ˆ  β–“β–ˆβ–ˆβ–’   β–’β–ˆβ–ˆβ–ˆβ–ˆβ–„    β–“β–ˆβ–‘ β–ˆ β–‘β–ˆβ–‘β–’β–ˆβ–ˆ    β–’ β–“  β–ˆβ–ˆβ–’ β–“β–’β–“β–ˆ   β–€ β–“β–ˆβ–ˆ β–’ β–ˆβ–ˆβ–’
  β–’β–“β–ˆ    β–„ β–’β–ˆβ–ˆβ–‘   β–’β–ˆβ–ˆ  β–€β–ˆβ–„  β–’β–ˆβ–‘ β–ˆ β–‘β–ˆ β–‘ β–“β–ˆβ–ˆβ–„   β–’ β–“β–ˆβ–ˆβ–‘ β–’β–‘β–’β–ˆβ–ˆβ–ˆ   β–“β–ˆβ–ˆ β–‘β–„β–ˆ β–’
  β–’β–“β–“β–„ β–„β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–‘   β–‘β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆ β–‘β–ˆβ–‘ β–ˆ β–‘β–ˆ   β–’   β–ˆβ–ˆβ–’β–‘ β–“β–ˆβ–ˆβ–“ β–‘ β–’β–“β–ˆ  β–„ β–’β–ˆβ–ˆβ–€β–€β–ˆβ–„  
  β–’ β–“β–ˆβ–ˆβ–ˆβ–€ β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–“β–ˆ   β–“β–ˆβ–ˆβ–’β–‘β–‘β–ˆβ–ˆβ–’β–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’  β–’β–ˆβ–ˆβ–’ β–‘ β–‘β–’β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–“ β–’β–ˆβ–ˆβ–’
  β–‘ β–‘β–’ β–’  β–‘β–‘ β–’β–‘β–“  β–‘β–’β–’   β–“β–’β–ˆβ–‘β–‘ β–“β–‘β–’ β–’  β–’ β–’β–“β–’ β–’ β–‘  β–’ β–‘β–‘   β–‘β–‘ β–’β–‘ β–‘β–‘ β–’β–“ β–‘β–’β–“β–‘
    β–‘  β–’   β–‘ β–‘ β–’  β–‘ β–’   β–’β–’ β–‘  β–’ β–‘ β–‘  β–‘ β–‘β–’  β–‘ β–‘    β–‘     β–‘ β–‘  β–‘  β–‘β–’ β–‘ β–’β–‘
  β–‘          β–‘ β–‘    β–‘   β–’     β–‘   β–‘  β–‘  β–‘  β–‘    β–‘         β–‘     β–‘β–‘   β–‘ 
  β–‘ β–‘          β–‘  β–‘     β–‘  β–‘    β–‘          β–‘              β–‘  β–‘   β–‘     
  β–‘                                                                    

OpenClaw Node.js Aster DEX ERC-8004 License: MIT

Autonomous perpetual futures trading for AI agents

🌐 Website: clawster.org


🎯 Features

πŸ€– Autonomous Trading β€” No human intervention required
πŸ“Š Multi-Market Support β€” Trade BTC, ETH, and more perpetual futures
πŸ›‘οΈ Risk Management β€” Hard-coded safety limits and position sizing
⚑ Real-time Execution β€” WebSocket streaming for instant market response
πŸ” ERC-8004 Compliant β€” Blockchain-registered AI agent identity
πŸ“ˆ Strategy Engine β€” Trend following, scalping, and custom strategies
πŸ’° P&L Tracking β€” Comprehensive profit/loss monitoring
πŸ”„ Auto-rebalancing β€” Dynamic position management

πŸ—οΈ Architecture

Clawster follows a "brain + manuals" architecture:

🧠 The Brain

  • SKILL.md β€” Core trading logic, risk management, and state machine
  • Main decision engine that orchestrates all trading operations

πŸ“š The Manuals

  • 13 aster-api- skills* β€” API reference documentation loaded on demand
  • Sourced from asterdex/aster-skills-hub
  • Includes authentication, market data, trading, websockets, and error handling

This separation ensures the core logic stays focused while API details remain modular and updateable.

πŸš€ Quick Start

1. Clone & Enter

git clone https://github.com/clawsteragent/clawster-skill.git
cd clawster-skill

2. Install & Configure

node install.js

This handles:

  • ERC-8004 agent registration on BSC
  • Cloning of aster-api-* skills from GitHub
  • npm dependency installation
  • .env configuration setup

3. Start Trading

openclaw gateway restart
# Chat with Clawster to begin trading!

πŸ“¦ Installation Details

The install.js script performs these operations:

  1. ERC-8004 Registration

    • Registers your agent identity on Binance Smart Chain
    • Creates immutable on-chain proof of AI agent existence
    • Requires ~0.005 BNB for gas fees
  2. Skill Dependencies

    • Clones 13 aster-api-* skills from aster-skills-hub
    • Installs to ~/.openclaw/skills/ directory
    • Skills loaded dynamically as needed
  3. Dependencies

    • Runs npm install --production
    • Installs ethers.js for blockchain interactions
    • Sets up secure file permissions
  4. Environment Setup

    • Creates .env with API credentials
    • Configures trading parameters
    • Sets secure file permissions (600 on Unix systems)

βš™οΈ Configuration

Edit your configuration in TOOLS.md under ### Clawster Config:

### Clawster Config
- agent_id: 12345
- trading_pairs: BTCUSDT,ETHUSDT,SOLUSDT
- max_leverage: 10
- max_position_pct: 20
- max_concurrent: 3
- stop_loss: required
- daily_loss_pct: 5
- max_drawdown_pct: 15
- max_risk_per_trade: 2
- cooldown_after_losses: 3
- cooldown_minutes: 60
- max_daily_trades: 50
- strategy: trend_follower

Parameters

Parameter Default Description
agent_id (required) ERC-8004 agent ID from registration
trading_pairs BTCUSDT,ETHUSDT Comma-separated trading pairs
max_leverage 10 Maximum leverage multiplier
max_position_pct 20 Max position size as % of balance
max_concurrent 3 Max simultaneous open positions
stop_loss required Force stop-loss on all trades
daily_loss_pct 5 Daily loss limit (% of balance)
max_drawdown_pct 15 Maximum portfolio drawdown
max_risk_per_trade 2 Risk per trade (% of balance)
cooldown_after_losses 3 Consecutive losses before cooldown
cooldown_minutes 60 Minutes to wait after loss streak
max_daily_trades 50 Maximum trades per day
strategy trend_follower Trading strategy name

πŸ›‘οΈ Risk Management

Clawster enforces hard-coded safety limits that cannot be overridden:

Position Limits

  • βœ… Max 20% of balance per position
  • βœ… Max 3 concurrent positions
  • βœ… Max 10x leverage
  • βœ… Mandatory stop-loss on all trades

Daily Limits

  • βœ… 5% daily loss limit (auto-shutdown)
  • βœ… 50 maximum trades per day
  • βœ… 3-strike cooldown system

Portfolio Protection

  • βœ… 15% maximum drawdown limit
  • βœ… Emergency liquidation at risk limits
  • βœ… Real-time P&L monitoring

πŸ”„ Trading Loop

Clawster operates in a continuous cycle:

πŸ” SCAN β†’ πŸ“Š ANALYZE β†’ ⚑ EXECUTE β†’ πŸ‘οΈ MONITOR β†’ πŸšͺ EXIT
    ↑                                                  ↓
    ←←←←←←←←←← REPEAT ←←←←←←←←←←←←←←←←←←←←←←←←←←

1. πŸ” Scan Markets

  • Fetch real-time price data
  • Calculate technical indicators
  • Identify trading opportunities

2. πŸ“Š Analyze Signals

  • Apply strategy rules (trend following, scalping, etc.)
  • Risk assessment and position sizing
  • Entry/exit point calculation

3. ⚑ Execute Orders

  • Place orders via Aster DEX API
  • Real-time order management
  • Immediate confirmation handling

4. πŸ‘οΈ Monitor Positions

  • Track P&L in real-time
  • Adjust stop-losses dynamically
  • Risk limit enforcement

5. πŸšͺ Exit Strategy

  • Take profit at targets
  • Stop-loss execution
  • Emergency position closure

πŸ› οΈ Scripts

Balance Checker

node scripts/check-balance.js
  • Displays current USDT balance on Aster DEX
  • Shows available margin and position status
  • Verifies API connectivity

πŸ“š Documentation

Comprehensive documentation available in docs/:

Document Description
architecture.md System design and component overview
configuration.md Complete configuration reference
cron-and-automation.md Automated trading schedules
erc-8004.md Blockchain agent registration
index.md Documentation index and quick links
installation.md Detailed installation guide
memory-and-state.md State management and persistence
risk-management.md Risk controls and safety systems
skills-reference.md API skills reference guide
trading-loop.md Trading algorithm deep dive

πŸ” Authentication

Clawster supports two authentication methods:

v1 Authentication (Default - HMAC)

  • Uses API key + secret for HMAC-SHA256 signatures
  • Recommended for most users
  • Configured via environment variables

v3 Authentication (EIP-712 Wallet)

  • Uses Ethereum wallet for cryptographic signatures
  • Advanced users with wallet integration
  • Requires additional setup

Default: v1 HMAC authentication is used unless explicitly configured otherwise.

πŸ”— Links

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Guidelines

  • Follow existing code style
  • Add tests for new features
  • Update documentation as needed
  • Ensure all safety limits remain intact

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


⚑ Ready to trade autonomously? Let Clawster handle the markets while you sleep. ⚑

Made with πŸ€– by the Clawster team

About

Autonomous perpetual futures trading skill for OpenClaw AI agents on Aster DEX

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages