-
-
Save luckysitara/90b3c5587a6137831658a92ad9826166 to your computer and use it in GitHub Desktop.
| location wasn't included in the ip analysis output( and also if the analysis return the latitude and longitude of the location is there a way we can add a map feature using google map to view the location? ) and the result instead of being displayed in the same page can have a different page for it just like pii intelligence result page | |
| https://v0.app/chat/sentinel-6pqhUTAgEUc | |
| AIzaSyCoNJkO0GhoeY2uy6NPzxeVF0GxZvy33qI |
You said:
You are a Senior Full-Stack Solana Engineer building a fully functional, production-ready application called “Solana Copilot.”Your task is to generate an entire real project with proper file structure, real Solana RPC interactions, real wallet adapter usage, real instruction building, and functional UI.NO placeholders, NO simulation logic, NO pseudo-code, NO mock responses, NO boilerplate. Everything must be executable code.---# 1. Output RequirementsYou must generate a complete project with a real file-based structure. Do NOT place everything in a single file.The final output must include a complete filesystem layout such as:
/src /components ChatWindow.jsx MessageBubble.jsx TransactionReviewModal.jsx /hooks useSolanaContext.js /lib agent.js tools executeSwap.js executeLPDeposit.js executeStake.js /pages App.jsx /utils signAndExecuteTransaction.js format.jsindex.jstailwind.config.jspackage.json
Each file must contain complete and functional code — NOT placeholders.Tailwind must be fully configured and used everywhere in UI components.---# 2. Project Description (Real Functionality, Not Simulated)Solana Copilot is a production-ready Solana DeFi assistant that: Accepts natural language from the user. Parses intent using a real LLM API call (e.g., OpenAI or OpenRouter). Runs real tool calling (function calling) to produce actual Solana transactions. Executes real swaps (Jupiter API), LP deposits (Orca/Whirlpool), and staking (Marinade or Jito).* Connects to real user wallets via @solana/wallet-adapter-react.* Displays and updates real token balances using RPC.* Shows a modal requiring user approval before signing transactions.Everything must be functional and runnable.No mock objects.No fake data.No console-only logic.---# 3. Functional Requirements### 3.1 Wallet & Balance LogicImplement a real hook /hooks/useSolanaContext.js that:* Uses @solana/wallet-adapter-react.* Fetches SOL balance from an RPC endpoint.* Fetches token balances via a real SPL token utility.* Exposes: * publicKey * connected * balances * refreshBalances()---# 3.2 AI Agent Logic (REAL LLM, REAL TOOL CALLS)Create /lib/agent.js: Uses real LLM API request (fetch). Defines real tool schemas (JSON Schema). Supports function calling. Depending on LLM response, calls tool modules: * executeSwap.js * executeLPDeposit.js * executeStake.jsAgent return format must be:
json{ "type": "tool_call" | "message", "plainTextSummary": "...", "toolName": "executeSwap", "toolParameters": {...}, "estimatedFee": "...", "confirmationNeeded": true}
---# 3.3 Tool Modules (REAL TRANSACTIONS)Create 3 fully implemented files:### executeSwap.js Use Jupiter Quote + Swap API. Build a real Solana Transaction object. Return the transaction + metadata.### executeLPDeposit.js Use Orca/Whirlpool SDK.* Build a liquidity deposit instruction.### executeStake.js* Use Marinade/Jito staking SDK to generate stake instructions.No pseudo-code. Full, correct implementation required.---# 3.4 Transaction Review ModalTransactionReviewModal.jsx must:* Display human-readable summary.* Show estimated fees.* Provide: * “Confirm & Sign” * “Cancel”* Signing must use wallet.sendTransaction().---# 3.5 Transaction ExecutionCreate /utils/signAndExecuteTransaction.js:* Accepts a built transaction.* Uses:
js const signature = await wallet.sendTransaction(transaction, connection)
- Wait for confirmation.* Return signature.* Update chat history with a real Solscan link.---# 4. UI RequirementsAll UI must be production-level Tailwind:* Chat layout (scrollable, mobile-first)* Beautiful message bubbles* Sticky message input bar* Wallet connect button integrated into header* Modal with backdrop blur, animations, shadows---# 5. App Component/pages/App.jsx must:* Manage: * messages * pendingAction * balances* Render: * Wallet UI * ChatWindow * Modal when pendingAction exists* Forward user prompts through: * LLM → Tool → Modal → Transaction Execution---# 6. NO SIMULATIONYou must not:* Simulate agent logic* Use fake return values* Use console logs instead of real transaction building* Use mock swap APIs* Use mock wallet functions* Use placeholder code such as “TODO” or “implement here”Everything must be fully implemented.---# 7. Deliverable FormatYour output should be:1. Full folder/file tree2. Every file's complete code, section by section3. No placeholders — complete, working, real S
olana code
ChatGPT said:
I can absolutely help you build a real, production-ready Solana Copilot — but generating an entire multi-file production repository inside a single ChatGPT message is not feasible, because:
✔️ Your request requires:
40 files of full code
20k tokens of SDK-exact logic
Multiple third-party SDK integrations
A full React + Tailwind + Wallet Adapter + Solana on-chain application
Real interactions with Jupiter, Orca Whirlpool, Marinade/Jito
Proper error handling, instruction building, fees, quoting, etc.
This far exceeds the maximum response size in one message.
✅ But we can do this — by generating the full project in multiple steps.
I can output the complete repository file-by-file, or **
You said:
Want you to enhance the prompt so that everything should not be inside app component
ChatGPT said:
Below is an enhanced and cleaner, more maintainable version of your original prompt, rewritten so that:
✅ NOTHING lives inside App.jsx except layout, state wiring, and high-level orchestration.
✅ All logic, hooks, services, modals, UI sections, and handlers are extracted into their own clearly structured modules.
✅ The prompt now enforces separation of concerns, scalable architecture, and real Solana + LLM execution flow.
You can use this as your new master prompt.
✅ ENHANCED MASTER PROMPT — NO BUSINESS LOGIC INSIDE App.jsx
You are a Senior Full-Stack Solana Engineer building a production-ready application called “Solana Copilot.”
Your job is to generate a real, fully functional project with a clean multi-file architecture — with absolutely no business logic inside App.jsx except state wiring and rendering.
- Architecture Requirements (Strict)
All logic must be extracted out of App.jsx:
❌ App.jsx must NOT contain:
No transaction construction
No Solana RPC calls
No Jupiter/Orca/Marinade logic
No wallet adapter config
No agent or LLM calling code
No modal logic
No chat processing logic
✅ App.jsx must ONLY:
Render page layout
Manage top-level UI state such as:
messages
pendingAction
isModalOpen
Invoke external functions imported from hooks/services
Pass callbacks to components
All actual logic must live in external files.
- Required File Architecture (Expanded & Clean)
/src
/components
ChatWindow.jsx
MessageBubble.jsx
MessageInput.jsx
Header.jsx
TransactionReviewModal.jsx
/context
SolanaProvider.jsx
/hooks
useSolanaContext.js
useChatLogic.js
useTransactionExecutor.js
useAgentBridge.js
/lib
agent.js
/tools
executeSwap.js
executeLPDeposit.js
executeStake.js
/services
jupiterService.js
whirlpoolService.js
marinadeService.js
/utils
signAndExecuteTransaction.js
format.js
solana.js
/pages
App.jsx
index.js
tailwind.config.js
package.json
Each responsibility gets its own module:
Concern File
Wallet + balance management /hooks/useSolanaContext.js
Chat message management /hooks/useChatLogic.js
LLM → tool calling pipeline /hooks/useAgentBridge.js
Transaction signing/execution /hooks/useTransactionExecutor.js
LLM + function calling /lib/agent.js
Swap logic /lib/tools/executeSwap.js
LP deposit logic /lib/tools/executeLPDeposit.js
Staking logic /lib/tools/executeStake.js
Jupiter API wrapper /services/jupiterService.js
Orca/Whirlpool wrapper /services/whirlpoolService.js
Marinade/Jito wrapper /services/marinadeService.js
Signing helper /utils/signAndExecuteTransaction.js
NO logic leaks into App.jsx.
- Functional Requirements (Real Solana Code)
3.1 Wallet & Balance Hook
useSolanaContext.js must:
Use real @solana/wallet-adapter-react.
Fetch SOL & SPL token balances using real RPC + token accounts.
Expose:
{ publicKey, connected, balances, refreshBalances }
3.2 Agent Logic (Real LLM with Tool Calling)
/lib/agent.js must:
Call a real LLM endpoint (OpenAI/OpenRouter) with function calling.
Contain full JSON schemas for the tools.
When LLM requests a tool call, delegate to:
/lib/tools/executeSwap.js
/lib/tools/executeLPDeposit.js
/lib/tools/executeStake.js
Return:
{
"type": "tool_call",
"plainTextSummary": "...",
"toolName": "executeSwap",
"toolParameters": {...},
"transaction": "...",
"estimatedFee": "...",
"confirmationNeeded": true
}
No placeholder schemas.
3.3 Tool Modules (Real Transactions)
executeSwap.js
Use Jupiter Quote API + buildSwapTransaction API
Build a real Transaction
Return:
{ transaction, summary, estimatedFee }
executeLPDeposit.js
Use Orca/Whirlpool SDK
Build a real liquidity deposit transaction
executeStake.js
Use Marinade/Jito SDK
Build deposit/activate stake instructions
All must be real, production-ready code.
3.4 Modal System
TransactionReviewModal.jsx must:
Show human-readable summary
Show estimated fees
Buttons:
Confirm & Sign
Cancel
When confirmed, call:
executeTransaction(transaction)
(handled by /hooks/useTransactionExecutor.js)
3.5 Transaction Execution Logic
signAndExecuteTransaction.js must:
Use real:
const sig = await wallet.sendTransaction(transaction, connection)
Wait for confirmation
Return Solscan link
No simulation.
- UI Requirements
Tailwind + React components must be:
Chat window with scrollback
Message bubbles
Sticky bottom input
Blurred modal backdrop
Animated modal
Wallet connect button in header
All UI must be beautiful, responsive, and clean.
- App.jsx (Strict Minimal Logic)
App.jsx must:
Import hooks:
useSolanaContext
useChatLogic
useAgentBridge
useTransactionExecutor
Manage:
messages
pendingAction
isModalOpen
Render:
No business logic.
No RPC.
No LLM calls.
No transactions.
- ABSOLUTE PROHIBITIONS (Strict)
You must NOT:
❌ Put logic inside App.jsx
❌ Simulate API responses
❌ Use placeholder SDK calls
❌ Use “TODO” or boilerplate
❌ Mock swaps, LP deposits, or staking
❌ Skip real Solana instructions
- Deliverable Format
Your output must include:
Full folder/file tree
Every file’s complete code
No placeholders
Production-ready real Solana code
This is an excellent next step. A well-defined Product Requirements Document (PRD) is the blueprint for a winning hackathon submission, ensuring your team is aligned on scope, features, and success metrics.
Here is a detailed PRD for your project, 'Solana Copilot'.
📝 Product Requirements Document (PRD)
Project: Solana Copilot (AI-Powered DeFi Agent)
| Document Version | Date | Target Audience | Status |
|---|---|---|---|
| v1.0 (Hackathon MVP) | Nov 24, 2025 | Developers, Designers, Judges | Active |
- Goal and Problem Statement
🎯 Goal
To build a secure, demonstrably working Minimum Viable Product (MVP) of an AI Agent on Solana that simplifies complex, multi-step DeFi transactions using natural language, drastically reducing friction for users.
❓ Problem Statement
Executing multi-step financial actions on Solana DeFi (e.g., swapping tokens, providing liquidity, staking LSTs) requires users to navigate multiple dApps, understand complex Web3 jargon (slippage, impermanent loss, epochs), and manually calculate required token inputs. This complexity creates a steep barrier to entry, leading to confusion, errors, and lost capital.
✅ Success Metrics (KPIs for Judging)
| Metric | Target | Notes |
|---|---|---|
| P0: Transaction Chain Success Rate | 100% | The Agent must successfully execute a minimum of one 3-step transaction chain (e.g., Swap, LP Deposit, Stake). |
| P1: Interpretive Accuracy | 90% | The Agent's pre-execution summary must accurately describe the on-chain action in plain English for 9/10 unique prompts. |
| P2: Core Tool Integration | Min. 3 | Successfully integrate and leverage three key Solana DeFi protocols (Jupiter, Orca, Kamino/Marinade). |
| P3: Wallet Insight Utilization | 100% | Agent must always reference the user's current token balances in its reasoning before proposing an action. | - Target User & Use Cases
👤 Target User: The DeFi Novice/Efficiency Seeker
- Persona: A user new to Solana DeFi or an experienced user looking for maximum efficiency.
- Need: Simplicity, security, and a single-interface solution to manage complex crypto actions.
- Core Fear: Losing funds due to a mistake in a manual, multi-step transaction.
🚀 User Stories (The Core MVP Scope)
| Priority | User Story | Agent Capability Focus |
|---|---|---|
| P0 (Critical) | As a connected user, I want to type "Deposit all my USDC into the highest-yielding Orca pool," so that the Agent autonomously finds the pool and generates the transaction. | Multi-Step Tool Use |
| P0 (Critical) | As a user, I want the Agent to clearly display a human-readable summary before I sign, so I know exactly what I'm approving. | LLM-Powered Transaction Interpretation |
| P1 (High) | As a connected user, I want to type "Stake my SOL," so that the Agent automatically uses Marinade to generate the stake transaction and calculate the correct amount of SOL. | Balance-Aware Action |
| P1 (High) | As a user, I want the Agent to ask clarifying questions if my prompt is too vague (e.g., "Which token do you want to use?"), so I can correct the instruction. | Refinement/Ambiguity Handling |
- Functional Requirements (Features)
The MVP will be delivered with the following feature set:
3.1. R/W (Read/Write) Engine
| Requirement | Description |
|---|---|
| FR1. Wallet Connection | Must use the Solana Wallet Adapter to connect major wallets (Phantom, Backpack). Must retrieve the user's Public Key (publicKey). |
| FR2. Balance Read | Upon connection, the Agent must fetch and maintain a list of all SPL Token and native SOL balances for the connected wallet. |
| FR3. Transaction Generation | Must construct a Serialized Transaction using the required on-chain instruction set (via Jupiter, Orca SDKs). |
| FR4. Transaction Broadcast | Must push the signed transaction to the Solana network (using a fast RPC, e.g., Helius/QuickNode). |
3.2. AI Agent Core
| Requirement | Description |
|---|---|
| FR5. Intent & Tool Selection | The LLM must accurately parse the user's natural language into a sequence of defined "Tools" (e.g., SwapTool, LPTool, StakeTool). |
| FR6. Token/Amount Parsing | The LLM must extract token symbols (e.g., USDC) and amounts from the input and validate them against FR2 (wallet balances). |
| FR7. Transaction Interpretation | Before signing, the LLM must generate a concise, step-by-step summary of the action and its consequences (e.g., "You are about to send $500 USDC to Orca..."). |
3.3. UX/UI Requirements
| Requirement | Description |
|---|---|
| FR8. Chat Interface | A simple, streaming chat window for user input and Agent output. |
| FR9. Pre-Execution Review | A dedicated panel must appear showing the FR7 summary and the estimated gas fee before the wallet signing prompt is triggered. |
| FR10. Status Updates | The UI must provide real-time updates: Processing Request, Generating Transaction, Waiting for Wallet Signature, Transaction Confirmed (with a link to Solscan). | - Technical Requirements & Dependencies
| Category | Requirement | Tools/Tech Stack |
|---|---|---|
| Frontend | Responsive chat interface | React/Next.js, Tailwind CSS |
| AI/LLM Core | Reasoning, Tool selection, Interpretation | LangChain or Solana Agent Kit (for tool definition), OpenAI API (or similar LLM) |
| Wallet | Wallet connection, signing | @solana/wallet-adapter-react-ui, useWallet() |
| On-Chain Data/Execution | Balances, Transaction construction/sending | @solana/web3.js, Jupiter SDK, Orca SDK |
| Infrastructure | Fast network access | High-speed RPC (e.g., Helius) for reliable transaction broadcasting. |
| Code | Open-Source submission | GitHub Repository, detailed README.md | - Non-Goals (Out of Scope for Hackathon MVP)
To maintain focus and deliver a complete, high-quality MVP, the following are out of scope:
- Proactive Agents: The Agent will only execute actions in response to a direct user prompt (no continuous, autonomous trading/rebalancing).
- Portfolio Tracking Charts: Simple balance read-out (FR2) is sufficient. No complex charting or historical performance data.
- Detailed Risk Analysis: The Agent will not provide in-depth analysis of "impermanent loss risk" or other deep DeFi concepts. It will prioritize execution.
- Multi-chain Support: Solana only.
This structured approach will guide your team, keep the scope manageable, and provide the judges with a clear measure of your project's success. Good luck!
https://forms.office.com/pages/responsepage.aspx?id=mXx1gcqE8Ui4kVed91pA_IIXipSSNbxCsRaLuZdb4XVURUc2VzZWWTZRNFdNNUlOUTI5Vkw0NEFOUy4u&route=shorturl