ranger-finance

Build Solana perpetual futures trading applications using the Ranger Finance smart order router SDK.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill ranger-finance-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ranger-finance
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/ranger-finance
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill ranger-finance-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @solana/web3.js, bs58, dotenv, ranger-sor-sdk, mcp-agent, numpy.

What problem does it solve? Trading perpetual futures on Solana requires integrating separately with multiple protocols like Drift, Flash, Adrena, and Jupiter, each with different APIs and liquidity. This Skill provides a unified SDK and MCP server that aggregates liquidity across all these venues with smart order routing for best execution. ## Core Features & Use Cases - Smart Order Routing: Get quotes and execute trades routed across Drift, Flash, Adrena, and Jupiter perp protocols through a single API. - Unified Position Management: Fetch, filter, decrease, and close positions across all venues with one interface, including PnL and liquidation price tracking. - AI Agent Integration: Built-in MCP server exposing trading tools (quotes, position management, liquidation signals, funding rates) for building automated trading agents. - Use Case: Build a mean reversion trading bot that monitors liquidation signals via the MCP server, gets quotes across venues, and automatically opens short positions when z-scores exceed thresholds. ## Quick Start Use the ranger-finance skill to get a quote for a 1 SOL long position with 10 USDC collateral and show pricing across all available venues.

Frequently Asked Questions about ranger-finance

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

FAQPage Schema
How do I open a perpetual futures position on Solana with Ranger Finance?

Initialize the SorApi client with your API key, then call increasePosition with the symbol, side (Long or Short), size, collateral, and adjustment_type 'Increase'. The API returns a base64-encoded transaction that you sign with your Solana keypair and submit to the network.

What is a smart order router for Solana perps trading?

A smart order router aggregates perpetual futures liquidity across multiple protocols and routes orders to venues with the best pricing. Ranger Finance routes across Drift, Flash Trade, Adrena, and Jupiter Perps through a single unified API.

Which perp protocols does Ranger Finance aggregate?

Ranger Finance aggregates four Solana perpetual protocols: Drift Protocol, Flash Trade, Adrena, and Jupiter Perps. Drift offers 20+ markets while Flash, Adrena, and Jupiter support SOL, BTC, and ETH.

Can I build an AI trading agent with Ranger Finance?

Yes, Ranger provides an MCP server exposing tools like sor_get_trade_quote, sor_increase_position, data_get_positions, data_get_liquidations, and data_get_funding_rates. Install the ranger-agent-kit with Python and connect it to MCP-compatible agents or Claude Desktop.

Why does my Ranger Finance transaction fail with blockhash expired?

Blockhash expiry happens when you delay too long between receiving the transaction from the API and signing it. Sign and send immediately after getting the transaction, or implement retry logic that fetches a fresh transaction on each attempt.

What are the Ranger Finance API rate limits?

The standard rate limit is 100 requests per minute, position queries are limited to 30 per minute, and trade execution to 10 per minute. Responses include X-RateLimit headers so you can track remaining quota.