Skip to content

SWQuery/swquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SWquery

"Connecting intelligence and accessibility to the world of blockchain transactions."

SWquery Banner


Roadmap

  • Multiple Agents
  • Jupiter Integration
  • Rug Check
  • Social Media Check
  • Search tokens
  • New RPC Methods

πŸ“œ About the Project

SWquery (Smart Wallet Query) is an innovative solution that simplifies interaction with transactions on the Solana blockchain. It offers a user-friendly interface and a versatile SDK in Rust, integrating natural language processing (NLP) to make blockchain queries intuitive and accessible.


🚨 The Problem

Blockchain is powerful but presents challenges:

  • Complex Data: On-chain transactions are difficult for non-technical users to interpret.
  • Lack of Accessible Tools: Existing solutions require advanced technical knowledge.
  • Difficulty in Customization: Few tools offer modular integration or customizable interfaces.

These barriers limit adoption and efficiency for both users and developers.


πŸ’‘ Our Solution

SWquery addresses these challenges with:

  • Natural Language Queries: Ask "What were my transactions greater than 10 SOL in the last week?" and receive clear and structured responses.
  • Intelligent Chatbot: An integrated assistant that helps in visualization and customization of queries.
  • SDK in Rust: A toolkit for developers to create customized solutions.
  • Real-Time Notifications: Receive automatic alerts of important transactions directly in the interface.

🎯 Use Cases

1. End User

  • Problem: Difficulty in understanding blockchain transactions.
  • Solution: Use SWquery to query "Which transactions involve more than 100 USDC in the last 30 days?" and receive a detailed visual summary.

2. Developers

  • Problem: Need to integrate on-chain data into their applications.
  • Solution: The SDK allows easy access to transactions and metadata, optimized for robust integrations.

3. Companies

  • Problem: Monitoring transactions in real time.
  • Solution: Utilize notifications for instant alerts of on-chain events.

🌟 Features

  • Natural Language: Perform intuitive queries directly on the blockchain.
  • Customized Chatbot: Assist users with explanations and actions based on their data.
  • Modular SDK: Complete tools for developers to use in any application.
  • Interactive Visualizations: Graphs and tables to facilitate transaction analysis.

πŸ› οΈ Technologies Used

Technology Usage
Rust SDK for integration with Solana
Next.js Interactive frontend
OpenAI Natural language processing

πŸ”§ Architecture Diagram

Project Architecture


πŸ“¦ How to Use

1. Installing the SDK

Add the SWquery SDK to your project by including the following in your Cargo.toml:

[dependencies]
swquery = "0.0.2"

Alternatively, run the command:

cargo add swquery

Then, build the project:

cargo build

2. Initializing the Client

To start using the SWquery SDK, initialize the SWqueryClient with your API keys and configuration.

use swquery::SWqueryClient;
use std::time::Duration;

#[tokio::main]
async fn main() {
    let client = SWqueryClient::new(
        "YOUR_AGENT_API_KEY".to_string(),
        "YOUR_HELIUS_API_KEY".to_string(),
        Some(Duration::from_secs(10)),
        None,
    );
}

3. Basic Query to Fetch Transactions

You can easily fetch transactions for a specific wallet by passing natural language queries.

let response = client
    .query("Get transactions above 10 SOL", "YourWalletAddress")
    .await
    .unwrap();

println!("Response: {:#?}", response);

Common Errors and Troubleshooting

  • Invalid API Key: Ensure the api_key and helius_api_key are correct and have sufficient permissions.
  • Timeout Issues: Increase the timeout during initialization if API calls are timing out.
  • Invalid Address: Ensure wallet addresses are in the correct Solana format.

Advanced Configuration

You can adjust the network and timeout settings to fit your requirements:

let client = SWqueryClient::new(
    "YOUR_AGENT_API_KEY".to_string(),
    "YOUR_HELIUS_API_KEY".to_string(),
    Some(Duration::from_secs(20)),   // Custom timeout
    Some(Network::Devnet),           // Use Solana Devnet
);

This enables fetching data from the Solana Devnet instead of the default Mainnet.

With these steps, you are ready to integrate blockchain intelligence directly into your applications using the SWquery SDK. πŸš€


🌳 Project Structure

.
β”œβ”€β”€ ai-agent
β”‚   β”œβ”€β”€ configs
β”‚   β”œβ”€β”€ controllers
β”‚   β”œβ”€β”€ middlewares
β”‚   └── services
β”œβ”€β”€ credit-sales
β”‚   └── src
β”‚       β”œβ”€β”€ instructions
β”‚       β”œβ”€β”€ state
β”‚       └── tests
β”œβ”€β”€ deployment
β”‚   └── server
β”‚       └── database
β”œβ”€β”€ frontend
β”‚   β”œβ”€β”€ public
β”‚   └── src
β”‚       β”œβ”€β”€ app
β”‚       β”œβ”€β”€ components
β”‚       β”œβ”€β”€ lib
β”‚       β”œβ”€β”€ providers
β”‚       └── services
β”œβ”€β”€ server
β”‚   β”œβ”€β”€ database
β”‚   └── src
β”‚       β”œβ”€β”€ models
β”‚       └── routes
└── swquery
    └── src
        β”œβ”€β”€ llm
        β”œβ”€β”€ models
        └── utils.rs
  • ai-agent: Python services and controllers for AI-related functionality.
  • credit-sales: Rust program handling on-chain credit operations.
  • deployment: Configuration for container orchestration and database setup.
  • frontend: Next.js project for the web interface, components, and assets.
  • server: Rust backend server code, database migrations, and routes.
  • swquery: Core SDK logic in Rust, including NLP functionalities.
  • test-ts: TypeScript-based tests and supporting infrastructure.

πŸ‘₯ Our Team

Profile
Arthur Bretas
Profile
Marcelo Feitoza
Profile
Victor Carvalho
Profile
Pedro Hagge

Made with ❀️ by the SWquery team πŸš€

About

Query transactions with natural language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5