drift-yield
Drift Protocol perpetual futures trading for OpenClaw agents. Open/close perp positions on SOL, BTC, ETH — check positions, margin, market data. Powers the AutoYield agent's trading layer.
معلومات المصدر
- المستودع
- Godzilaa/yield-agent
- آخر نشاط في المصدر
- ١١ مايو ٢٠٢٦ في ١٤:١٢
- لغة SKILL.md المكتشفة
- الإنجليزية
- النجوم
- ٠
- التفرعات
- ٠
خيارات التثبيت
يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.
مراجعة ملفات المصدر
اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.
عرض SKILL.md
- name
- drift-yield
- description
- Drift Protocol perpetual futures trading for OpenClaw agents. Open/close perp positions on SOL, BTC, ETH — check positions, margin, market data. Powers the AutoYield agent's trading layer.
- version
- 1.0.0
- author
- autoyield
- readme
- metadata
- {"openclaw":{"triggers":["long","short","close position","perp","drift","position","market data"],"requires":{"env":"[Truncated]"},"install":["[Truncated]","[Truncated]","[Truncated]"]}}
- functions
- {"drift-price":{"description":"Get SOL price, funding rate, long/short ratio, and market sentiment","parameters":["[Truncated]"],"returns":{"type":"object","properties":"[Truncated]"},"execute":"const { Connection, Keypair } = require(\"@solana/web3.js\");\nconst { createDriftClient, getMarketData } = require(\"./scripts/market.js\");\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL || \"https://api.mainnet-beta.solana.com\");\nconst wallet = Keypair.generate();\nconst client = await createDriftClient(connection, wallet);\nconst data = await getMarketData(client, symbol || \"SOL\");\nreturn {\n bid: data.bid,\n ask: data.ask,\n lastPrice: data.lastPrice,\n fundingRate: data.fundingRate,\n longPct: data.longPct,\n shortPct: data.shortPct,\n message: `SOL: $${data.lastPrice} | Funding: ${data.fundingRate.toFixed(4)}% | Long: ${data.longPct.toFixed(1)}% | Sentiment: ${data.longPct > 60 ? \"BEARISH\" : data.longPct < 40 ? \"BULLISH\" : \"NEUTRAL\"}`,\n};\n"},"drift-position":{"description":"Check open perp positions, unrealized PnL, and buying power","parameters":["[Truncated]","[Truncated]"],"returns":{"type":"object","properties":"[Truncated]"},"execute":"const { Connection, Keypair } = require(\"@solana/web3.js\");\nconst { getPositionStatus } = require(\"./scripts/position.js\");\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL || \"https://api.mainnet-beta.solana.com\");\nconst wallet = Keypair.fromSecretKey(Buffer.from(Buffer.from(wallet_b58, \"base58\")));\nconst status = await getPositionStatus(connection, wallet, symbol || \"SOL\");\nreturn status;\n"},"drift-trade":{"description":"Open a long or short perpetual position on Drift","parameters":["[Truncated]","[Truncated]","[Truncated]","[Truncated]","[Truncated]"],"returns":{"type":"object","properties":"[Truncated]"},"execute":"const { Connection, Keypair } = require(\"@solana/web3.js\");\nconst { openPosition } = require(\"./scripts/trade.js\");\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL || \"https://api.mainnet-beta.solana.com\");\nconst wallet = Keypair.fromSecretKey(Buffer.from(Buffer.from(wallet_b58, \"base58\")));\nconst result = await openPosition({\n connection,\n wallet,\n symbol: symbol || \"SOL\",\n direction,\n sizeInSol: size,\n leverage: leverage || 3,\n});\nreturn result;\n"},"drift-close":{"description":"Close an open perp position","parameters":["[Truncated]","[Truncated]"],"returns":{"type":"object","properties":"[Truncated]"},"execute":"const { Connection, Keypair } = require(\"@solana/web3.js\");\nconst { closePosition } = require(\"./scripts/trade.js\");\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL || \"https://api.mainnet-beta.solana.com\");\nconst wallet = Keypair.fromSecretKey(Buffer.from(Buffer.from(wallet_b58, \"base58\")));\nconst result = await closePosition(connection, wallet, symbol || \"SOL\");\nreturn result;\n"},"drift-balance":{"description":"Check Drift collateral balance and buying power","parameters":["[Truncated]"],"returns":{"type":"object","properties":"[Truncated]"},"execute":"const { Connection, Keypair } = require(\"@solana/web3.js\");\nconst { createDriftClient, getTotalCollateral } = require(\"./scripts/market.js\");\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL || \"https://api.mainnet-beta.solana.com\");\nconst wallet = Keypair.fromSecretKey(Buffer.from(Buffer.from(wallet_b58, \"base58\")));\nconst client = await createDriftClient(connection, wallet);\nconst collateral = await getTotalCollateral(client);\nreturn {\n totalCollateral: collateral,\n message: `Drift collateral: $${collateral.toFixed(2)}`,\n};\n"},"drift-market":{"description":"Get full market data — funding rate, open interest, long/short ratio, sentiment","parameters":["[Truncated]","[Truncated]"],"returns":{"type":"object","properties":"[Truncated]"},"execute":"const { Connection, Keypair } = require(\"@solana/web3.js\");\nconst { createDriftClient, getMarketData } = require(\"./scripts/market.js\");\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL || \"https://api.mainnet-beta.solana.com\");\nconst wallet = Keypair.fromSecretKey(Buffer.from(Buffer.from(wallet_b58, \"base58\")));\nconst client = await createDriftClient(connection, wallet);\nconst data = await getMarketData(client, symbol || \"SOL\");\nconst sentiment = data.longPct > 60 ? \"BEARISH\" : data.longPct < 40 ? \"BULLISH\" : \"NEUTRAL\";\nreturn {\n fundingRate: data.fundingRate,\n openInterest: data.openInterest,\n longPct: data.longPct,\n sentiment,\n message: `Funding: ${data.fundingRate.toFixed(4)}% | OI: ${data.openInterest.toFixed(0)} SOL | Long: ${data.longPct.toFixed(1)}% | Sentiment: ${sentiment}`,\n};\n"}}