drift-sdk

Place Drift Protocol orders and manage positions via the Solana SDK.

71|22|Updated Apr 6, 2020
One-click install
npx skills add https://github.com/nirholas/agenti --skill drift-sdk-nirholas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drift-sdk
Source: https://github.com/nirholas/agenti/tree/main/packages/protocols/x402-cloddsbot/src/skills/bundled/drift-sdk
Command: npx skills add https://github.com/nirholas/agenti --skill drift-sdk-nirholas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drift protocol users need a seamless way to programmatically trade perpetual futures on Solana, manage balances and positions, and execute orders without relying on a gateway.

Core Features & Use Cases

  • Direct SDK integration for perpetual futures trading on Drift Protocol, enabling long/short orders, balance checks, and position management from code or chat-driven workflows.
  • Supports account balance queries, open positions, active orders, leverage adjustments, and order cancellation for automation and rapid decision making.
  • Use Case: A developer bot deploys Drift functionality in a Solana-based trading assistant, issuing /drift long BTC 0.1 and monitoring PnL in real time.

Quick Start

Set your environment: export DRIFT_PRIVATE_KEY and optionally SOLANA_RPC_URL, then invoke the drift-sdk skill and issue commands like /drift balance or /drift long BTC 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 execute programmatic perpetual futures trading on Drift Protocol for Solana?

To execute programmatic perpetual futures trading on Solana Drift Protocol, this skill enables direct SDK integration for placing long and short orders, querying balances, and managing positions via chat-based workflows or bots.

What environment setup is required to manage Solana leverage positions via SDK?

Managing Solana leverage positions via SDK requires setting the DRIFT_PRIVATE_KEY environment variable, and optionally configuring SOLANA_RPC_URL, before invoking core functions like long, short, and leverage.

Can I use chat commands to place long and short orders on Solana perpetual futures?

Yes, you can place long and short orders on Solana perpetual futures using chat commands. Developers can issue instructions like `/drift long BTC 0.1` to execute leveraged trades directly through the Drift SDK.

Does direct Drift SDK trading require a gateway to manage active orders?

No, direct Drift SDK trading does not require a gateway to manage active orders. Users can query open positions, check active orders, adjust leverage, and cancel orders directly through programmatic SDK calls.

What functions are available for automating Drift Protocol position management?

Available functions for automating Drift Protocol position management include balance checks, querying open positions, viewing active orders, placing long and short orders, adjusting leverage, closing positions, and canceling orders.

How do I close positions and cancel orders on Drift Protocol without a web gateway?

You can close positions and cancel orders on Drift Protocol without a web gateway by invoking the core `close` and `cancel` SDK functions provided by this skill within your automated trading bot or MCP client.