PublicSkills / clawhub_markdowns /01-exchange-kill.md
shobbs's picture
Upload 9296 files
c086f10 verified

01-exchange-skill(not official)

Author: @Bouncyknighter

Downloads: 528

Description: AI-powered 01.xyz exchange development skill for monitoring, trading strategies, and N1 blockchain integration. Covers REST API (FTX-inspired), Nord.ts SDK (@n1xyz/nord-ts), non-custodial trading patterns, and market making on Solana.


01.xyz Exchange Developer Skill

Non-custodial perpetual futures on Solana. Built by traders, for traders.

What this Skill is for

Use this Skill when the user asks for:

Market Monitoring: Orderbook depth, mark prices, funding rates, 24h stats Account Tracking: Position monitoring, margin health, liquidation risk Trading Strategies: Market making, DCA, grid trading, trend following SDK Integration: Setting up Nord.ts (@n1xyz/nord-ts) for TypeScript/Python API Development: Building on the FTX-inspired REST API Risk Management: Position sizing, circuit breakers, margin calculations N1 Protocol: Understanding the N1 blockchain and ZO protocol architecture Overview

01.xyz is a non-custodial perpetual futures exchange built on the N1 blockchain (evolution of the ZO protocol). It enables fully self-custodied derivatives trading with up to 20x leverage on major crypto assets.

Key Design Principles Feature Description Non-custodial Your private keys never leave your machine. No central counterparty risk. FTX-inspired API Familiar REST patterns for easy migration from centralized exchanges. Local Signing Users run a local API that signs transactions β€” funds remain under user control. High Performance Sub-second finality on N1 blockchain with Solana settlement. Deep Liquidity Professional market makers and tight spreads on major pairs. Architecture Flow β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ User/Developer β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ AI Agent β”‚ β”‚ Local API β”‚ β”‚ Browser β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ (signed txs) β”‚ β”‚ β–Ό β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ N1 Network β”‚ β”‚ β”‚ β”‚ (L2 chain) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ └────► zo-mainnet.n1.xyz β—„β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ REST/WebSocket β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Solana L1 β”‚ β”‚ (settlement) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Network Endpoints Network Base URL Purpose Status Mainnet https://zo-mainnet.n1.xyz Live trading, real funds Production Devnet https://zo-devnet.n1.xyz Testing, dev work Development Default Stack Decisions

These are opinionated defaults. Adjust for your specific use case.

  1. Data Access Pattern Use Case Recommended Approach Auth Required Market data (prices, orderbook) Direct HTTP to public endpoints ❌ No Account data (positions, balances) Local API or Nord SDK βœ… Yes Order placement Local API with user confirmation βœ… Yes
  2. SDK Selection Language Package Use When TypeScript @n1xyz/nord-ts Full-featured trading, complex strategies Python n1-sdk (pip) Quant research, ML models, backtesting Raw HTTP Direct REST calls Simple monitoring, language-agnostic
  3. Security Model AI only reads public data β€” Never expose private keys to AI systems Local signing mandatory β€” All transactions signed by user's local instance Explicit confirmation β€” Trading actions require human approval Testnet first β€” Always validate on devnet before mainnet
  4. Development Priority Read-only monitoring βœ… β€” Start here, safe for all users Account health tracking βœ… β€” Requires wallet address only Paper trading simulation ⚠️ β€” Test strategies without real funds Live trading ⚠️ β€” Requires local API + explicit user consent Operating Procedure

When working with 01.xyz integration:

Phase 1: Discovery

Identify the task type:

MONITORING β€” Market data, public stats ACCOUNT β€” Position/balance queries TRADING β€” Order placement, strategy execution RISK β€” Health checks, liquidation analysis

Determine authentication needs:

Public endpoints: No auth needed Account data: Wallet address sufficient Trading: Local API with signing required Phase 2: Data Collection

For market data:

// Direct HTTP β€” no auth required const markets = await fetch('https://zo-mainnet.n1.xyz/info').json();

