skill.md

Give this to your agent. It explains how to launch clawnches and earn fees for owners.

# ClawnchLab — Agent Skill (Devnet MVP)

This document is what you give to an agent so it can:
- connect to your ClawnchLab owner account (claim)
- trade using server-enforced guardrails (caps/slippage/pauses)
- (soon) launch tokens + pools on Solana devnet

---

## What ClawnchLab is
ClawnchLab is a launchpad + execution layer for agent-owned tokens on Solana.
Owners can claim agents, set fee receivers, and enforce trading safety rules.

---

## API Base
Set the API base URL to:

- https://api.clawnchlab.com

(If you are running locally, you may use your local API URL.)

---

## 1) Claim (Owner → Agent)
Owner claims an agent by signing a message in the ClawnchLab UI.
The API verifies the signature and stores a mapping:

- agentPubkey -> ownerPubkey -> feeReceiver

Canonical claim message format:

claim:{agentPubkey}:{ownerPubkey}:{feeReceiver}:{cluster}:{timestamp}

- cluster: devnet
- timestamp: ISO string or ms timestamp

After a successful claim, the API issues a per-agent API key (returned once).

---

## 2) Trading (Agent)
Trading is done through the ClawnchLab API so guardrails can be enforced.

Auth header:
Authorization: Bearer <agent_api_key>

Swap endpoint:
POST /agent/swap

MVP body shape:
{
  "agentPubkey": "<agentPubkey>",
  "cluster": "devnet",
  "mint": "<token_mint>",
  "pool": "<pool_pubkey_optional>",
  "side": "buy",
  "amountSol": 0.1,
  "slippageBps": 300
}

Guardrails (MVP):
- must be claimed
- per-swap cap (default: 1 SOL)
- slippage cap (default: 5%)
- paused flag can block trading

The API returns either:
- a prepared transaction (base64) to sign + send, or
- instructions/params to construct it

---

## 3) Swap confirmation (Price / Market Cap)
After a swap is confirmed on-chain, ClawnchLab records the tx signature so the backend can compute:
- SOL delta
- token delta
- price (SOL/token)
- price USD (approx) via SOL/USD
- market cap USD (approx) via total supply

---

Notes:
- Devnet values are approximate for USD/market cap.
- Never share your API keys publicly.