# Send VibeTrading 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. 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. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "vibetrading",
    "name": "VibeTrading",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/crabbytt/vibetrading",
    "canonicalUrl": "https://clawhub.ai/crabbytt/vibetrading",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/vibetrading",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=vibetrading",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "references/api-details.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/vibetrading"
    },
    "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/vibetrading",
    "downloadUrl": "https://openagent3.xyz/downloads/vibetrading",
    "agentUrl": "https://openagent3.xyz/skills/vibetrading/agent",
    "manifestUrl": "https://openagent3.xyz/skills/vibetrading/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/vibetrading/agent.md"
  }
}
```
## Documentation

### vibetrading

Agent-first crypto trading framework. Strategies are Python functions decorated with @vibe that call sandbox functions (get_perp_price, long, short, etc.). Same code runs in backtest and live.

### Install

pip install vibetrading                    # Core
pip install "vibetrading[hyperliquid]"     # + Hyperliquid live trading
pip install "vibetrading[dev]"             # + pytest, ruff

### 1. Write a Strategy

import math
from vibetrading import vibe, get_perp_price, get_perp_position, get_perp_summary
from vibetrading import set_leverage, long, reduce_position, get_futures_ohlcv
from vibetrading.indicators import rsi

@vibe(interval="1h")
def my_strategy():
    price = get_perp_price("BTC")
    if math.isnan(price):
        return

    position = get_perp_position("BTC")
    if position and position.get("size", 0) != 0:
        pnl = (price - position["entry_price"]) / position["entry_price"]
        if pnl >= 0.03 or pnl <= -0.02:
            reduce_position("BTC", abs(position["size"]))
        return

    ohlcv = get_futures_ohlcv("BTC", "1h", 20)
    if ohlcv is None or len(ohlcv) < 15:
        return

    if rsi(ohlcv["close"]).iloc[-1] < 30:
        summary = get_perp_summary()
        margin = summary.get("available_margin", 0)
        if margin > 100:
            set_leverage("BTC", 3)
            qty = (margin * 0.1 * 3) / price
            if qty * price >= 15:
                long("BTC", qty, price, order_type="market")

### 2. Backtest

import vibetrading.backtest

results = vibetrading.backtest.run(code, interval="1h", slippage_bps=5)
m = results["metrics"]
# Keys: total_return, sharpe_ratio, sortino_ratio, calmar_ratio, max_drawdown,
#        win_rate, profit_factor, expectancy, number_of_trades, cagr, etc.

### 3. Deploy Live

import vibetrading.live

await vibetrading.live.start(
    code,
    exchange="hyperliquid",
    api_key="0xWalletAddress",
    api_secret="0xPrivateKey",
    interval="1m",
)

### Strategy Rules

Every strategy must:

Import and use @vibe or @vibe(interval="1h") decorator
Guard against math.isnan(price) — prices are NaN before data loads
Check position before entering (avoid stacking)
Have both take-profit and stop-loss exits
Check margin > 50 and qty * price >= 15 before trading

Order types: "market" (fills immediately + slippage) or "limit" (fills at price).

### Sandbox Functions

Data: get_perp_price(asset), get_spot_price(asset), get_futures_ohlcv(asset, interval, limit), get_spot_ohlcv(asset, interval, limit), get_funding_rate(asset), get_open_interest(asset), get_current_time(), get_supported_assets()

Account: get_perp_summary() → {available_margin, total_margin, ...}, get_perp_position(asset) → {size, entry_price, pnl, leverage} or None, my_spot_balance(asset?), my_futures_balance()

Trading: long(asset, qty, price, order_type="market"), short(asset, qty, price, order_type="market"), buy(asset, qty, price), sell(asset, qty, price), reduce_position(asset, qty), set_leverage(asset, leverage)

### Indicators

from vibetrading.indicators import sma, ema, rsi, bbands, atr, macd, stochastic, vwap

All take pandas Series, return pandas Series. Pure pandas — no dependencies.

FunctionSignatureReturnsrsirsi(close, period=14)Series (0-100)bbandsbbands(close, period=20, std=2.0)(upper, middle, lower)macdmacd(close, fast=12, slow=26, signal=9)(macd_line, signal, histogram)atratr(high, low, close, period=14)Seriesstochasticstochastic(high, low, close, k=14, d=3)(%K, %D)

### Position Sizing

from vibetrading.sizing import kelly_size, fixed_fraction_size, volatility_adjusted_size, risk_per_trade_size

kelly_size(win_rate, avg_win, avg_loss, balance, fraction=0.5) — half-Kelly default
risk_per_trade_size(balance, risk_pct, stop_distance, price) — risk-based

### Templates

from vibetrading.templates import momentum, mean_reversion, grid, dca, multi_momentum
code = momentum()  # Returns valid strategy code string

### AI Generation

import vibetrading.strategy

code = vibetrading.strategy.generate("BTC RSI oversold entry, 3x leverage", model="claude-sonnet-4-20250514")
result = vibetrading.strategy.validate(code)  # Static analysis
report = vibetrading.strategy.analyze(results, strategy_code=code)  # LLM analysis

Requires ANTHROPIC_API_KEY or OPENAI_API_KEY in environment.

### Comparing Strategies

import vibetrading.compare

results = vibetrading.compare.run({"RSI": code1, "MACD": code2}, slippage_bps=5)
vibetrading.compare.print_table(results)
df = vibetrading.compare.to_dataframe(results)

### Data Download

import vibetrading.tools
from datetime import datetime, timezone

data = vibetrading.tools.download_data(
    ["BTC", "ETH", "SOL"], exchange="binance", interval="1h",
    start_time=datetime(2025, 1, 1, tzinfo=timezone.utc),
    end_time=datetime(2025, 6, 1, tzinfo=timezone.utc),
)
results = vibetrading.backtest.run(code, data=data, slippage_bps=5)

### Exchange Credentials

Store in .env.local (gitignored):

Exchangeapi_keyapi_secretExtraHyperliquidWallet address 0x...Private key 0x...—ParadexStarkNet public keyStarkNet private keyaccount_address=LighterAPI keyAPI secret—AsterAPI keyAPI secretuser_address=

### Common Patterns

For detailed API docs, strategy patterns, and exchange-specific setup: see references/api-details.md.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: crabbytt
- Version: 1.0.1
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-05-07T17:22:31.273Z
- Expires at: 2026-05-14T17:22:31.273Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/vibetrading)
- [Send to Agent page](https://openagent3.xyz/skills/vibetrading/agent)
- [JSON manifest](https://openagent3.xyz/skills/vibetrading/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/vibetrading/agent.md)
- [Download page](https://openagent3.xyz/downloads/vibetrading)