drift-sdk

Trade perpetual futures on Solana's Drift Protocol via SDK.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/shreed27/DAIN --skill drift-sdk-shreed27
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drift-sdk
Source: https://github.com/shreed27/DAIN/tree/main/CloddsBot-main/src/skills/bundled/drift-sdk
Command: npx skills add https://github.com/shreed27/DAIN --skill drift-sdk-shreed27

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @solana/web3.js, ../../../solana/drift, and includes scripts (resource) components.

What problem does it solve?

This Skill allows direct, programmatic trading of perpetual futures on the Drift Protocol on Solana, bypassing any gateway requirements for faster and more integrated execution.

Core Features & Use Cases

  • Direct SDK Integration: Execute trades using the Drift Protocol's SDK without needing a separate intermediary service.
  • Perpetual Futures Trading: Open long/short positions, manage leverage, and place various order types (market, limit).
  • Use Case: An algorithmic trader can use this Skill to automatically open a short position on ETH-PERP if a specific technical indicator is met, setting a limit price for entry.

Quick Start

Use the drift skill to open a long position on BTC with a size of 0.1.

Frequently Asked Questions about drift-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trade perpetual futures on Solana programmatically?

Trading perpetual futures on Solana programmatically involves using the Drift Protocol SDK to execute trades directly. This method supports opening long and short positions, managing leverage, and placing market or limit orders without intermediary services.

Can I open long and short positions on Solana DEXs using an SDK?

Yes, opening long and short positions on Solana DEXs is possible using the Drift Protocol SDK. It supports direct position management, leverage adjustment, and market or limit order execution across various supported perpetual markets.

What environment variables do I need to execute trades on Drift Protocol?

Executing trades on Drift Protocol requires environment variables for your private key and RPC URL. These variables provide secure and authenticated operations for the SDK to interact with the Solana blockchain.

What's the best way to automate limit orders for Solana perpetual futures?

Automating limit orders for Solana perpetual futures is best achieved using the Drift Protocol SDK. It enables algorithmic traders to programmatically set limit prices for entry, manage leverage, and execute orders directly.

Does direct SDK integration on Solana bypass gateway requirements for DeFi trading?

Direct SDK integration on Solana bypasses gateway requirements for DeFi trading. Interacting directly with the Drift Protocol achieves faster and more integrated execution without needing a separate intermediary service.

Why use a direct SDK approach for algorithmic trading on Solana?

Using a direct SDK approach for algorithmic trading on Solana eliminates intermediary services, resulting in faster and more integrated execution. It allows automated strategies to open positions and place orders directly on the Drift Protocol.