mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-13 15:10:04 +00:00
280 lines
66 KiB
HTML
280 lines
66 KiB
HTML
<!DOCTYPE html><html class="default" lang="en" data-base="."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>solana-agent-kit</title><meta name="description" content="Documentation for solana-agent-kit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">solana-agent-kit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h1>solana-agent-kit</h1></div><div class="tsd-panel tsd-typography"><div align="center">
|
|
<a id="solana-agent-kit" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Solana Agent Kit<a href="#solana-agent-kit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p><img src="https://github.com/user-attachments/assets/cfa380f6-79d9-474d-9852-3e1976c6de70" alt="Solana Agent Kit Cover 1 (3)"></p>
|
|
<p><img src="https://img.shields.io/npm/dm/solana-agent-kit?style=for-the-badge" alt="NPM Downloads">
|
|
<img src="https://img.shields.io/github/forks/sendaifun/solana-agent-kit?style=for-the-badge" alt="GitHub forks">
|
|
<img src="https://img.shields.io/github/license/sendaifun/solana-agent-kit?style=for-the-badge" alt="GitHub License"></p>
|
|
</div>
|
|
<p>An open-source toolkit for connecting AI agents to Solana protocols. Now, any agent, using any model can autonomously perform 15+ Solana actions:</p>
|
|
<ul>
|
|
<li>Trade tokens</li>
|
|
<li>Launch new tokens</li>
|
|
<li>Lend assets</li>
|
|
<li>Send compressed airdrops</li>
|
|
<li>Execute blinks</li>
|
|
<li>Launch tokens on AMMs</li>
|
|
<li>And more...</li>
|
|
</ul>
|
|
<p>Anyone - whether an SF-based AI researcher or a crypto-native builder - can bring their AI agents trained with any model and seamlessly integrate with Solana.</p>
|
|
<p><a href="https://replit.com/@sendaifun/Solana-Agent-Kit"><img src="https://replit.com/badge/github/sendaifun/solana-agent-kit" alt="Run on Repl.it"></a></p>
|
|
<blockquote>
|
|
<p>Replit template created by <a href="https://github.com/The-x-35">Arpit Singh</a></p>
|
|
</blockquote>
|
|
<a id="🔧-core-blockchain-features" class="tsd-anchor"></a><h2 class="tsd-anchor-link">🔧 Core Blockchain Features<a href="#🔧-core-blockchain-features" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
|
<li>
|
|
<p><strong>Token Operations</strong></p>
|
|
<ul>
|
|
<li>Deploy SPL tokens by Metaplex</li>
|
|
<li>Transfer assets</li>
|
|
<li>Balance checks</li>
|
|
<li>Stake SOL</li>
|
|
<li>Zk compressed Airdrop by Light Protocol and Helius</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>NFTs on 3.Land</strong></p>
|
|
<ul>
|
|
<li>Create your own collection</li>
|
|
<li>NFT creation and automatic listing on 3.land</li>
|
|
<li>List your NFT for sale in any SPL token</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>NFT Management via Metaplex</strong></p>
|
|
<ul>
|
|
<li>Collection deployment</li>
|
|
<li>NFT minting</li>
|
|
<li>Metadata management</li>
|
|
<li>Royalty configuration</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>DeFi Integration</strong></p>
|
|
<ul>
|
|
<li>Jupiter Exchange swaps</li>
|
|
<li>Launch on Pump via PumpPortal</li>
|
|
<li>Raydium pool creation (CPMM, CLMM, AMMv4)</li>
|
|
<li>Orca Whirlpool integration</li>
|
|
<li>Manifest market creation, and limit orders</li>
|
|
<li>Meteora Dynamic AMM, DLMM Pool, and Alpha Vault</li>
|
|
<li>Openbook market creation</li>
|
|
<li>Register and Resolve SNS</li>
|
|
<li>Jito Bundles</li>
|
|
<li>Pyth Price feeds for fetching Asset Prices</li>
|
|
<li>Register/resolve Alldomains</li>
|
|
<li>Perpetuals Trading with Adrena Protocol</li>
|
|
<li>Drift Vaults, Perps, Lending and Borrowing</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>Solana Blinks</strong></p>
|
|
<ul>
|
|
<li>Lending by Lulo (Best APR for USDC)</li>
|
|
<li>Send Arcade Games</li>
|
|
<li>JupSOL staking</li>
|
|
<li>Solayer SOL (sSOL)staking</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>Non-Financial Actions</strong></p>
|
|
<ul>
|
|
<li>Gib Work for registering bounties</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<a id="🤖-ai-integration-features" class="tsd-anchor"></a><h2 class="tsd-anchor-link">🤖 AI Integration Features<a href="#🤖-ai-integration-features" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
|
|
<li>
|
|
<p><strong>LangChain Integration</strong></p>
|
|
<ul>
|
|
<li>Ready-to-use LangChain tools for blockchain operations</li>
|
|
<li>Autonomous agent support with React framework</li>
|
|
<li>Memory management for persistent interactions</li>
|
|
<li>Streaming responses for real-time feedback</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>Vercel AI SDK Integration</strong></p>
|
|
<ul>
|
|
<li>Vercel AI SDK for AI agent integration</li>
|
|
<li>Framework agnostic support</li>
|
|
<li>Quick and easy toolkit setup</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>Autonomous Modes</strong></p>
|
|
<ul>
|
|
<li>Interactive chat mode for guided operations</li>
|
|
<li>Autonomous mode for independent agent actions</li>
|
|
<li>Configurable action intervals</li>
|
|
<li>Built-in error handling and recovery</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<p><strong>AI Tools</strong></p>
|
|
<ul>
|
|
<li>DALL-E integration for NFT artwork generation</li>
|
|
<li>Natural language processing for blockchain commands</li>
|
|
<li>Price feed integration for market analysis</li>
|
|
<li>Automated decision-making capabilities</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<a id="📃-documentation" class="tsd-anchor"></a><h2 class="tsd-anchor-link">📃 Documentation<a href="#📃-documentation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>You can view the full documentation of the kit at <a href="https://docs.solanaagentkit.xyz">docs.solanaagentkit.xyz</a></p>
|
|
<a id="📦-installation" class="tsd-anchor"></a><h2 class="tsd-anchor-link">📦 Installation<a href="#📦-installation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="bash"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-2">solana-agent-kit</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="quick-start" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Quick Start<a href="#quick-start" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">SolanaAgentKit</span><span class="hl-1">, </span><span class="hl-4">createSolanaTools</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">"solana-agent-kit"</span><span class="hl-1">;</span><br/><br/><span class="hl-5">// Initialize with private key and optional RPC URL</span><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">agent</span><span class="hl-1"> = </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">SolanaAgentKit</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-2">"your-wallet-private-key-as-base58"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">"https://api.mainnet-beta.solana.com"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">"your-openai-api-key"</span><br/><span class="hl-1">);</span><br/><br/><span class="hl-5">// Create LangChain tools</span><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">tools</span><span class="hl-1"> = </span><span class="hl-0">createSolanaTools</span><span class="hl-1">(</span><span class="hl-4">agent</span><span class="hl-1">);</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="usage-examples" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Usage Examples<a href="#usage-examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="deploy-a-new-token" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Deploy a New Token<a href="#deploy-a-new-token" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">deployToken</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-2">"my ai token"</span><span class="hl-1">, </span><span class="hl-5">// name</span><br/><span class="hl-1"> </span><span class="hl-2">"uri"</span><span class="hl-1">, </span><span class="hl-5">// uri</span><br/><span class="hl-1"> </span><span class="hl-2">"token"</span><span class="hl-1">, </span><span class="hl-5">// symbol</span><br/><span class="hl-1"> </span><span class="hl-8">9</span><span class="hl-1">, </span><span class="hl-5">// decimals</span><br/><span class="hl-1"> </span><span class="hl-8">1000000</span><span class="hl-1"> </span><span class="hl-5">// initial supply</span><br/><span class="hl-1">);</span><br/><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">"Token Mint Address:"</span><span class="hl-1">, </span><span class="hl-4">result</span><span class="hl-1">.</span><span class="hl-4">mint</span><span class="hl-1">.</span><span class="hl-0">toString</span><span class="hl-1">());</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="create-nft-collection-on-3land" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Create NFT Collection on 3Land<a href="#create-nft-collection-on-3land" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">isDevnet</span><span class="hl-1"> = </span><span class="hl-6">true</span><span class="hl-1">; </span><span class="hl-5">// (Optional) if not present TX takes place in Mainnet</span><br/><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">collectionOpts</span><span class="hl-1">: </span><span class="hl-9">CreateCollectionOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-4">collectionName:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">collectionSymbol:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">collectionDescription:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">mainImageUrl:</span><span class="hl-1"> </span><span class="hl-2">""</span><br/><span class="hl-1"> };</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">create3LandCollection</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-4">collectionOpts</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">isDevnet</span><span class="hl-1">, </span><span class="hl-5">// (Optional) if not present TX takes place in Mainnet</span><br/><span class="hl-1"> );</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="create-nft-on-3land" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Create NFT on 3Land<a href="#create-nft-on-3land" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>When creating an NFT using 3Land's tool, it automatically goes for sale on 3.land website</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">isDevnet</span><span class="hl-1"> = </span><span class="hl-6">true</span><span class="hl-1">; </span><span class="hl-5">// (Optional) if not present TX takes place in Mainnet</span><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">withPool</span><span class="hl-1"> = </span><span class="hl-6">true</span><span class="hl-1">; </span><span class="hl-5">// (Optional) only present if NFT will be created with a Liquidity Pool for a specific SPL token</span><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">collectionAccount</span><span class="hl-1"> = </span><span class="hl-2">""</span><span class="hl-1">; </span><span class="hl-5">//hash for the collection</span><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">createItemOptions</span><span class="hl-1">: </span><span class="hl-9">CreateSingleOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-4">itemName:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">sellerFee:</span><span class="hl-1"> </span><span class="hl-8">500</span><span class="hl-1">, </span><span class="hl-5">//5%</span><br/><span class="hl-1"> </span><span class="hl-4">itemAmount:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-5">//total items to be created</span><br/><span class="hl-1"> </span><span class="hl-4">itemSymbol:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">itemDescription:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">traits:</span><span class="hl-1"> [</span><br/><span class="hl-1"> { </span><span class="hl-4">trait_type:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">, </span><span class="hl-4">value:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1"> },</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-5">//100000000 == 0.1 sol, can be set to 0 for a free mint</span><br/><span class="hl-1"> </span><span class="hl-4">splHash:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">, </span><span class="hl-5">//present if listing is on a specific SPL token, if not present sale will be on $SOL, must be present if "withPool" is true</span><br/><span class="hl-1"> </span><span class="hl-4">poolName:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">, </span><span class="hl-5">// Only present if "withPool" is true</span><br/><span class="hl-1"> </span><span class="hl-4">mainImageUrl:</span><span class="hl-1"> </span><span class="hl-2">""</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">create3LandNft</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-4">collectionAccount</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">createItemOptions</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">isDevnet</span><span class="hl-1">, </span><span class="hl-5">// (Optional) if not present TX takes place in Mainnet</span><br/><span class="hl-1"> </span><span class="hl-4">withPool</span><br/><span class="hl-1">);</span><br/>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="create-nft-collection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Create NFT Collection<a href="#create-nft-collection" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">collection</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">deployCollection</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">"My NFT Collection"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">uri:</span><span class="hl-1"> </span><span class="hl-2">"https://arweave.net/metadata.json"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">royaltyBasisPoints:</span><span class="hl-1"> </span><span class="hl-8">500</span><span class="hl-1">, </span><span class="hl-5">// 5%</span><br/><span class="hl-1"> </span><span class="hl-4">creators:</span><span class="hl-1"> [</span><br/><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">address:</span><span class="hl-1"> </span><span class="hl-2">"creator-wallet-address"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">percentage:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1">});</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="swap-tokens" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Swap Tokens<a href="#swap-tokens" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">PublicKey</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">"@solana/web3.js"</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">trade</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">PublicKey</span><span class="hl-1">(</span><span class="hl-2">"target-token-mint"</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-5">// amount</span><br/><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">PublicKey</span><span class="hl-1">(</span><span class="hl-2">"source-token-mint"</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-8">300</span><span class="hl-1"> </span><span class="hl-5">// 3% slippage</span><br/><span class="hl-1">);</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="lend-tokens" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Lend Tokens<a href="#lend-tokens" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">PublicKey</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">"@solana/web3.js"</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">lendAssets</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1"> </span><span class="hl-5">// amount of USDC to lend</span><br/><span class="hl-1">);</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="stake-sol" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Stake SOL<a href="#stake-sol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">stake</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1"> </span><span class="hl-5">// amount in SOL to stake</span><br/><span class="hl-1">);</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="stake-sol-on-solayer" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Stake SOL on Solayer<a href="#stake-sol-on-solayer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">restake</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1"> </span><span class="hl-5">// amount in SOL to stake</span><br/><span class="hl-1">);</span><br/>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="send-an-spl-token-airdrop-via-zk-compression" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Send an SPL Token Airdrop via ZK Compression<a href="#send-an-spl-token-airdrop-via-zk-compression" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">PublicKey</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">"@solana/web3.js"</span><span class="hl-1">;</span><br/><br/><span class="hl-1">(</span><span class="hl-6">async</span><span class="hl-1"> () </span><span class="hl-6">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-2">"~Airdrop cost estimate:"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">getAirdropCostEstimate</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-8">1000</span><span class="hl-1">, </span><span class="hl-5">// recipients</span><br/><span class="hl-1"> </span><span class="hl-8">30_000</span><span class="hl-1"> </span><span class="hl-5">// priority fee in lamports</span><br/><span class="hl-1"> )</span><br/><span class="hl-1"> );</span><br/><br/><span class="hl-1"> </span><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">sendCompressedAirdrop</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">PublicKey</span><span class="hl-1">(</span><span class="hl-2">"JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"</span><span class="hl-1">), </span><span class="hl-5">// mint</span><br/><span class="hl-1"> </span><span class="hl-8">42</span><span class="hl-1">, </span><span class="hl-5">// amount per recipient</span><br/><span class="hl-1"> [</span><br/><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">PublicKey</span><span class="hl-1">(</span><span class="hl-2">"1nc1nerator11111111111111111111111111111111"</span><span class="hl-1">),</span><br/><span class="hl-1"> </span><span class="hl-5">// ... add more recipients</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> </span><span class="hl-8">30_000</span><span class="hl-1"> </span><span class="hl-5">// priority fee in lamports</span><br/><span class="hl-1"> );</span><br/><span class="hl-1">})();</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="fetch-price-data-from-pyth" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Fetch Price Data from Pyth<a href="#fetch-price-data-from-pyth" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">priceFeedID</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">getPythPriceFeedID</span><span class="hl-1">(</span><span class="hl-2">"SOL"</span><span class="hl-1">);</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">price</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">getPythPrice</span><span class="hl-1">(</span><span class="hl-4">priceFeedID</span><span class="hl-1">);</span><br/><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-2">"Price of SOL/USD:"</span><span class="hl-1">, </span><span class="hl-4">price</span><span class="hl-1">);</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="open-perp-trade" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Open PERP Trade<a href="#open-perp-trade" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">PublicKey</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">"@solana/web3.js"</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">openPerpTradeLong</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-8">300</span><span class="hl-1">, </span><span class="hl-5">// $300 SOL Max price</span><br/><span class="hl-1"> </span><span class="hl-4">collateralAmount:</span><span class="hl-1"> </span><span class="hl-8">10</span><span class="hl-1">, </span><span class="hl-5">// 10 jitoSOL in</span><br/><span class="hl-1"> </span><span class="hl-4">collateralMint:</span><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">PublicKey</span><span class="hl-1">(</span><span class="hl-2">"J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn"</span><span class="hl-1">), </span><span class="hl-5">// jitoSOL</span><br/><span class="hl-1"> </span><span class="hl-4">leverage:</span><span class="hl-1"> </span><span class="hl-8">50000</span><span class="hl-1">, </span><span class="hl-5">// x5</span><br/><span class="hl-1"> </span><span class="hl-4">tradeMint:</span><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">PublicKey</span><span class="hl-1">(</span><span class="hl-2">"J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn"</span><span class="hl-1">), </span><span class="hl-5">// jitoSOL</span><br/><span class="hl-1"> </span><span class="hl-4">slippage:</span><span class="hl-1"> </span><span class="hl-8">0.3</span><span class="hl-1">, </span><span class="hl-5">// 0.3%</span><br/><span class="hl-1">});</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="close-perp-trade" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Close PERP Trade<a href="#close-perp-trade" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><span class="hl-3">import</span><span class="hl-1"> { </span><span class="hl-4">PublicKey</span><span class="hl-1"> } </span><span class="hl-3">from</span><span class="hl-1"> </span><span class="hl-2">"@solana/web3.js"</span><span class="hl-1">;</span><br/><br/><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">closePerpTradeLong</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-8">200</span><span class="hl-1">, </span><span class="hl-5">// $200 SOL price</span><br/><span class="hl-1"> </span><span class="hl-4">tradeMint:</span><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">PublicKey</span><span class="hl-1">(</span><span class="hl-2">"J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn"</span><span class="hl-1">), </span><span class="hl-5">// jitoSOL</span><br/><span class="hl-1">});</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="close-empty-token-accounts" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Close Empty Token Accounts<a href="#close-empty-token-accounts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><pre><code class="typescript"><br/><span class="hl-6">const</span><span class="hl-1"> { </span><span class="hl-7">signature</span><span class="hl-1"> } = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">closeEmptyTokenAccounts</span><span class="hl-1">();</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="create-a-drift-account" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Create a Drift account<a href="#create-a-drift-account" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Create a drift account with an initial token deposit.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">result</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">createDriftUserAccount</span><span class="hl-1">()</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="create-a-drift-vault" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Create a Drift Vault<a href="#create-a-drift-vault" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Create a drift vault.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">createDriftVault</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">"my-drift-vault"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">marketName:</span><span class="hl-1"> </span><span class="hl-2">"USDC-SPOT"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">redeemPeriod:</span><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-5">// in days</span><br/><span class="hl-1"> </span><span class="hl-4">maxTokens:</span><span class="hl-1"> </span><span class="hl-8">100000</span><span class="hl-1">, </span><span class="hl-5">// in token units e.g 100000 USDC</span><br/><span class="hl-1"> </span><span class="hl-4">minDepositAmount:</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1">, </span><span class="hl-5">// in token units e.g 5 USDC</span><br/><span class="hl-1"> </span><span class="hl-4">managementFee:</span><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-5">// 1%</span><br/><span class="hl-1"> </span><span class="hl-4">profitShare:</span><span class="hl-1"> </span><span class="hl-8">10</span><span class="hl-1">, </span><span class="hl-5">// 10%</span><br/><span class="hl-1"> </span><span class="hl-4">hurdleRate:</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1">, </span><span class="hl-5">// 5%</span><br/><span class="hl-1"> </span><span class="hl-4">permissioned:</span><span class="hl-1"> </span><span class="hl-6">false</span><span class="hl-1">, </span><span class="hl-5">// public vault or whitelist</span><br/><span class="hl-1">})</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="deposit-into-a-drift-vault" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Deposit into a Drift Vault<a href="#deposit-into-a-drift-vault" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Deposit tokens into a drift vault.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">depositIntoDriftVault</span><span class="hl-1">(</span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-2">"41Y8C4oxk4zgJT1KXyQr35UhZcfsp5mP86Z2G7UUzojU"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="deposit-into-your-drift-account" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Deposit into your Drift account<a href="#deposit-into-your-drift-account" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Deposit tokens into your drift account.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> {</span><span class="hl-7">txSig</span><span class="hl-1">} = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">depositToDriftUserAccount</span><span class="hl-1">(</span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-2">"USDC"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="derive-a-drift-vault-address" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Derive a Drift Vault address<a href="#derive-a-drift-vault-address" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Derive a drift vault address.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">vaultPublicKey</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">deriveDriftVaultAddress</span><span class="hl-1">(</span><span class="hl-2">"my-drift-vault"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="do-you-have-a-drift-account" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Do you have a Drift account<a href="#do-you-have-a-drift-account" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Check if agent has a drift account.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> {</span><span class="hl-7">hasAccount</span><span class="hl-1">, </span><span class="hl-7">account</span><span class="hl-1">} = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">doesUserHaveDriftAccount</span><span class="hl-1">()</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="get-drift-account-information" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Get Drift account information<a href="#get-drift-account-information" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Get drift account information.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">accountInfo</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">driftUserAccountInfo</span><span class="hl-1">()</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="request-withdrawal-from-drift-vault" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Request withdrawal from Drift vault<a href="#request-withdrawal-from-drift-vault" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Request withdrawal from drift vault.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">requestWithdrawalFromDriftVault</span><span class="hl-1">(</span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-2">"41Y8C4oxk4zgJT1KXyQr35UhZcfsp5mP86Z2G7UUzojU"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="carry-out-a-perpetual-trade-using-a-drift-vault" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Carry out a perpetual trade using a Drift vault<a href="#carry-out-a-perpetual-trade-using-a-drift-vault" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Open a perpertual trade using a drift vault that is delegated to you.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">tradeUsingDelegatedDriftVault</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">vault:</span><span class="hl-1"> </span><span class="hl-2">"41Y8C4oxk4zgJT1KXyQr35UhZcfsp5mP86Z2G7UUzojU"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">amount:</span><span class="hl-1"> </span><span class="hl-8">500</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-2">"SOL"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">action:</span><span class="hl-1"> </span><span class="hl-2">"long"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-2">"limit"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-8">180</span><span class="hl-1"> </span><span class="hl-5">// Please long limit order at $180/SOL</span><br/><span class="hl-1">})</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="carry-out-a-perpetual-trade-using-your-drift-account" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Carry out a perpetual trade using your Drift account<a href="#carry-out-a-perpetual-trade-using-your-drift-account" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Open a perpertual trade using your drift account.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">tradeUsingDriftPerpAccount</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">amount:</span><span class="hl-1"> </span><span class="hl-8">500</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">symbol:</span><span class="hl-1"> </span><span class="hl-2">"SOL"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">action:</span><span class="hl-1"> </span><span class="hl-2">"long"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-2">"limit"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">price:</span><span class="hl-1"> </span><span class="hl-8">180</span><span class="hl-1"> </span><span class="hl-5">// Please long limit order at $180/SOL</span><br/><span class="hl-1">})</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="update-drift-vault-parameters" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Update Drift vault parameters<a href="#update-drift-vault-parameters" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Update drift vault parameters.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">updateDriftVault</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-2">"my-drift-vault"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">marketName:</span><span class="hl-1"> </span><span class="hl-2">"USDC-SPOT"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">redeemPeriod:</span><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-5">// in days</span><br/><span class="hl-1"> </span><span class="hl-4">maxTokens:</span><span class="hl-1"> </span><span class="hl-8">100000</span><span class="hl-1">, </span><span class="hl-5">// in token units e.g 100000 USDC</span><br/><span class="hl-1"> </span><span class="hl-4">minDepositAmount:</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1">, </span><span class="hl-5">// in token units e.g 5 USDC</span><br/><span class="hl-1"> </span><span class="hl-4">managementFee:</span><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-5">// 1%</span><br/><span class="hl-1"> </span><span class="hl-4">profitShare:</span><span class="hl-1"> </span><span class="hl-8">10</span><span class="hl-1">, </span><span class="hl-5">// 10%</span><br/><span class="hl-1"> </span><span class="hl-4">hurdleRate:</span><span class="hl-1"> </span><span class="hl-8">5</span><span class="hl-1">, </span><span class="hl-5">// 5%</span><br/><span class="hl-1"> </span><span class="hl-4">permissioned:</span><span class="hl-1"> </span><span class="hl-6">false</span><span class="hl-1">, </span><span class="hl-5">// public vault or whitelist</span><br/><span class="hl-1">})</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="withdraw-from-drift-account" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Withdraw from Drift account<a href="#withdraw-from-drift-account" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Withdraw tokens from your drift account.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> {</span><span class="hl-7">txSig</span><span class="hl-1">} = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">withdrawFromDriftAccount</span><span class="hl-1">(</span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-2">"USDC"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="borrow-from-drift" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Borrow from Drift<a href="#borrow-from-drift" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Borrow tokens from drift.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> {</span><span class="hl-7">txSig</span><span class="hl-1">} = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">withdrawFromDriftAccount</span><span class="hl-1">(</span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-2">"SOL"</span><span class="hl-1">, </span><span class="hl-6">true</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="repay-drift-loan" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Repay Drift loan<a href="#repay-drift-loan" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Repay a loan from drift.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> {</span><span class="hl-7">txSig</span><span class="hl-1">} = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">depositToDriftUserAccount</span><span class="hl-1">(</span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-2">"SOL"</span><span class="hl-1">, </span><span class="hl-6">true</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="withdraw-from-drift-vault" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Withdraw from Drift vault<a href="#withdraw-from-drift-vault" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Withdraw tokens from a drift vault after the redemption period has elapsed.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">withdrawFromDriftVault</span><span class="hl-1">( </span><span class="hl-2">"41Y8C4oxk4zgJT1KXyQr35UhZcfsp5mP86Z2G7UUzojU"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="update-the-address-a-drift-vault-is-delegated-to" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Update the address a Drift vault is delegated to<a href="#update-the-address-a-drift-vault-is-delegated-to" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Update the address a drift vault is delegated to.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">updateDriftVaultDelegate</span><span class="hl-1">(</span><span class="hl-2">"41Y8C4oxk4zgJT1KXyQr35UhZcfsp5mP86Z2G7UUzojU"</span><span class="hl-1">, </span><span class="hl-2">"new-address"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="get-voltr-vault-position-values" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Get Voltr Vault Position Values<a href="#get-voltr-vault-position-values" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Get the current position values and total value of assets in a Voltr vault.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">values</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">voltrGetPositionValues</span><span class="hl-1">(</span><span class="hl-2">"7opUkqYtxmQRriZvwZkPcg6LqmGjAh1RSEsVrdsGDx5K"</span><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="deposit-into-voltr-strategy" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Deposit into Voltr Strategy<a href="#deposit-into-voltr-strategy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Deposit assets into a specific strategy within a Voltr vault.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">voltrDepositStrategy</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">BN</span><span class="hl-1">(</span><span class="hl-2">"1000000000"</span><span class="hl-1">), </span><span class="hl-5">// amount in base units (e.g., 1 USDC = 1000000)</span><br/><span class="hl-1"> </span><span class="hl-2">"7opUkqYtxmQRriZvwZkPcg6LqmGjAh1RSEsVrdsGDx5K"</span><span class="hl-1">, </span><span class="hl-5">// vault</span><br/><span class="hl-1"> </span><span class="hl-2">"9ZQQYvr4x7AMqd6abVa1f5duGjti5wk1MHsX6hogPsLk"</span><span class="hl-1"> </span><span class="hl-5">// strategy</span><br/><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="withdraw-from-voltr-strategy" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Withdraw from Voltr Strategy<a href="#withdraw-from-voltr-strategy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Withdraw assets from a specific strategy within a Voltr vault.</p>
|
|
<pre><code class="typescript"><span class="hl-6">const</span><span class="hl-1"> </span><span class="hl-7">signature</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">agent</span><span class="hl-1">.</span><span class="hl-0">voltrWithdrawStrategy</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-6">new</span><span class="hl-1"> </span><span class="hl-0">BN</span><span class="hl-1">(</span><span class="hl-2">"1000000000"</span><span class="hl-1">), </span><span class="hl-5">// amount in base units (e.g., 1 USDC = 1000000)</span><br/><span class="hl-1"> </span><span class="hl-2">"7opUkqYtxmQRriZvwZkPcg6LqmGjAh1RSEsVrdsGDx5K"</span><span class="hl-1">, </span><span class="hl-5">// vault</span><br/><span class="hl-1"> </span><span class="hl-2">"9ZQQYvr4x7AMqd6abVa1f5duGjti5wk1MHsX6hogPsLk"</span><span class="hl-1"> </span><span class="hl-5">// strategy</span><br/><span class="hl-1">)</span>
|
|
</code><button type="button">Copy</button></pre>
|
|
|
|
<a id="examples" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Examples<a href="#examples" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="langgraph-multi-agent-system" class="tsd-anchor"></a><h3 class="tsd-anchor-link">LangGraph Multi-Agent System<a href="#langgraph-multi-agent-system" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The repository includes an advanced example of building a multi-agent system using LangGraph and Solana Agent Kit. Located in <code>examples/agent-kit-langgraph</code>, this example demonstrates:</p>
|
|
<ul>
|
|
<li>Multi-agent architecture using LangGraph's StateGraph</li>
|
|
<li>Specialized agents for different tasks:
|
|
<ul>
|
|
<li>General purpose agent for basic queries</li>
|
|
<li>Transfer/Swap agent for transaction operations</li>
|
|
<li>Read agent for blockchain data queries</li>
|
|
<li>Manager agent for routing and orchestration</li>
|
|
</ul>
|
|
</li>
|
|
<li>Fully typed TypeScript implementation</li>
|
|
<li>Environment-based configuration</li>
|
|
</ul>
|
|
<p>Check out the <a href="examples/agent-kit-langgraph">LangGraph example</a> for a complete implementation of an advanced Solana agent system.</p>
|
|
<a id="dependencies" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Dependencies<a href="#dependencies" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The toolkit relies on several key Solana and Metaplex libraries:</p>
|
|
<ul>
|
|
<li>@solana/web3.js</li>
|
|
<li>@solana/spl-token</li>
|
|
<li>@metaplex-foundation/mpl-token-metadata</li>
|
|
<li>@metaplex-foundation/mpl-core</li>
|
|
<li>@metaplex-foundation/umi</li>
|
|
<li>@lightprotocol/compressed-token</li>
|
|
<li>@lightprotocol/stateless.js</li>
|
|
</ul>
|
|
<a id="contributing" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contributing<a href="#contributing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Contributions are welcome! Please feel free to submit a Pull Request.
|
|
Refer to <a href="media/CONTRIBUTING.md">CONTRIBUTING.md</a> for detailed guidelines on how to contribute to this project.</p>
|
|
<a id="contributors" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Contributors<a href="#contributors" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a href="https://github.com/sendaifun/solana-agent-kit/graphs/contributors">
|
|
<img src="https://contrib.rocks/image?repo=sendaifun/solana-agent-kit" />
|
|
</a>
|
|
<a id="star-history" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Star History<a href="#star-history" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p><a href="https://star-history.com/#sendaifun/solana-agent-kit&Date"><img src="https://api.star-history.com/svg?repos=sendaifun/solana-agent-kit&type=Date" alt="Star History Chart"></a></p>
|
|
<a id="license" class="tsd-anchor"></a><h2 class="tsd-anchor-link">License<a href="#license" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Apache-2 License</p>
|
|
<a id="funding" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Funding<a href="#funding" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>If you wanna give back any tokens or donations to the OSS community -- The Public Solana Agent Kit Treasury Address:</p>
|
|
<p>Solana Network : EKHTbXpsm6YDgJzMkFxNU1LNXeWcUW7Ezf8mjUNQQ4Pa</p>
|
|
<a id="security" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Security<a href="#security" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>This toolkit handles private keys and transactions. Always ensure you're using it in a secure environment and never share your private keys.</p>
|
|
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#solana-agent-kit"><span>Solana <wbr/>Agent <wbr/>Kit</span></a><ul><li><a href="#🔧-core-blockchain-features"><span>🔧 <wbr/>Core <wbr/>Blockchain <wbr/>Features</span></a></li><li><a href="#🤖-ai-integration-features"><span>🤖 AI <wbr/>Integration <wbr/>Features</span></a></li><li><a href="#📃-documentation"><span>📃 <wbr/>Documentation</span></a></li><li><a href="#📦-installation"><span>📦 <wbr/>Installation</span></a></li><li><a href="#quick-start"><span>Quick <wbr/>Start</span></a></li><li><a href="#usage-examples"><span>Usage <wbr/>Examples</span></a></li><li><ul><li><a href="#deploy-a-new-token"><span>Deploy a <wbr/>New <wbr/>Token</span></a></li><li><a href="#create-nft-collection-on-3land"><span>Create NFT <wbr/>Collection on 3<wbr/>Land</span></a></li><li><a href="#create-nft-on-3land"><span>Create NFT on 3<wbr/>Land</span></a></li><li><a href="#create-nft-collection"><span>Create NFT <wbr/>Collection</span></a></li><li><a href="#swap-tokens"><span>Swap <wbr/>Tokens</span></a></li><li><a href="#lend-tokens"><span>Lend <wbr/>Tokens</span></a></li><li><a href="#stake-sol"><span>Stake SOL</span></a></li><li><a href="#stake-sol-on-solayer"><span>Stake SOL on <wbr/>Solayer</span></a></li><li><a href="#send-an-spl-token-airdrop-via-zk-compression"><span>Send an SPL <wbr/>Token <wbr/>Airdrop via ZK <wbr/>Compression</span></a></li><li><a href="#fetch-price-data-from-pyth"><span>Fetch <wbr/>Price <wbr/>Data from <wbr/>Pyth</span></a></li><li><a href="#open-perp-trade"><span>Open PERP <wbr/>Trade</span></a></li><li><a href="#close-perp-trade"><span>Close PERP <wbr/>Trade</span></a></li><li><a href="#close-empty-token-accounts"><span>Close <wbr/>Empty <wbr/>Token <wbr/>Accounts</span></a></li><li><a href="#create-a-drift-account"><span>Create a <wbr/>Drift account</span></a></li><li><a href="#create-a-drift-vault"><span>Create a <wbr/>Drift <wbr/>Vault</span></a></li><li><a href="#deposit-into-a-drift-vault"><span>Deposit into a <wbr/>Drift <wbr/>Vault</span></a></li><li><a href="#deposit-into-your-drift-account"><span>Deposit into your <wbr/>Drift account</span></a></li><li><a href="#derive-a-drift-vault-address"><span>Derive a <wbr/>Drift <wbr/>Vault address</span></a></li><li><a href="#do-you-have-a-drift-account"><span>Do you have a <wbr/>Drift account</span></a></li><li><a href="#get-drift-account-information"><span>Get <wbr/>Drift account information</span></a></li><li><a href="#request-withdrawal-from-drift-vault"><span>Request withdrawal from <wbr/>Drift vault</span></a></li><li><a href="#carry-out-a-perpetual-trade-using-a-drift-vault"><span>Carry out a perpetual trade using a <wbr/>Drift vault</span></a></li><li><a href="#carry-out-a-perpetual-trade-using-your-drift-account"><span>Carry out a perpetual trade using your <wbr/>Drift account</span></a></li><li><a href="#update-drift-vault-parameters"><span>Update <wbr/>Drift vault parameters</span></a></li><li><a href="#withdraw-from-drift-account"><span>Withdraw from <wbr/>Drift account</span></a></li><li><a href="#borrow-from-drift"><span>Borrow from <wbr/>Drift</span></a></li><li><a href="#repay-drift-loan"><span>Repay <wbr/>Drift loan</span></a></li><li><a href="#withdraw-from-drift-vault"><span>Withdraw from <wbr/>Drift vault</span></a></li><li><a href="#update-the-address-a-drift-vault-is-delegated-to"><span>Update the address a <wbr/>Drift vault is delegated to</span></a></li><li><a href="#get-voltr-vault-position-values"><span>Get <wbr/>Voltr <wbr/>Vault <wbr/>Position <wbr/>Values</span></a></li><li><a href="#deposit-into-voltr-strategy"><span>Deposit into <wbr/>Voltr <wbr/>Strategy</span></a></li><li><a href="#withdraw-from-voltr-strategy"><span>Withdraw from <wbr/>Voltr <wbr/>Strategy</span></a></li></ul></li><li><a href="#examples"><span>Examples</span></a></li><li><ul><li><a href="#langgraph-multi-agent-system"><span>Lang<wbr/>Graph <wbr/>Multi-<wbr/>Agent <wbr/>System</span></a></li></ul></li><li><a href="#dependencies"><span>Dependencies</span></a></li><li><a href="#contributing"><span>Contributing</span></a></li><li><a href="#contributors"><span>Contributors</span></a></li><li><a href="#star-history"><span>Star <wbr/>History</span></a></li><li><a href="#license"><span>License</span></a></li><li><a href="#funding"><span>Funding</span></a></li><li><a href="#security"><span>Security</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">solana-agent-kit</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|