# Send Poseidon OTC to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "poseidon-otc",
    "name": "Poseidon OTC",
    "source": "tencent",
    "type": "skill",
    "category": "金融交易",
    "sourceUrl": "https://clawhub.ai/Romovow/poseidon-otc",
    "canonicalUrl": "https://clawhub.ai/Romovow/poseidon-otc",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/poseidon-otc",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=poseidon-otc",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "tsconfig.json",
      "README.md",
      "package.json",
      "src/index.ts"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "poseidon-otc",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-29T04:43:56.904Z",
      "expiresAt": "2026-05-06T04:43:56.904Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=poseidon-otc",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=poseidon-otc",
        "contentDisposition": "attachment; filename=\"poseidon-otc-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "poseidon-otc"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/poseidon-otc"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/poseidon-otc",
    "downloadUrl": "https://openagent3.xyz/downloads/poseidon-otc",
    "agentUrl": "https://openagent3.xyz/skills/poseidon-otc/agent",
    "manifestUrl": "https://openagent3.xyz/skills/poseidon-otc/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/poseidon-otc/agent.md"
  }
}
```
## Documentation

### 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

### 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 │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

### Room Management

MethodParametersReturnsDescriptioncreateRoom(options?){ inviteCode?: string }{ roomId, link }Create new roomgetRoom(roomId)roomId: stringTradeRoomGet full room stategetUserRooms(wallet?)wallet?: stringTradeRoom[]List your roomsjoinRoom(roomId, inviteCode?)roomId, inviteCode?{ success }Join as Party BcancelRoom(roomId)roomId: string{ success }Cancel & refundgetRoomLink(roomId)roomId: stringstringGet share URL

### Trading

MethodParametersReturnsDescriptionupdateOffer(roomId, tokens)roomId, [{mint, amount, decimals}]{ success }Set your offerwithdrawFromOffer(roomId, tokens)roomId, tokens[]{ success }Pull back tokensconfirmTrade(roomId, stage)roomId, 'first'│'second'{ success }Confirm stageexecuteSwap(roomId)roomId: string{ txSignature }Execute swapdeclineOffer(roomId)roomId: string{ success }Reject terms

### Lockups (Anti-Dump)

MethodParametersReturnsDescriptionproposeLockup(roomId, seconds)roomId, seconds{ success }Propose lockacceptLockup(roomId)roomId: string{ success }Accept lockgetLockupStatus(roomId)roomId: string{ canClaim, timeRemaining }Check timerclaimLockedTokens(roomId)roomId: string{ txSignature }Claim after expiry

### Utility

MethodParametersReturnsDescriptiongetBalance()none{ sol: number }Check SOL balanceisAutonomous()nonebooleanHas signing wallet?getWebSocketUrl()nonestringGet 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

EventWhen It Firesfull-stateImmediately on subscribe - complete room statejoinCounterparty joined the roomofferSomeone updated their offerconfirmSomeone confirmed (first or second)lockupLockup proposed or acceptedexecuteSwap executed successfullycancelRoom was cancelledterminatedRoom expired or terminatederrorSomething 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

TokenMint AddressDecimalsUSDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v6USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB6wSOLSo111111111111111111111111111111111111111129BONKDezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB2635

### Environment Variables

POSEIDON_BURNER_KEY=<base58-private-key>  # Required for autonomous mode
POSEIDON_API_URL=https://poseidon.cash    # API endpoint (default: mainnet)
POSEIDON_RPC_URL=https://api.mainnet-beta.solana.com  # Solana RPC

### Security Notes

Escrow is on-chain - Funds are held by the Solana program, not the API
Atomic swaps - Either both sides complete or neither does
Signatures expire - Auth signatures valid for 24 hours
Lockups are enforced on-chain - Can't bypass the timer
Hot wallet warning - Only fund your burner wallet with amounts you're comfortable risking

### Program ID

Mainnet: AfiRReYhvykHhKXhwjhcsXFejHdxqYLk2QLWnjvvLKUN

### Links

Website: https://poseidon.cash
Docs: https://docs.poseidon.cash
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: Romovow
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-29T04:43:56.904Z
- Expires at: 2026-05-06T04:43:56.904Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/poseidon-otc)
- [Send to Agent page](https://openagent3.xyz/skills/poseidon-otc/agent)
- [JSON manifest](https://openagent3.xyz/skills/poseidon-otc/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/poseidon-otc/agent.md)
- [Download page](https://openagent3.xyz/downloads/poseidon-otc)