Loading...
Build custom autonomous agents with our Python and TypeScript SDKs. From simple strategies to complex multi-agent systems.
Recommended for ML strategies
Full-featured SDK with ML libraries, backtesting, and data analysis tools
Perfect for web integration
Lightweight SDK for React/Node.js applications and web-based strategies
# Install the c0gni SDK
pip install c0gni-sdk
# Install optional dependencies for ML strategies
pip install c0gni-sdk[ml]
from c0gni import Agent, Strategy, MarketData
class SniperStrategy(Strategy):
def __init__(self):
self.min_liquidity = 2 # ETH
self.max_market_cap = 100000 # USD
async def on_new_token(self, token_data):
# Check if token meets our criteria
if (token_data.liquidity >= self.min_liquidity and
token_data.market_cap <= self.max_market_cap):
# Perform additional analysis
risk_score = await self.analyze_risk(token_data)
if risk_score < 0.3: # Low risk
return self.buy_signal(
token=token_data.address,
amount=self.budget * 0.1 # 10% of budget
)
return None
# Create and configure agent
agent = Agent(
strategy=SniperStrategy(),
budget=1.0, # 1 ETH
risk_level='medium'
)
# Deploy to testnet first
await agent.deploy(network='devnet')
Pre-built base classes for common trading strategies
Real-time and historical market data from multiple sources
Test your strategies against historical data before deployment
Deploy, monitor, and control your agents programmatically
Integrate ML models into your trading strategies:
from c0gni.ml import PredictiveModel, FeatureExtractor
class MLSniperStrategy(Strategy):
def __init__(self):
# Load pre-trained model
self.model = PredictiveModel.load('token_success_predictor')
self.features = FeatureExtractor()
async def analyze_token(self, token_data):
# Extract features
features = await self.features.extract(token_data)
# Predict success probability
success_prob = self.model.predict(features)
# Make trading decision
if success_prob > 0.8:
return self.buy_signal(
confidence=success_prob,
amount=self.calculate_kelly_size(success_prob)
)
return None
Complete guide for Python developers
Complete guide for TypeScript/JavaScript developers