Xpersona
C

Chainstream Defi

CLAWHUB · Unverified

[FINANCIAL EXECUTION] Execute irreversible on-chain DeFi operations via CLI and MCP tools. Use when user wants to swap tokens, create tokens on launchpad, si...

62
Rank
84
Safety
1.5k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.5K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s1763qs0j2b2kgwgxyz797x2qh83kfzt:chainstream-defi
  1. Install using `clawhub skill install s1763qs0j2b2kgwgxyz797x2qh83kfzt:chainstream-defi` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/harry5556/chainstream-defi before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-harry5556-chainstream-defi/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

152,365 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: chainstream-defi
description: "[FINANCIAL EXECUTION] Execute irreversible on-chain DeFi operations via CLI and MCP tools. Use when user wants to swap tokens, create tokens on launchpad, sign transactions, broadcast signed transactions, or execute trading strategies. Requires explicit user confirmation before every destructive operation. All transactions are real and irreversible. Keywords: swap, DEX, launchpad, transaction, trade, sign, broadcast, PumpFun, Jupiter, Uniswap, USDC, SOL, execute."
---

# ChainStream DeFi

Execute DeFi operations: token swap, launchpad creation, transaction signing, and broadcast. All operations are **real, irreversible on-chain transactions**.

> **Before any swap**: load [chainstream-data](../chainstream-data/) and run `token security` on the target token. NEVER swap a token you haven't safety-checked.

- **CLI**: `npx @chainstream-io/cli`
- **MCP Server**: `https://mcp.chainstream.io/mcp` (streamable-http)

## Financial Risk Notice

**Every command in this skill executes REAL, IRREVERSIBLE blockchain transactions.**

- Transactions cannot be undone once confirmed on-chain.
- The AI agent must **NEVER auto-execute** — explicit user confirmation is required every time.
- Only use with funds the user is willing to trade.

## Integration Path (check FIRST)

DeFi operations **require a wallet**. API Key alone is insufficient.

**Before anything else (CLI path), ensure user is authenticated:**
1. `npx @chainstream-io/cli config auth` — check login status
2. If NOT logged in → `npx @chainstream-io/cli login` (creates EVM + Solana wallet, auto-grants **nano trial plan: 50K CU free, 30 days** — no purchase needed)
3. `npx @chainstream-io/cli plan status` — verify subscription is active

