Developer SDK

Build on Decentralized Intelligence

The official TAOOS SDK connects your application to Bittensor subnet signals, autonomous agent execution, and Ethereum DeFi — with a single TypeScript client.

Install npm install @taoos/sdk
TypeScript Language
MIT License
v1.0 Version

Quick Start

Install the SDK, initialise a client, and start querying Bittensor subnet signals in under a minute.

bash
npm install @taoos/sdk
typescript
import { TAOOSClient } from '@taoos/sdk';

const client = new TAOOSClient({
  rpcEndpoint: 'https://api.taoos.xyz',
  network: 'mainnet',
  apiKey: 'your-api-key',
});

// Fetch a live signal from Bittensor subnet 1
const signal = await client.getSignal({
  subnetId: 1,
  signalType: 'price',
  target: 'ETH/USDC',
});
console.log(signal.value, signal.confidence);

// Deploy a trading agent
const agent = await client.deployAgent({
  type: 'trading',
  maxAllocation: '5000000',
  slippageTolerance: 0.5,
  protocols: ['uniswap-v3', 'aave-v3'],
});
console.log(agent.status);

Core Modules

Every module is independent and composable. Use just what you need.

TAOOSClient

Main Client

Entry point for all protocol interactions. Handles auth, networking, and module composition.

getSignal

Signal Layer

Query confidence-weighted intelligence from any Bittensor subnet via the TAOOS oracle.

deployAgent

Agent Layer

Deploy and manage autonomous execution agents — trading, yield, risk, arbitrage, governance.

SwapRouter

Swap Engine

Route and execute token swaps across EVM-native DeFi venues with slippage protection.

ProofGenerator

Proof Engine

Generate and verify Merkle, zk-SNARK, and signature proofs for oracle attestations.

sendTransaction

Transactions

Broadcast, monitor, and execute protocol transactions with full status tracking.

Signal Layer API

Fetch real-time, confidence-weighted intelligence from Bittensor subnets. Signal types: price, sentiment, risk, forecast.

typescript
const signal = await client.getSignal({
  subnetId: 1,
  signalType: 'price',
  target: 'ETH/USDC',
});

signal.subnetId    // number  — originating subnet
signal.value       // number  — normalized signal value
signal.confidence  // number  — confidence score (0–1)
signal.blockNumber // number  — block when signal was produced
signal.timestamp   // number  — Unix timestamp

Agent Layer API

Deploy autonomous agents that consume subnet signals and execute DeFi operations within your configured risk parameters.

  • trading — directional strategy execution from subnet conviction
  • arbitrage — cross-venue price gap identification and closure
  • yield — idle capital reallocation for signal-aware yield
  • risk — exposure monitoring with automated circuit breakers
  • governance — DAO proposal tracking and coordination
typescript
const agent = await client.deployAgent({
  type: 'yield',
  maxAllocation: '10000000',
  slippageTolerance: 1.0,
  protocols: ['aave-v3', 'compound-v3'],
});

agent.agentType  // string   — deployed agent type
agent.signatures // string[] — on-chain tx signatures
agent.status     // 'success' | 'failed' | 'pending'

Transactions

typescript
// Send
const tx = await client.sendTransaction({
  amount: '1000000',
  recipient: '0xrecipient...',
  memo: 'wTAO bridge deposit',
});

// Monitor
const status = await client.getTransaction(tx.signature);

// Network info
await client.getBlockHeight();
await client.getNetworkStatus();

Proof Engine

Generate and verify cryptographic proofs for oracle attestations. Supported: merkle, zk-snark, signature.

typescript
const proof = await client.proofGenerator.generateProof({
  type: 'merkle',
  data: { signal: 0.87, subnetId: 1 },
  witness: { root: 'root-hash', path: ['h1', 'h2'] },
});

const valid = await client.proofGenerator.verifyProof(proof);
console.log(valid); // true

Swap Engine

typescript
// Find best route
const route = await client.swapRouter.findRoute({
  inputMint: '0xwTAO...',
  outputMint: '0xUSDC...',
  amount: '1000000',
  slippageTolerance: 0.5,
  userAddress: '0xuser...',
});

// Execute
const result = await client.swapRouter.executeSwap(route);
console.log(result.status, result.outputAmount);

Error Handling

All errors extend TAOOSError and include a typed code field.

typescript
import {
  ValidationError, NetworkError,
  SignalError, AgentError, SwapError,
} from '@taoos/sdk';

try {
  await client.getSignal({ subnetId: -1, ... });
} catch (err) {
  if (err instanceof ValidationError) {
    console.error(err.message, err.code);
  }
}

Open Source

The SDK is open source under MIT. Contributions, issues, and feedback welcome.

TaoOSAI / taoos-sdk

Source code, issues, and contribution guide on GitHub.

View Repository
← Back to Home Whitepaper GitHub →