agentipy
The #Python framework for connecting AI agents to any onchain app on @solana-labs 🤖🐍
Stars: 153
Agentipy is a powerful toolkit for interacting with the Solana blockchain, providing easy-to-use functions for token operations, trading, yield farming, LangChain integration, performance tracking, token data retrieval, pump & fun token launching, Meteora DLMM pool creation, and more. It offers features like token transfers, balance checks, staking, deploying new tokens, requesting faucet funds, trading with customizable slippage, yield farming with Lulo, and accessing LangChain tools for enhanced blockchain interactions. Users can also track current transactions per second (TPS), fetch token data by ticker or address, launch pump & fun tokens, create Meteora DLMM pools, buy/sell tokens with Raydium liquidity, and burn/close token accounts individually or in batches.
README:
A powerful toolkit for interacting with the Solana blockchain, providing easy-to-use functions for token operations, trading, and more. Now integrated with LangChain for enhanced functionality.
-
🪙 Token Operations
- Transfer SOL and SPL tokens
- Check token balances
- Stake SOL
- Deploy new tokens
- Request faucet funds
- Burn and close token accounts
- Batch burn and close token accounts
-
💱 Trading
- Integrated Jupiter Exchange support
- Token swaps with customizable slippage
- Direct routing options
- Buy and sell tokens with Raydium liquidity
-
🏦 Yield Farming
- Lend idle assets to earn interest with Lulo
-
🔗 LangChain Integration
- Utilize LangChain tools for enhanced blockchain interactions
- Access a suite of tools for balance checks, transfers, token deployments, and more
-
📈 Performance Tracking
- Fetch current transactions per second (TPS) on the Solana network
-
📊 Token Data
- Get token data by ticker
- Get token data by address
-
🚀 Pump & Fun Tokens
- Launch Pump & Fun tokens with customizable options
-
🏦 Meteora DLMM Pools
- Create Meteora DLMM pools with various configurations
pip install agentipy
from agentipy import SolanaAgentKit, create_solana_tools
# Initialize with private key and optional RPC URL
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
# Create LangChain tools
tools = create_solana_tools(agent)
from agentipy import SolanaAgentKit
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
# Get balance
balance = await agent.fetch_price("FKMKctiJnbZKL16pCmR7ig6bvjcMJffuUMjB97YD7LJs")
print(f"Price: {balance} SOL")
# Run the async function
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
from solders.pubkey import Pubkey
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
signature = await agent.trade(
agent,
output_mint=Pubkey.from_string("target-token-mint"),
input_amount=100, # amount
input_mint=Pubkey.from_string("source-token-mint"),
slippage_bps=300 # 3% slippage
)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
from solders.pubkey import Pubkey
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
signature = await agent.lend_assets(
amount=100 # amount
)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
from solders.pubkey import Pubkey
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
signature = await agent.stake(
amount=1 # amount in SOL
)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
response = await agent.request_faucet_funds()
print(response)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
tps = await agent.get_tps()
print(f"Current TPS: {tps}")
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
token_data = await agent.get_token_data_by_ticker("SOL")
print(token_data)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
from solders.pubkey import Pubkey
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
token_data = await agent.get_token_data_by_address("your-token-mint-address")
print(token_data)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
from agentipy.types import PumpfunTokenOptions
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
options = PumpfunTokenOptions(
# Add your options here
)
response = await agent.launch_pump_fun_token(
token_name="MyToken",
token_ticker="MTK",
description="This is a fun token",
image_url="https://example.com/image.png",
options=options
)
print(response)
from agentipy import SolanaAgentKit
from solders.pubkey import Pubkey
from agentipy.utils.meteora_dlmm.types import ActivationType
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
response = await agent.create_meteora_dlmm_pool(
bin_step=1,
token_a_mint=Pubkey.from_string("token-a-mint"),
token_b_mint=Pubkey.from_string("token-b-mint"),
initial_price=1.0,
price_rounding_up=True,
fee_bps=30,
activation_type=ActivationType.Timestamp,
has_alpha_vault=True,
activation_point=None
)
print(response)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
from solders.pubkey import Pubkey
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
confirmed = await agent.buy_with_raydium(
pair_address=Pubkey.from_string("target-pair-address"), # The pair you want to buy from
sol_in=1, # Amount of SOL or input token to spend
slippage=300 # Maximum slippage in basis points (3% here)
)
print(f"Transaction confirmed: {confirmed}")
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
from solders.pubkey import Pubkey
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
confirmed = await agent.sell_with_raydium(
input_mint=Pubkey.from_string("source-token-mint"), # The token you want to sell
percentage=100,
slippage_bps=250 # Maximum slippage in basis points (2.5% here)
)
print(f"Transaction confirmed: {confirmed}")
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
response = await agent.burn_and_close_accounts("token-account-address")
print("Account burned and closed:", response)
import asyncio
asyncio.run(main())
from agentipy import SolanaAgentKit
async def main():
agent = SolanaAgentKit(
"your-wallet-private-key-as-base58",
"https://api.mainnet-beta.solana.com",
"your-openai-api-key"
)
token_accounts = ["token-account-address-1", "token-account-address-2"]
responses = await agent.multiple_burn_and_close_accounts(token_accounts)
print("Accounts burned and closed:", responses)
import asyncio
asyncio.run(main())
Transfer SOL or SPL tokens to a recipient.
Swap tokens using Jupiter Exchange integration.
Check SOL or token balance for the agent's wallet.
Lend idle assets to earn interest with Lulo.
Stake SOL with Jupiter to earn rewards.
Request faucet funds for testing purposes.
Deploy a new token with specified decimals.
Fetch the price of a token.
Fetch the current transactions per second (TPS) on the Solana network.
Get token data by ticker.
Get token data by address.
Launch a Pump & Fun token with customizable options.
create_meteora_dlmm_pool(agent, bin_step, token_a_mint, token_b_mint, initial_price, price_rounding_up, fee_bps, activation_type, has_alpha_vault, activation_point)
Create a Meteora DLMM pool with various configurations.
Buy tokens from Raydium liquidity pools.
Sell tokens using Raydium liquidity pools.
Burns and closes token account.
Burns and closes multiple token accounts.
The toolkit relies on several key Solana and Metaplex libraries:
- solana-py
- spl-token-py
Contributions are welcome! Please feel free to submit a Pull Request.
ISC License
This toolkit handles private keys and transactions. Always ensure you're using it in a secure environment and never share your private keys.
For Tasks:
Click tags to check more tools for each tasksFor Jobs:
Alternative AI tools for agentipy
Similar Open Source Tools
agentipy
Agentipy is a powerful toolkit for interacting with the Solana blockchain, providing easy-to-use functions for token operations, trading, yield farming, LangChain integration, performance tracking, token data retrieval, pump & fun token launching, Meteora DLMM pool creation, and more. It offers features like token transfers, balance checks, staking, deploying new tokens, requesting faucet funds, trading with customizable slippage, yield farming with Lulo, and accessing LangChain tools for enhanced blockchain interactions. Users can also track current transactions per second (TPS), fetch token data by ticker or address, launch pump & fun tokens, create Meteora DLMM pools, buy/sell tokens with Raydium liquidity, and burn/close token accounts individually or in batches.
python-genai
The Google Gen AI SDK is a Python library that provides access to Google AI and Vertex AI services. It allows users to create clients for different services, work with parameter types, models, generate content, call functions, handle JSON response schemas, stream text and image content, perform async operations, count and compute tokens, embed content, generate and upscale images, edit images, work with files, create and get cached content, tune models, distill models, perform batch predictions, and more. The SDK supports various features like automatic function support, manual function declaration, JSON response schema support, streaming for text and image content, async methods, tuning job APIs, distillation, batch prediction, and more.
solana-agent-kit
Solana Agent Kit is an open-source toolkit designed for connecting AI agents to Solana protocols. It enables agents, regardless of the model used, to autonomously perform various Solana actions such as trading tokens, launching new tokens, lending assets, sending compressed airdrops, executing blinks, and more. The toolkit integrates core blockchain features like token operations, NFT management via Metaplex, DeFi integration, Solana blinks, AI integration features with LangChain, autonomous modes, and AI tools. It provides ready-to-use tools for blockchain operations, supports autonomous agent actions, and offers features like memory management, real-time feedback, and error handling. Solana Agent Kit facilitates tasks such as deploying tokens, creating NFT collections, swapping tokens, lending tokens, staking SOL, and sending SPL token airdrops via ZK compression. It also includes functionalities for fetching price data from Pyth and relies on key Solana and Metaplex libraries for its operations.
llama_ros
This repository provides a set of ROS 2 packages to integrate llama.cpp into ROS 2. By using the llama_ros packages, you can easily incorporate the powerful optimization capabilities of llama.cpp into your ROS 2 projects by running GGUF-based LLMs and VLMs.
pyllms
PyLLMs is a minimal Python library designed to connect to various Language Model Models (LLMs) such as OpenAI, Anthropic, Google, AI21, Cohere, Aleph Alpha, and HuggingfaceHub. It provides a built-in model performance benchmark for fast prototyping and evaluating different models. Users can easily connect to top LLMs, get completions from multiple models simultaneously, and evaluate models on quality, speed, and cost. The library supports asynchronous completion, streaming from compatible models, and multi-model initialization for testing and comparison. Additionally, it offers features like passing chat history, system messages, counting tokens, and benchmarking models based on quality, speed, and cost.
candle-vllm
Candle-vllm is an efficient and easy-to-use platform designed for inference and serving local LLMs, featuring an OpenAI compatible API server. It offers a highly extensible trait-based system for rapid implementation of new module pipelines, streaming support in generation, efficient management of key-value cache with PagedAttention, and continuous batching. The tool supports chat serving for various models and provides a seamless experience for users to interact with LLMs through different interfaces.
e2m
E2M is a Python library that can parse and convert various file types into Markdown format. It supports the conversion of multiple file formats, including doc, docx, epub, html, htm, url, pdf, ppt, pptx, mp3, and m4a. The ultimate goal of the E2M project is to provide high-quality data for Retrieval-Augmented Generation (RAG) and model training or fine-tuning. The core architecture consists of a Parser responsible for parsing various file types into text or image data, and a Converter responsible for converting text or image data into Markdown format.
aio-scrapy
Aio-scrapy is an asyncio-based web crawling and web scraping framework inspired by Scrapy. It supports distributed crawling/scraping, implements compatibility with scrapyd, and provides options for using redis queue and rabbitmq queue. The framework is designed for fast extraction of structured data from websites. Aio-scrapy requires Python 3.9+ and is compatible with Linux, Windows, macOS, and BSD systems.
pocketgroq
PocketGroq is a tool that provides advanced functionalities for text generation, web scraping, web search, and AI response evaluation. It includes features like an Autonomous Agent for answering questions, web crawling and scraping capabilities, enhanced web search functionality, and flexible integration with Ollama server. Users can customize the agent's behavior, evaluate responses using AI, and utilize various methods for text generation, conversation management, and Chain of Thought reasoning. The tool offers comprehensive methods for different tasks, such as initializing RAG, error handling, and tool management. PocketGroq is designed to enhance development processes and enable the creation of AI-powered applications with ease.
dynamiq
Dynamiq is an orchestration framework designed to streamline the development of AI-powered applications, specializing in orchestrating retrieval-augmented generation (RAG) and large language model (LLM) agents. It provides an all-in-one Gen AI framework for agentic AI and LLM applications, offering tools for multi-agent orchestration, document indexing, and retrieval flows. With Dynamiq, users can easily build and deploy AI solutions for various tasks.
client-python
The Mistral Python Client is a tool inspired by cohere-python that allows users to interact with the Mistral AI API. It provides functionalities to access and utilize the AI capabilities offered by Mistral. Users can easily install the client using pip and manage dependencies using poetry. The client includes examples demonstrating how to use the API for various tasks, such as chat interactions. To get started, users need to obtain a Mistral API Key and set it as an environment variable. Overall, the Mistral Python Client simplifies the integration of Mistral AI services into Python applications.
clarifai-python
The Clarifai Python SDK offers a comprehensive set of tools to integrate Clarifai's AI platform to leverage computer vision capabilities like classification , detection ,segementation and natural language capabilities like classification , summarisation , generation , Q&A ,etc into your applications. With just a few lines of code, you can leverage cutting-edge artificial intelligence to unlock valuable insights from visual and textual content.
code-graph
Code-graph is a tool composed of FalkorDB Graph DB, Code-Graph-Backend, and Code-Graph-Frontend. It allows users to store and query graphs, manage backend logic, and interact with the website. Users can run the components locally by setting up environment variables and installing dependencies. The tool supports analyzing C & Python source files with plans to add support for more languages in the future. It provides a local repository analysis feature and a live demo accessible through a web browser.
LLM-Tuning
LLM-Tuning is a collection of tools and resources for fine-tuning large language models (LLMs). It includes a library of pre-trained LoRA models, a set of tutorials and examples, and a community forum for discussion and support. LLM-Tuning makes it easy to fine-tune LLMs for a variety of tasks, including text classification, question answering, and dialogue generation. With LLM-Tuning, you can quickly and easily improve the performance of your LLMs on downstream tasks.
acte
Acte is a framework designed to build GUI-like tools for AI Agents. It aims to address the issues of cognitive load and freedom degrees when interacting with multiple APIs in complex scenarios. By providing a graphical user interface (GUI) for Agents, Acte helps reduce cognitive load and constraints interaction, similar to how humans interact with computers through GUIs. The tool offers APIs for starting new sessions, executing actions, and displaying screens, accessible via HTTP requests or the SessionManager class.
For similar tasks
agentipy
Agentipy is a powerful toolkit for interacting with the Solana blockchain, providing easy-to-use functions for token operations, trading, yield farming, LangChain integration, performance tracking, token data retrieval, pump & fun token launching, Meteora DLMM pool creation, and more. It offers features like token transfers, balance checks, staking, deploying new tokens, requesting faucet funds, trading with customizable slippage, yield farming with Lulo, and accessing LangChain tools for enhanced blockchain interactions. Users can also track current transactions per second (TPS), fetch token data by ticker or address, launch pump & fun tokens, create Meteora DLMM pools, buy/sell tokens with Raydium liquidity, and burn/close token accounts individually or in batches.
For similar jobs
agentipy
Agentipy is a powerful toolkit for interacting with the Solana blockchain, providing easy-to-use functions for token operations, trading, yield farming, LangChain integration, performance tracking, token data retrieval, pump & fun token launching, Meteora DLMM pool creation, and more. It offers features like token transfers, balance checks, staking, deploying new tokens, requesting faucet funds, trading with customizable slippage, yield farming with Lulo, and accessing LangChain tools for enhanced blockchain interactions. Users can also track current transactions per second (TPS), fetch token data by ticker or address, launch pump & fun tokens, create Meteora DLMM pools, buy/sell tokens with Raydium liquidity, and burn/close token accounts individually or in batches.
aiken
Aiken is a modern smart contract platform for Cardano, providing a user-friendly environment for developing and deploying smart contracts. It supports Linux, MacOS, and Windows operating systems. Aiken is designed to simplify the process of creating smart contracts on the Cardano blockchain, offering a seamless experience for developers. The platform is named after Howard Aiken, an American physicist and computing pioneer.
t3rn-airdrop-bot
A bot designed to automate transactions and bridge assets on the t3rn network, making the process seamless and efficient. It supports multiple wallets through a JSON file containing private keys, with robust error handling and retry mechanisms. The tool is user-friendly, easy to set up, and supports bridging from Optimism Sepolia and Arbitrum Sepolia.
ethereum-etl-airflow
This repository contains Airflow DAGs for extracting, transforming, and loading (ETL) data from the Ethereum blockchain into BigQuery. The DAGs use the Google Cloud Platform (GCP) services, including BigQuery, Cloud Storage, and Cloud Composer, to automate the ETL process. The repository also includes scripts for setting up the GCP environment and running the DAGs locally.
airnode
Airnode is a fully-serverless oracle node that is designed specifically for API providers to operate their own oracles.
CHATPGT-MEV-BOT
The 𝓜𝓔𝓥-𝓑𝓞𝓣 is a revolutionary tool that empowers users to maximize their ETH earnings through advanced slippage techniques within the Ethereum ecosystem. Its user-centric design, optimized earning mechanism, and comprehensive security measures make it an indispensable tool for traders seeking to enhance their crypto trading strategies. With its current free access, there's no better time to explore the 𝓜𝓔𝓥-𝓑𝓞𝓣's capabilities and witness the transformative impact it can have on your crypto trading journey.
CortexTheseus
CortexTheseus is a full node implementation of the Cortex blockchain, written in C++. It provides a complete set of features for interacting with the Cortex network, including the ability to create and manage accounts, send and receive transactions, and participate in consensus. CortexTheseus is designed to be scalable, secure, and easy to use, making it an ideal choice for developers building applications on the Cortex blockchain.
CHATPGT-MEV-BOT-ETH
This tool is a bot that monitors the performance of MEV transactions on the Ethereum blockchain. It provides real-time data on MEV profitability, transaction volume, and network congestion. The bot can be used to identify profitable MEV opportunities and to track the performance of MEV strategies.