VIBE AI agents can trade autonomously on decentralized exchanges and manage DeFi positions.
High-performance decentralized trading on Solana
| Feature | Description |
|---|---|
| Jupiter Aggregator | Best price routing across all Solana DEXes |
| Meteora DLMM | Dynamic liquidity market maker pools |
| Networks | Solana mainnet + devnet |
| Speed | Sub-second confirmations |
| Fees | ~$0.00025 per transaction |
solana_wallet:
enabled: true
network: "mainnet"
trading:
max_position_size: "1000" # USD
slippage_tolerance: "0.5" # percent
priority_fee: "auto" # or specific lamports
# Get token price via Jupiter
price = await jupiter.get_token_price("SOL")
# Get swap quote
quote = await jupiter.get_swap_quote(
input_mint="So11111111111111111111111111111111111111112", # SOL
output_mint="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC
amount=1000000000, # 1 SOL in lamports
slippage_bps=50 # 0.5%
)
# Execute swap
result = await jupiter.execute_swap(
quote=quote,
wallet_address=wallet_address
)
# Meteora DLMM pools
pools = await meteora.get_active_pools()
position = await meteora.add_liquidity(
pool_address=pool_address,
amount_a=1000,
amount_b=1000
)
High-performance perpetual and spot DEX
| Feature | Description |
|---|---|
| Perpetuals | Up to 50x leverage |
| Spot | Direct token trading |
| Order Types | Market, Limit, Stop |
| API | REST + WebSocket |
hyperliquid:
enabled: true
network: "mainnet"
wallet_type: "agent" # Hyperliquid agent wallet
trading:
max_position_size: "1000" # USDC
max_leverage: 10
allowed_markets: ["BTC-PERP", "ETH-PERP"]
# Get market data
await hyperliquid.get_price("BTC-PERP")
await hyperliquid.get_orderbook("BTC-PERP")
await hyperliquid.get_funding_rate("BTC-PERP")
# Trading
await hyperliquid.place_order(
market="BTC-PERP",
side="buy",
size=0.1,
order_type="limit",
price=50000
)
# Position management
await hyperliquid.get_positions()
await hyperliquid.close_position("BTC-PERP")
Token swaps via DEX aggregation
| Feature | Description |
|---|---|
| DEXes | Uniswap, SushiSwap, Curve |
| Networks | Ethereum |
| Routing | Best price aggregation |
| Gas | Auto-sponsored |
cdp_trade:
enabled: true
network: "ethereum"
settings:
slippage_tolerance: "0.5" # percent
gas_sponsorship: true
# Get swap quote
quote = await cdp.get_swap_quote(
from_token="ETH",
to_token="USDC",
amount="1.0"
)
# Execute swap
result = await cdp.execute_swap(
from_token="ETH",
to_token="USDC",
amount="1.0",
slippage="0.5"
)
Bet on real-world outcomes
| Feature | Description |
|---|---|
| Markets | Politics, Sports, Crypto |
| Order Book | CLOB-based |
| Settlement | USDC |
# Browse markets
markets = await polymarket.search_markets("AI regulation")
# Get market details
market = await polymarket.get_market(market_id)
# Place bet
await polymarket.place_order(
market_id=market_id,
outcome="Yes",
amount=100, # USDC
price=0.65 # 65 cents per share
)
# Check positions
positions = await polymarket.get_positions()
# Monitor funding rates across perpetuals
async def funding_arbitrage():
while True:
rate = await hyperliquid.get_funding_rate("BTC-PERP")
if rate > 0.01: # High positive rate
# Short perp, long spot
await hyperliquid.place_order("BTC-PERP", "sell", 1)
await cdp.execute_swap("USDC", "BTC", 1)
await asyncio.sleep(3600)
# Automated DCA strategy
@trigger(cron="0 12 * * *") # Daily at noon
async def daily_btc_dca():
await cdp.execute_swap(
from_token="USDC",
to_token="BTC",
amount="100"
)
# Portfolio rebalancing
async def rebalance_portfolio():
portfolio = await get_portfolio()
target = {"BTC": 0.5, "ETH": 0.3, "USDC": 0.2}
for asset, target_pct in target.items():
current_pct = portfolio[asset] / portfolio.total
diff = target_pct - current_pct
if abs(diff) > 0.05: # 5% threshold
# Rebalance
await execute_rebalance(asset, diff)
risk_management:
max_position_size: "1000" # USDC per position
max_total_exposure: "5000" # Total USDC at risk
max_loss_per_day: "200"
stop_loss:
enabled: true
default_percentage: 5
# Emergency stop all trading
@trigger(condition="daily_loss > 200")
async def emergency_stop():
await close_all_positions()
await disable_trading()
await notify_user("Trading disabled: daily loss limit reached")
Next: Prediction Markets →