repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources15d ago| #1 | # Metaplex Lobster Agents — Solana Blockchain Integration |
| #2 | |
| #3 | **49 Metaplex Lobster Agents powered by OpenClawd, pump.fun, Birdeye, and Solana RPC.** |
| #4 | |
| #5 | --- |
| #6 | |
| #7 | ## 🦞 Agent Blockchain Capabilities |
| #8 | |
| #9 | Each lobster agent is born with these Solana superpowers: |
| #10 | |
| #11 | ```typescript |
| #12 | interface LobsterAgent { |
| #13 | // === CORE SOLANA PROGRAMS === |
| #14 | programs: { |
| #15 | pump: '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'; |
| #16 | pumpSwap: 'PumpSwapAMMxxxxxxxxxxxxxx'; |
| #17 | mayhem: 'MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e'; |
| #18 | metaplex: 'metaqbxxUurdq35cjC23cE9k1rCBu5KNqmWfdKAoZSkb'; |
| #19 | token2022: 'TokenkegQfeZyiNwAjbodcp9C5bw52aqx3mqHPa7'; // Updated create_v2 uses this |
| #20 | }; |
| #21 | |
| #22 | // === RPC PROVIDERS === |
| #23 | rpc: { |
| #24 | helius: 'https://mainnet.helius-rpc.com/?api-key={KEY}'; |
| #25 | birdeye: 'https://public-api.birdeye.so/defi/v1'; |
| #26 | solanaTracker: 'https://rpc-mainnet.solanatracker.io/?api_key={KEY}'; |
| #27 | genesysgo: 'https://mainnet.genesysgo.net'; |
| #28 | }; |
| #29 | |
| #30 | // === TRADING CAPABILITIES === |
| #31 | trading: { |
| #32 | canLaunchToken: true; // create/create_v2 instructions |
| #33 | canBuy: true; // buy instruction |
| #34 | canSell: true; // sell instruction |
| #35 | canClaimFees: true; // collectCreatorFee |
| #36 | canMigrate: true; // migrate to PumpSwap |
| #37 | canManageMetadata: true; // set_metaplex_creator |
| #38 | }; |
| #39 | |
| #40 | // === TRADING LIMITS === |
| #41 | limits: { |
| #42 | maxSlippageBps: 500; // 5% |
| #43 | defaultBuyAmountSOL: 0.01; |
| #44 | maxBuyAmountSOL: 1.0; |
| #45 | minBuyAmountSOL: 0.001; |
| #46 | }; |
| #47 | } |
| #48 | ``` |
| #49 | |
| #50 | --- |
| #51 | |
| #52 | ## 🔥 Pump.fun Program Integration |
| #53 | |
| #54 | ### Mainnet Programs |
| #55 | |
| #56 | | Program | Address | Type | |
| #57 | |---------|---------|------| |
| #58 | | **Pump** | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` | Bonding curve | |
| #59 | | **Mayhem** | `MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e` | Trading mode | |
| #60 | | **Global** | `4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf` | Config PDA | |
| #61 | | **Fee Recipient** | `62qc2CNXwrYqQScmEdiZFFAnJR262PxWEuNQtxfafNgV` | Fee receiver | |
| #62 | |
| #63 | ### Mayhem Fee Recipients (use any randomly) |
| #64 | |
| #65 | ``` |
| #66 | GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS |
| #67 | 4budycTjhs9fD6xw62VBducVTNgMgJJ5BgtKq7mAZwn6 |
| #68 | 8SBKzEQU4nLSzcwF4a74F2iaUDQyTfjGndn6qUWBnrpR |
| #69 | 4UQeTP1T39KZ9Sfxzo3WR5skgsaP6NZa87BAkuazLEKH |
| #70 | 8sNeir4QsLsJdYpc9RZacohhK1Y5FLU3nC5LXgYB4aa6 |
| #71 | Fh9HmeLNUMVCvejxCtCL2DbYaRyBFVJ5xrWkLnMH6fdk |
| #72 | 463MEnMeGyJekNZFQSTUABBEbLnvMTALbT6ZmsxAbAdq |
| #73 | 6AUH3WEHucYZyC61hqpqYUWVto5qA5hjHuNQ32GNnNxA |
| #74 | ``` |
| #75 | |
| #76 | ### Mayhem Global Params |
| #77 | |
| #78 | ``` |
| #79 | Global Params: 13ec7XdrjF3h3YcqBTFDSReRcUFwbCnJaAQspM4j6DDJ |
| #80 | Sol Vault: BwWK17cbHxwWBKZkUYvzxLcNQ1YVyaFezduWbtm2de6s |
| #81 | ``` |
| #82 | |
| #83 | --- |
| #84 | |
| #85 | ## 🚀 Agent Token Launch Workflow |
| #86 | |
| #87 | ```javascript |
| #88 | // === LOBSTER AGENT TOKEN LAUNCH === |
| #89 | |
| #90 | // 1. Create token metadata |
| #91 | const metadata = { |
| #92 | name: 'OpenClawd Lobster', |
| #93 | symbol: 'LOBS', |
| #94 | uri: 'https://arweave.net/your-metadata.json', |
| #95 | }; |
| #96 | |
| #97 | // 2. Launch via create_v2 (Token2022) |
| #98 | const createResult = await pumpSDK.createV2({ |
| #99 | creator: agentKeypair, |
| #100 | name: metadata.name, |
| #101 | symbol: metadata.symbol, |
| #102 | uri: metadata.uri, |
| #103 | isMayhemMode: true, // Enable mayhem trading |
| #104 | }); |
| #105 | |
| #106 | // 3. Get bonding curve PDA |
| #107 | const bondingCurve = findProgramAddress([ |
| #108 | 'bonding-curve', |
| #109 | createResult.mint, |
| #110 | pumpProgramId, |
| #111 | ]); |
| #112 | |
| #113 | // 4. Monitor bonding curve state |
| #114 | const curveState = await connection.getAccountInfo(bondingCurve); |
| #115 | ``` |
| #116 | |
| #117 | --- |
| #118 | |
| #119 | ## 💰 Trading Workflow |
| #120 | |
| #121 | ### Buy Tokens |
| #122 | |
| #123 | ```javascript |
| #124 | // Agent buys via bonding curve |
| #125 | const buyResult = await pumpSDK.buy({ |
| #126 | user: agentKeypair, |
| #127 | mint: targetMint, |
| #128 | amount: 0.1, // SOL amount |
| #129 | slippageBps: 100, // 1% |
| #130 | // For mayhem mode, use mayhem fee recipient |
| #131 | feeRecipient: 'GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS', |
| #132 | }); |
| #133 | ``` |
| #134 | |
| #135 | ### Sell Tokens |
| #136 | |
| #137 | ```javascript |
| #138 | // Agent sells back to bonding curve |
| #139 | const sellResult = await pumpSDK.sell({ |
| #140 | user: agentKeypair, |
| #141 | mint: holdingMint, |
| #142 | amount: tokenAmount, |
| #143 | minSolOutput: minSol * 0.95, // 5% slippage tolerance |
| #144 | // For mayhem mode, use mayhem fee recipient |
| #145 | feeRecipient: '4budycTjhs9fD6xw62VBducVTNgMgJJ5BgtKq7mAZwn6', |
| #146 | }); |
| #147 | ``` |
| #148 | |
| #149 | --- |
| #150 | |
| #151 | ## 🎁 Claim Creator Fees |
| #152 | |
| #153 | ```javascript |
| #154 | // Agent claims accumulated creator fees |
| #155 | await pumpSDK.collectCreatorFee({ |
| #156 | creator: agentKeypair, |
| #157 | mint: createdTokenMint, |
| #158 | }); |
| #159 | |
| #160 | // Creator vault is derived as: |
| #161 | // PDA: ["creator-vault", bondingCurve.creator] |
| #162 | ``` |
| #163 | |
| #164 | --- |
| #165 | |
| #166 | ## 📊 Birdeye Integration |
| #167 | |
| #168 | ```javascript |
| #169 | // Token price |
| #170 | GET /v1/token/price?address={mint} |
| #171 | |
| #172 | // Token metadata |
| #173 | GET /v1/token/meta?address={mint} |
| #174 | |
| #175 | // OHLCV candles |
| #176 | GET /v1/token/ohlcv?address={mint}&type=1H |
| #177 | |
| #178 | // Wallet portfolio |
| #179 | GET /v1/wallet/tokens?wallet={address} |
| #180 | |
| #181 | // Trending tokens |
| #182 | GET /v1/token/list?sort=volume&order=desc |
| #183 | |
| #184 | // Price updates WebSocket |
| #185 | wss://stream.birdeye.io/?apiKey={KEY}&symbol={mint} |
| #186 | ``` |
| #187 | |
| #188 | --- |
| #189 | |
| #190 | ## 🔄 Migration to PumpSwap |
| #191 | |
| #192 | When bonding curve completes (`real_token_reserves == 0`): |
| #193 | |
| #194 | ```javascript |
| #195 | // Agent migrates to PumpSwap AMM |
| #196 | await pumpSDK.migrate({ |
| #197 | user: agentKeypair, |
| #198 | mint: graduatedMint, |
| #199 | }); |
| #200 | // LP tokens are automatically burnt |
| #201 | // Pool becomes tradeable on PumpSwap |
| #202 | ``` |
| #203 | |
| #204 | --- |
| #205 | |
| #206 | ## 🤖 Agent Spawn Script |
| #207 | |
| #208 | ```javascript |
| #209 | // spawn-lobster-agent.js |
| #210 | |
| #211 | import { Keypair } from '@solana/web3.js'; |
| #212 | import { PUMP_SDK } from '@pump-fun/pump-sdk'; |
| #213 | |
| #214 | export async function spawnLobsterAgent(config) { |
| #215 | // 1. Generate agent wallet (or use provided) |
| #216 | const agentWallet = config.wallet || Keypair.generate(); |
| #217 | |
| #218 | // 2. Initialize pump SDK with agent's RPC |
| #219 | const pumpSDK = new PUMP_SDK({ |
| #220 | connection: config.connection, |
| #221 | wallet: agentWallet, |
| #222 | programId: '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P', |
| #223 | }); |
| #224 | |
| #225 | // 3. Return agent with full capabilities |
| #226 | return { |
| #227 | wallet: agentWallet, |
| #228 | pumpSDK, |
| #229 | programs: { |
| #230 | pump: '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P', |
| #231 | mayhem: 'MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e', |
| #232 | metaplex: 'metaqbxxUurdq35cjC23cE9k1rCBu5KNqmWfdKAoZSkb', |
| #233 | }, |
| #234 | feeRecipients: [ |
| #235 | 'GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS', |
| #236 | '4budycTjhs9fD6xw62VBducVTNgMgJJ5BgtKq7mAZwn6', |
| #237 | // ... 8 total |
| #238 | ], |
| #239 | canTrade: true, |
| #240 | canLaunch: true, |
| #241 | canClaimFees: true, |
| #242 | canMigrate: true, |
| #243 | }; |
| #244 | } |
| #245 | ``` |
| #246 | |
| #247 | --- |
| #248 | |
| #249 | ## 📈 Agent Catalog (49 Lobster Agents) |
| #250 | |
| #251 | | Category | Count | Capabilities | |
| #252 | |----------|-------|--------------| |
| #253 | | **DeFi** | 8 | Swap, liquidity, yield farming | |
| #254 | | **Trading** | 10 | Sniper, scalper, swing trader | |
| #255 | | **Analytics** | 6 | On-chain data, sentiment | |
| #256 | | **Security** | 5 | Rug detection, scam alerts | |
| #257 | | **NFT** | 5 | Mint, trade, collection | |
| #258 | | **Dev Tools** | 8 | Deploy, test, audit | |
| #259 | | **Research** | 4 | Token analysis, market research | |
| #260 | | **Governance** | 3 | DAO voting, proposals | |
| #261 | |
| #262 | --- |
| #263 | |
| #264 | ## 🔐 Security Model |
| #265 | |
| #266 | ### Agent Wallet Protection |
| #267 | |
| #268 | ```javascript |
| #269 | // Agent wallets are encrypted with AES-256-GCM |
| #270 | const encryptedWallet = await encryptAgentWallet(agentKeypair, passphrase); |
| #271 | |
| #272 | // Stored at ~/.openclawd/agents/{agentId}/wallet.enc |
| #273 | ``` |
| #274 | |
| #275 | ### Trading Approval Flow |
| #276 | |
| #277 | ``` |
| #278 | Agent Decision → User Approval → Transaction Sign → Broadcast |
| #279 | ↑ |
| #280 | 49-agent strategy engine |
| #281 | checks $CLAWD tier gates |
| #282 | ``` |
| #283 | |
| #284 | ### $CLAWD Tier Requirements |
| #285 | |
| #286 | | Tier | $CLAWD Required | Trading Limits | |
| #287 | |------|-----------------|----------------| |
| #288 | | Free | 0 | 0.01 - 0.1 SOL | |
| #289 | | Bronze | 1 | 0.01 - 0.5 SOL | |
| #290 | | Silver | 1,000 | 0.01 - 2.0 SOL | |
| #291 | | Gold | 10,000 | 0.01 - 10 SOL | |
| #292 | | Diamond | 100,000 | Unlimited | |
| #293 | |
| #294 | --- |
| #295 | |
| #296 | ## 🛠️ RPC Configuration |
| #297 | |
| #298 | ```javascript |
| #299 | // Multi-provider fallback |
| #300 | const rpcConfig = { |
| #301 | primary: { |
| #302 | url: process.env.HELIUS_RPC, |
| #303 | commitment: 'finalized', |
| #304 | }, |
| #305 | secondary: { |
| #306 | url: process.env.SOLANA_TRACKER_RPC, |
| #307 | commitment: 'confirmed', |
| #308 | }, |
| #309 | fallback: { |
| #310 | url: 'https://api.mainnet-beta.solana.com', |
| #311 | commitment: 'processed', |
| #312 | }, |
| #313 | }; |
| #314 | |
| #315 | // Automatic failover on errors |
| #316 | ``` |
| #317 | |
| #318 | --- |
| #319 | |
| #320 | ## 📝 WebSocket Real-time Feeds |
| #321 | |
| #322 | ### Agent Event Stream |
| #323 | |
| #324 | ```javascript |
| #325 | // Connect to OpenClawd orchestrator |
| #326 | const ws = new WebSocket('ws://localhost:18790'); |
| #327 | |
| #328 | // Subscribe to agent events |
| #329 | ws.send(JSON.stringify({ |
| #330 | method: 'subscribe', |
| #331 | params: ['agents:trading', 'agents:new-tokens'], |
| #332 | })); |
| #333 | |
| #334 | // Receive real-time updates |
| #335 | ws.on('message', (data) => { |
| #336 | const event = JSON.parse(data); |
| #337 | if (event.type === 'LOBSTER_TRADE') { |
| #338 | // Update dashboard, notify user |
| #339 | } |
| #340 | }); |
| #341 | ``` |
| #342 | |
| #343 | --- |
| #344 | |
| #345 | ## 🚀 Quick Start Guide |
| #346 | |
| #347 | ```bash |
| #348 | # 1. Clone OpenClawd |
| #349 | git clone https://github.com/clawdsolana/OpenClawd.git |
| #350 | cd openclawd |
| #351 | |
| #352 | # 2. Install dependencies |
| #353 | npm install |
| #354 | |
| #355 | # 3. Configure RPC |
| #356 | export HELIUS_API_KEY=your-key |
| #357 | export SOLANA_TRACKER_API_KEY=your-key |
| #358 | |
| #359 | # 4. Start orchestrator |
| #360 | cd openclawd-stack/orchestrator |
| #361 | npm run dev |
| #362 | |
| #363 | # 5. Spawn lobster agents |
| #364 | node scripts/spawn-lobster-agents.js |
| #365 | |
| #366 | # 6. Launch first token |
| #367 | node scripts/lobster-launch.js --name "MyToken" --symbol "MTK" |
| #368 | ``` |
| #369 | |
| #370 | --- |
| #371 | |
| #372 | ## 📚 References |
| #373 | |
| #374 | - [Pump.fun Program Docs](API/pump-public-docs/docs/PUMP_PROGRAM_README.md) |
| #375 | - [PumpSwap Integration](API/pump-public-docs/docs/PUMP_SWAP_README.md) |
| #376 | - [Birdeye API](API/bds-public-main/README.md) |
| #377 | - [Metaplex Documentation](https://docs.metaplex.com) |
| #378 | - [$CLAWD Token](https://pump.fun/8cHzQHUS2s2h8TzCmfqPKYiM4dSt4roa3n7MyRLApump) |
| #379 | |
| #380 | --- |
| #381 | |
| #382 | **Built with 🦞 by OpenClawd — The Hermes of Web3** |
| #383 | |
| #384 | *49 Metaplex Lobster Agents. Born to trade. Programmed to win.* |