poseidon-otc
Execute trustless P2P token swaps on Solana via the Poseidon OTC protocol. Create trade rooms, negotiate offers, lock tokens with time-based escrow, and execute atomic on-chain swaps. Supports agent-to-agent trading with real-time WebSocket updates.
Install
mkdir -p .claude/skills/poseidon-otc && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7523" && unzip -o skill.zip -d .claude/skills/poseidon-otc && rm skill.zipInstalls to .claude/skills/poseidon-otc
About this skill
Poseidon OTC Skill
TL;DR for Agents: This skill lets you trade tokens with humans or other agents on Solana. You create a room, both parties deposit tokens to escrow, confirm, and execute an atomic swap. No trust required - it's all on-chain.
When to Use This Skill
- Trading tokens P2P - Swap any SPL token directly with another party
- Agent-to-agent commerce - Two AI agents can negotiate and execute trades autonomously
- Large OTC deals - Avoid slippage from DEX trades by going direct
- Protected trades - Use lockups to prevent counterparty from dumping immediately
- Multi-token swaps - Trade up to 4 tokens per side in one atomic transaction
Quick Start for Agents
1. Initialize (requires wallet)
import { PoseidonOTC } from 'poseidon-otc-skill';
const client = new PoseidonOTC({
burnerKey: process.env.POSEIDON_BURNER_KEY // base58 private key
});
2. Create a Trade Room
const { roomId, link } = await client.createRoom();
// Share `link` with counterparty or another agent
3. Wait for Counterparty & Set Offer
// Check room status
const room = await client.getRoom(roomId);
// Set what you're offering (100 USDC example)
await client.updateOffer(roomId, [{
mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC mint
amount: 100000000, // 100 USDC (6 decimals)
decimals: 6
}]);
4. Confirm & Execute
// First confirmation = "I agree to these terms"
await client.confirmTrade(roomId, 'first');
// After deposits, second confirmation
await client.confirmTrade(roomId, 'second');
// Execute the atomic swap
const { txSignature } = await client.executeSwap(roomId);
Complete Trade Flow
┌─────────────────────────────────────────────────────────────────┐
│ TRADE LIFECYCLE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. CREATE ROOM │
│ └─> Party A calls createRoom() │
│ Returns: roomId, shareable link │
│ │
│ 2. JOIN ROOM │
│ └─> Party B calls joinRoom(roomId) │
│ Room now has both participants │
│ │
│ 3. SET OFFERS │
│ └─> Both parties call updateOffer(roomId, tokens) │
│ Each specifies what they're putting up │
│ │
│ 4. FIRST CONFIRM (agree on terms) │
│ └─> Both call confirmTrade(roomId, 'first') │
│ "I agree to swap my X for your Y" │
│ │
│ 5. DEPOSIT TO ESCROW │
│ └─> Tokens move to on-chain escrow │
│ (Handled by frontend or depositToEscrow) │
│ │
│ 6. SECOND CONFIRM (verify deposits) │
│ └─> Both call confirmTrade(roomId, 'second') │
│ "I see the deposits, ready to swap" │
│ │
│ 7. EXECUTE SWAP │
│ └─> Either party calls executeSwap(roomId) │
│ Atomic on-chain swap via relayer │
│ Returns: txSignature │
│ │
│ [OPTIONAL] LOCKUP FLOW │
│ └─> Before step 4, Party A can proposeLockup(roomId, secs) │
│ └─> Party B must acceptLockup(roomId) to continue │
│ └─> After execute, locked tokens claimed via claimLockedTokens │
│ │
└─────────────────────────────────────────────────────────────────┘
API Reference
Room Management
| Method | Parameters | Returns | Description |
|---|---|---|---|
createRoom(options?) | { inviteCode?: string } | { roomId, link } | Create new room |
getRoom(roomId) | roomId: string | TradeRoom | Get full room state |
getUserRooms(wallet?) | wallet?: string | TradeRoom[] | List your rooms |
joinRoom(roomId, inviteCode?) | roomId, inviteCode? | { success } | Join as Party B |
cancelRoom(roomId) | roomId: string | { success } | Cancel & refund |
getRoomLink(roomId) | roomId: string | string | Get share URL |
Trading
| Method | Parameters | Returns | Description |
|---|---|---|---|
updateOffer(roomId, tokens) | roomId, [{mint, amount, decimals}] | { success } | Set your offer |
withdrawFromOffer(roomId, tokens) | roomId, tokens[] | { success } | Pull back tokens |
confirmTrade(roomId, stage) | roomId, 'first'│'second' | { success } | Confirm stage |
executeSwap(roomId) | roomId: string | { txSignature } | Execute swap |
declineOffer(roomId) | roomId: string | { success } | Reject terms |
Lockups (Anti-Dump)
| Method | Parameters | Returns | Description |
|---|---|---|---|
proposeLockup(roomId, seconds) | roomId, seconds | { success } | Propose lock |
acceptLockup(roomId) | roomId: string | { success } | Accept lock |
getLockupStatus(roomId) | roomId: string | { canClaim, timeRemaining } | Check timer |
claimLockedTokens(roomId) | roomId: string | { txSignature } | Claim after expiry |
Utility
| Method | Parameters | Returns | Description |
|---|---|---|---|
getBalance() | none | { sol: number } | Check SOL balance |
isAutonomous() | none | boolean | Has signing wallet? |
getWebSocketUrl() | none | string | Get WS endpoint |
WebSocket Real-Time Updates
Don't poll. Subscribe.
Instead of repeatedly calling getRoom(), connect to WebSocket for instant updates:
Endpoint: wss://poseidon.cash/ws/trade-room
Subscribe to Room Events
const { unsubscribe } = await client.subscribeToRoom(roomId, (event) => {
switch (event.type) {
case 'join':
console.log('Counterparty joined!');
break;
case 'offer':
console.log('Offer updated:', event.data.tokens);
break;
case 'confirm':
console.log('Confirmation received');
break;
case 'execute':
console.log('Swap complete! TX:', event.data.txSignature);
break;
case 'cancel':
console.log('Trade cancelled');
break;
}
});
Event Types
| Event | When It Fires |
|---|---|
full-state | Immediately on subscribe - complete room state |
join | Counterparty joined the room |
offer | Someone updated their offer |
confirm | Someone confirmed (first or second) |
lockup | Lockup proposed or accepted |
execute | Swap executed successfully |
cancel | Room was cancelled |
terminated | Room expired or terminated |
error | Something went wrong |
WebSocket Actions (Faster than HTTP)
await client.sendOfferViaWs(roomId, tokens); // Update offer
await client.sendConfirmViaWs(roomId, 'first'); // Confirm
await client.sendLockupProposalViaWs(roomId, 3600); // Propose 1hr lock
await client.sendAcceptLockupViaWs(roomId); // Accept lock
await client.sendExecuteViaWs(roomId); // Execute swap
Agent-to-Agent Trading Example
Scenario: Agent A wants to sell 1000 USDC for 5 SOL to Agent B
Agent A (Seller):
// 1. Create room
const { roomId } = await client.createRoom();
// 2. Set offer (1000 USDC)
await client.updateOffer(roomId, [{
mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amount: 1000000000, // 1000 USDC
decimals: 6
}]);
// 3. Share roomId with Agent B via your inter-agent protocol
// 4. Subscribe to updates
await client.subscribeToRoom(roomId, async (event) => {
if (event.type === 'offer') {
// Check if Agent B's offer is acceptable (5 SOL)
const room = await client.getRoom(roomId);
if (room.partyBTokenSlots?.[0]?.amount >= 5 * 1e9) {
await client.confirmTrade(roomId, 'first');
}
}
if (event.type === 'confirm' && room.partyBFirstConfirm) {
await client.confirmTrade(roomId, 'second');
}
});
Agent B (Buyer):
// 1. Join the room
await client.joinRoom(roomId);
// 2. Set offer (5 SOL)
await client.updateOffer(roomId, [{
mint: 'So11111111111111111111111111111111111111112', // wSOL
amount: 5000000000, // 5 SOL
decimals: 9
}]);
// 3. Subscribe and react
await client.subscribeToRoom(roomId, async (event) => {
if (event.type === 'confirm') {
const room = await client.getRoom(roomId);
if (room.partyAFirstConfirm && !room.partyBFirstConfirm) {
await client.confirmTrade(roomId, 'first');
}
if (room.partyASecondConfirm && room.partyBSecondConfirm) {
// Both confirmed, execute!
await client.executeSwap(roomId);
}
}
});
Common Token Mints
| Token | Mint Address | Decimals |
|---|---|---|
| USDC | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | 6 |
| USDT | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB | 6 |
| wSOL | So11111111111111111111111111111111111111112 | 9 |
| BONK | DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 | 5 |
Environment Variables
POSEIDON_BURNER_KEY=<base58-p
---
*Content truncated.*
More by openclaw
View all skills by openclaw →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversDritan MCP lets personal agents access Solana market data and execute token swaps via the Dritan SDK while keeping local
Solana Agent Kit: Easily deploy tokens, mint NFTs, and manage DeFi & cross-chain tasks with Solana integration in chat i
Solana Agent: a server for blockchain interactions on Solana, offering asset retrieval, token deployment, wallet managem
Create and manage Solana meme tokens effortlessly with LetsBonk (Solana Token Launcher) – easy IPFS setup, image uploads
Access multi-chain data across 130+ networks with Tatum Blockchain—NFT metadata, wallet portfolios, token verification,
Osmosis bridge for seamless DeFi on-chain swaps, balance queries, and account management on the Osmosis blockchain.
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.