**New users get a free trial on login (50K CU).** For details on trial plans and upgrade options, see [`shared/authentication.md`](../shared/authentication.md#agent-bootstrap-checklist).

**Environment-aware decision (pick the path that matches how the agent runs):**

1. **Agent already has a wallet (`WalletSigner`)?**
   → **Use SDK** (`@chainstream-io/sdk`). Do NOT use CLI for signing. Implement `WalletSigner` interface. Your wallet must also support `signTypedData` for x402 payment.

2. **No embedded wallet — local terminal or CI available?**
   → **Use CLI** (`npx @chainstream-io/cli`). **Run `chainstream login` first** to **create a ChainStream Wallet** (TEE-backed; no email needed). CLI handles transaction signing; for x402 subscription, run `plan purchase --plan <name>` separately.

3. **Using MCP (streamable HTTP, e.g. `https://mcp.chainstream.io/mcp` — `dex/swap`, …)?**
   → **Same wallet rules**: read-only tools may work with API-only access depending on deployment; **destructive** tools still require wallet-backed authentication. If the host only exposes an API key and no wallet, **do not** execute swap/broadcast — direct the user to **CLI login** (ChainStream Wallet) or **SDK + their own wallet**. MCP does not remove t

_meta.json

{
  "ownerId": "kn7d949m4x7mzbj75gh32fna0x832bb6",
  "slug": "chainstream-defi",
  "version": "1.1.8",
  "publishedAt": 1776437541213
}

references/currency-resolution.md

# Currency Resolution

When users specify currency names (SOL, ETH, BNB, USDC) instead of addresses, the CLI auto-resolves to the correct on-chain address.

## Resolution Table

| Chain | Name | Address |
|-------|------|---------|
| sol | SOL | `So11111111111111111111111111111111111111112` |
| sol | USDC | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` |
| bsc | BNB | `0x0000000000000000000000000000000000000000` |
| bsc | USDC | `0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d` |
| eth | ETH | `0x0000000000000000000000000000000000000000` |
| eth | USDC | `0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eB48` |

## Examples

```bash
# These are equivalent:
npx @chainstream-io/cli dex route --chain sol --from <wallet> --input-token SOL --output-token <addr> --amount 1000000
npx @chainstream-io/cli dex route --chain sol --from <wallet> --input-token So11111111111111111111111111111111111111112 --output-token <addr> --amount 1000000
```

Currency resolution is case-insensitive (sol, Sol, SOL all work).

references/launchpad.md

# Launchpad Reference

## Token Creation

| Method | Path | Description |
|--------|------|-------------|
| POST | `/v2/dex/:chain/create` | Create token on launchpad |

## CLI Command

```bash
npx @chainstream-io/cli dex create --chain sol --from <wallet> --name "My Token" --symbol MT --uri "ipfs://..." [--dex pumpfun] [--image <url>]
```

## Supported Platforms

| Chain | Platforms |
|-------|-----------|
| sol | PumpFun, Raydium LaunchLab |
| bsc | FourMeme |

## Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `chain` | Yes | sol / bsc / eth |
| `name` | Yes | Token name |
| `symbol` | Yes | Token symbol (ticker) |
| `uri` | Yes | Metadata URI (IPFS or HTTP) |
| `dex` | No | Launchpad platform: pumpfun, raydium (default: pumpfun) |
| `image` | No | Token image URL |

## Metadata URI

Before creating a token, upload metadata to IPFS:

```bash
# Use ChainStream IPFS presign endpoint
POST /v2/ipfs/presign → { uploadUrl, ipfsUri }
# Upload image/metadata to the presigned URL
# Use the returned ipfsUri as --uri parameter
```

## PumpFun vs Raydium LaunchLab

| Aspect | PumpFun | Raydium LaunchLab |
|--------|---------|-------------------|
| Chain | Solana | Solana |
| Bonding curve | Yes (graduated → Raydium pool) | Yes (graduated → Raydium pool) |
| Fee | 0.02 SOL | Variable |
| Graduation threshold | ~$69k market cap | Variable |

references/swap-protocol.md

# Swap Protocol Reference

## Atomic CLI Flow

Each step is a separate CLI command. The agent orchestrates the flow.

```
Step 1: chainstream dex route (or dex swap)
  → POST /v2/dex/:chain/route (or /swap)
  → Returns: { routeInfo, serializedTx: base64, elapsedTime }
  → serializedTx is UNSIGNED

Step 2: Agent presents routeInfo to user, waits for confirmation

Step 3: chainstream wallet sign --chain <chain> --tx <serializedTx>
  → Signs locally (TEE or raw key)
  → Returns: { signedTx: base64 }

Step 4: chainstream tx send --chain <chain> --signed-tx <signedTx>
  → POST /v2/transaction/:chain/send { signedTx: base64 }
  → Returns: { signature, jobId, elapsedTime }

Step 5: chainstream job status --id JOB_ID --wait
  → GET /v2/job/:id (polling) or SSE streaming
  → Returns: { status, hash, ... }
```

## DeFi API Endpoints

| Method | Path | Description |
|--------|------|-------------|
| POST | `/v2/dex/:chain/swap` | Build unsigned swap transaction |
| POST | `/v2/dex/:chain/route` | Aggregator route + build unsigned transaction |
| POST | `/v2/dex/:chain/create` | Build unsigned token creation transaction |
| POST | `/v2/transaction/:chain/send` | Broadcast signed transaction |
| GET | `/v2/transaction/:chain/gas-price` | Current gas price (EVM only) |
| POST | `/v2/transaction/:chain/estimate-gas-limit` | Estimate gas limit (EVM only) |
| GET | `/v2/job/:id` | Job status |
| GET | `/v2/job/:id/streaming` | Job status via SSE |

## Transaction Signing (Non-Custodial)

ChainStream does NOT hold wallet keys. The API returns **unsigned transactions** that must be signed locally via `wallet sign`.

**IMPORTANT: The CLI `wallet sign` command IS IMPLEMENTED and WORKING.** It supports both Turnkey (TEE-backed) and raw private key wallets.

### CLI Signing Command

```bash
# Sign a transaction using the configured wallet
npx @chainstream-io/cli wallet sign --chain sol --tx <base64-serializedTx> --json

# Output: { "signedTx": "<base64-signed-transaction>" }
```

The CLI automatically:
1. Detects wallet type (Turnkey or raw key) from `~/.config/chainstream/config.json`
2. Selects the correct signing method based on `--chain` (Solana vs EVM)
3. Returns the signed transaction in base64 format

### Wallet Types Supported

| Type | Setup | Signing Method |
|------|-------|----------------|
| Turnkey (TEE) | `chainstream login` | Remote signing via Turnkey API |
| Raw Key | `chainstream wallet set-raw --chain sol` | Local signing with private key |

### Solana

Server returns: `serializedTx` = base64-encoded `VersionedTransaction` with placeholder signatures.
CLI `wallet sign`: deserialize → sign with wallet keypair → serialize → base64.

### EVM

Server returns: `serializedTx` = base64-encoded unsigned RLP.
CLI `wallet sign`: deserialize → sign with wallet private key → encode signed RLP → base64.

## Route Parameters (POST /v2/dex/:chain/route)

| Parameter | Required | Description |
|-----------|----------|-------------|
| `chain` | Yes | sol / bsc / eth

Sponsored

Ads related to Chainstream Defi and adjacent AI workflows.