CtrlK
BlogDocsLog inGet started
Tessl Logo

drift-sdk

Drift Protocol perpetual futures trading on Solana (direct SDK)

74

Quality

63%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Advisory

Suggest reviewing before use

Optimize this skill with Tessl

npx tessl skill review --optimize ./src/skills/bundled/drift-sdk/SKILL.md
SKILL.md
Quality
Evals
Security

Drift Protocol SDK

Direct SDK-based trading on Drift Protocol, Solana's leading perpetual futures DEX. Bypass the gateway requirement with native SDK integration.

Quick Start

# Set credentials
export DRIFT_PRIVATE_KEY="your-solana-private-key"
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"

# Check balance
/drift balance

# Open a position
/drift long BTC 0.1
/drift short ETH 1 2500

# Close position
/drift close BTC

Commands

Trading

CommandDescription
/drift long <coin> <size> [price]Open long position
/drift short <coin> <size> [price]Open short position
/drift close <coin>Close position at market
/drift closeallClose all positions
/drift leverage <coin> <1-20>Set leverage

Examples:

/drift long BTC 0.1           # Market buy 0.1 BTC
/drift short ETH 1 2500       # Limit sell 1 ETH at $2500
/drift leverage SOL 5         # Set SOL leverage to 5x

Orders

CommandDescription
/drift ordersList open orders
/drift cancel <orderId>Cancel order by ID
/drift cancel <coin>Cancel all orders for coin
/drift cancelallCancel all orders
/drift modify <orderId> [price] [size]Modify order

Account

CommandDescription
/drift balanceCollateral, margin, health factor
/drift positionsOpen positions with PnL

Configuration

# Required
export DRIFT_PRIVATE_KEY="base58_or_json_array"

# Optional
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"
export DRY_RUN=true  # Test mode

Features

  • Direct SDK - No gateway server required
  • Perp & Spot - Trade both market types
  • Order Types - Market, limit, post-only, IOC, FOK
  • Position Management - Track unrealized PnL, entry prices
  • Risk Metrics - Health factor, margin usage, liquidation prices
  • Leverage Control - Set per-market leverage (1-20x)

Markets

MarketIndexMax Leverage
BTC-PERP020x
ETH-PERP120x
SOL-PERP220x
.........

Resources

  • Drift Protocol
  • Drift Docs
  • Solana
Repository
alsk1992/CloddsBot
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.