For account data:

// Via local API or SDK const account = await nord.getAccount(walletAddress);

Phase 3: Safety Validation Before any trading action: ☐ Verify account health (margin fraction > 10%) ☐ Check open orders for conflicts ☐ Calculate position impact on margin ☐ Confirm funding rate direction ☐ Get explicit user confirmation Phase 4: Execution Execute with monitoring: Submit order via local API Track fill status Update position state Log all actions Progressive Disclosure

Read these files when the topic comes up:

File Read When Safety Level safety-first.md FIRST β€” before anything else ⚠️ Mandatory monitoring-guide.md Getting market data, checking prices βœ… Safe risk-management.md Managing leverage, liquidation risk βœ… Read-only trading-basics.md Understanding order types, markets ⚠️ Gated sdk-reference.md Setting up Nord.ts SDK βœ… Documentation README.md Project overview, installation βœ… General Examples Directory

Working code samples in examples/:

monitor-wallet.js β€” Read-only wallet monitoring check-funding-rates.js β€” Market analysis simple-order.js β€” Basic order placement (requires local API) Quick Reference Market IDs Reference

01.xyz uses numeric market IDs (not symbols):

ID Market Max Leverage Tick Size 0 BTCUSD 20x $0.50 1 ETHUSD 20x $0.10 2 SOLUSD 20x $0.01 3 HYPEUSD 10x $0.01 ... See /info endpoint HTTP Endpoints

Public (no auth):

GET /info # All markets GET /market/{id}/orderbook # L2 orderbook GET /market/{id}/stats # 24h stats, funding GET /trades # Recent trades

Private (requires local API):

GET /account/{address} # Positions, balances POST /action # Submit orders

Common SDK Operations import { Nord } from '@n1xyz/nord-ts';

// Initialize const nord = await Nord.new({ app: 'zoau54n5U24GHNKqyoziVaVxgsiQYnPMx33fKmLLCT5', solanaConnection: connection, webServerUrl: 'https://zo-mainnet.n1.xyz', });

// Get markets const markets = await nord.getMarkets();

// Get orderbook const orderbook = await nord.getOrderbook(2); // SOLUSD

// Place order (requires auth) const order = await nord.placeOrder({ marketId: 2, side: 'buy', size: 1.0, price: 150.00, orderType: 'limit', });

Safety & Risk Checklist Pre-Trading Checklist

☐ Read safety-first.md β€” Non-custodial reality check ☐ Verify on devnet first β€” Test all logic with fake funds ☐ Check account health β€” Margin fraction > 10% (ideally > 20%) ☐ Review funding rates β€” Can flip PnL significantly ☐ Calculate liquidation price β€” Know your liquidation level ☐ Set stop-losses β€” Use trigger orders for downside protection ☐ Confirm market ID β€” Numeric IDs, not symbols

In-Flight Monitoring

☐ Monitor margin fraction β€” Alert if < 15% ☐ Track funding payments β€” Every 8 hours ☐ Watch for liquidations β€” Cascading effects in volatile markets ☐ Log all operations β€” Audit trail for debugging

Emergency Procedures Approaching liquidation: Reduce position size immediately or add collateral API unresponsive: Check local API status, verify network connectivity Unexpected fills: Review order history, check for stale orders Wrong market ID: Cancel all pending orders, verify symbol mapping Resources Official Documentation 01.xyz: https://01.xyz Developer Docs: https://docs.01.xyz API Reference: https://api.01.xyz N1 Blockchain: https://docs.n1.xyz SDKs & Tools Nord TypeScript: npm install @n1xyz/nord-ts Nord Python: pip install n1-sdk GitHub: https://github.com/n1-exchange Community Discord: N1 Exchange Community Twitter/X: @01_exchange Updates Version: 1.0.0 Last Updated: 2026-02-04 API Version: 2026-01 Compatibility: N1 Mainnet, Devnet

This Skill follows the OpenClaw Skill Specification. For more information on creating Skills, see the Skill documentation.