goat-plugin-orbit
v0.1.0
Published
GOAT SDK plugin for Orbit Finance DLMM — swap, liquidity, and price tools for any AI agent
Maintainers
Readme
goat-plugin-orbit
GOAT SDK plugin for Orbit Finance — a standalone DLMM (Discrete Liquidity Market Maker) on Solana with a custom on-chain program.
Exposes 6 tools to any AI agent framework supported by GOAT SDK (Vercel AI, LangChain, Eliza, and more):
| Tool | Description |
|------|-------------|
| get_orbit_price | Current USD price + active bin for a pool |
| get_orbit_pool_info | Full pool metadata: TVL, volume, reserves, fee tier |
| get_orbit_quote | Swap quote (expected output, price impact, min output) |
| orbit_swap | Execute a swap through an Orbit DLMM pool |
| orbit_add_liquidity | Open a liquidity position across a bin range |
| orbit_remove_liquidity | Withdraw liquidity from an existing position |
Note:
orbit_swap,orbit_add_liquidity, andorbit_remove_liquidityrequire theorbit-dlmmpeer dependency for on-chain transaction building.
Install
npm install goat-plugin-orbit orbit-dlmm
# or
yarn add goat-plugin-orbit orbit-dlmmUsage — Vercel AI SDK
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai";
import { solana } from "@goat-sdk/wallet-solana";
import { orbit } from "goat-plugin-orbit";
import { Connection, Keypair } from "@solana/web3.js";
// Set up Solana wallet
const connection = new Connection("https://rpc.helius.xyz/?api-key=YOUR_KEY");
const wallet = solana({
connection,
keypair: Keypair.fromSecretKey(yourPrivateKey),
});
// Wire up Orbit tools
const tools = await getOnChainTools({
wallet,
plugins: [
orbit({
rpcUrl: "https://rpc.helius.xyz/?api-key=YOUR_KEY",
}),
],
});
// Ask the agent to swap
const result = await generateText({
model: openai("gpt-4o"),
tools,
maxSteps: 5,
prompt:
"Check the price of CIPHER/USDC on Orbit Finance (pool EoLGqHKvtK9NcxjjnvSxTYYuFMYDeWTFFyKYj1DcJyPB), " +
"then swap 10 USDC for CIPHER with 1% max slippage.",
});
console.log(result.text);Usage — LangChain
import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createToolCallingAgent } from "langchain/agents";
import { getTools } from "@goat-sdk/adapter-langchain";
import { solana } from "@goat-sdk/wallet-solana";
import { orbit } from "goat-plugin-orbit";
const tools = await getTools({
wallet: solana({ connection, keypair }),
plugins: [orbit({ rpcUrl: "https://api.mainnet-beta.solana.com" })],
});
const agent = createToolCallingAgent({ llm: new ChatOpenAI({ model: "gpt-4o" }), tools, prompt });
const executor = new AgentExecutor({ agent, tools });
await executor.invoke({ input: "What is the current CIPHER price on Orbit Finance?" });Configuration
import { orbit } from "goat-plugin-orbit";
const plugin = orbit({
// Solana RPC endpoint. Default: https://api.mainnet-beta.solana.com
// Use a private RPC in production for better reliability.
rpcUrl: "https://rpc.helius.xyz/?api-key=YOUR_HELIUS_KEY",
});Constants
| Item | Value |
|------|-------|
| Program ID | Fn3fA3fjsmpULNL7E9U79jKTe1KHxPtQeWdURCbJXCnM |
| API base | https://orbit-dex.api.cipherlabsx.com/api/v1 |
| CIPHER mint | Ciphern9cCXtms66s8Mm6wCFC27b2JProRQLYmiLMH3N |
| CIPHER/USDC pool | EoLGqHKvtK9NcxjjnvSxTYYuFMYDeWTFFyKYj1DcJyPB |
| Max bins per position | 64 |
Architecture
Orbit Finance is a standalone DLMM — not a Meteora fork. It has:
- A custom on-chain program (
Fn3fA3fjsmpULNL7E9U79jKTe1KHxPtQeWdURCbJXCnM) with its own account layout - BinArray size of 64 (vs Meteora's 70)
Poolaccount (vs Meteora'sLbPair)- Live oracle via Switchboard On-Demand (
DoquSdks441bYqvcNTMTqsqZB6LHwUHhrwSzUZjpqYyg) - Jupiter integration PRs: #17, #28 (open)
Read tools call the Orbit REST API. Write tools
use the orbit-dlmm TypeScript SDK to build and sign transactions on-chain.
