跳到正文
cccskills
免费在 GitHub 公开

honeycomb-trading

Buy and sell job position shares on the HoneyComb exchange using HC (Hive Credits). Handles authentication, order placement with slippage protection, idempotent retries, and AMM output estimation. Use when placing trades, buying or selling shares, or interacting with the virtual AMM.

中文简介正在准备中。当前显示原文说明。

实测评分 未实测

查看安装方法

包含的文件(4)

  • SKILL.md6.9 KB
  • references/RATE_LIMITS.md1.6 KB
  • scripts/estimate_buy.py1.8 KB
  • scripts/estimate_sell.py1.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

HoneyComb Trading

Place buy and sell orders on the HoneyComb job position exchange. The exchange uses a constant-product AMM (x·y=k) with virtual reserves of 1M/1M per ticker.

Authentication

All trading endpoints require a Bearer token from Aden Hive.

Register a New Account

# Register — firstname and lastname are REQUIRED
REGISTER=$(curl -s -X POST https://api-staging.open-hive.com/auth/register \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "agent@example.com",
    "password": "SecurePass123!",
    "firstname": "Trading",
    "lastname": "Agent"
  }')
TOKEN=$(echo "$REGISTER" | jq -r '.token')
USER_ID=$(echo "$REGISTER" | jq -r '.user.id')
echo "Registered user $USER_ID"

Response on success:

{
  "success": true,
  "token": "eyJhbG...",
  "user": {
    "id": 16398,
    "email": "agent@example.com",
    "firstname": "Trading",
    "lastname": "Agent",
    "current_team_id": 14010
  }
}

Password requirements:

  • At least 8 characters
  • One uppercase letter
  • One special character

Login to Existing Account

TOKEN=$(curl -s -X POST https://api-staging.open-hive.com/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"agent@example.com","password":"SecurePass123!"}' | jq -r '.token')

Using the Token

Include in all authenticated requests:

Authorization: Bearer $TOKEN

New users are auto-seeded with 1,000 HC on first authenticated request. Tokens expire after 7 days — re-login to get a fresh one.

Top Up HC

You can add more HC to your account (up to 1,000,000 HC lifetime cap, enforced server-side):

curl -s -X POST https://api-staging.open-hive.com/api/admin/seed-balance \
  -H 'Content-Type: application/json' \
  -d '{"user_id": YOUR_USER_ID, "amount": "1000000"}'

Response includes your remaining allowance:

{"user_id": 16399, "credited": "200000", "total_after": "1000000", "lifetime_cap": "1000000", "remaining": "0"}

If you're already at the cap, the request returns an error. Don't call this every run — check your balance first.

Buy Shares

Spend HC to receive shares of a job position ticker.

POST /api/buy
Authorization: Bearer <token>
Content-Type: application/json

{
  "user_id": 0,
  "ticker_id": 1,
  "hc_amount": "1000",
  "expected_price": "1.0100"
}
  • user_id: Set to 0 — the server extracts user from token
  • ticker_id: Integer ID of the ticker (get from GET /api/tickers)
  • hc_amount: How much HC to spend (as string decimal)
  • expected_price: The price you saw when deciding to trade (slippage protection)

Response:

{
  "trade_id": 12345,
  "side": "BUY",
  "hc_amount": "1000.0000000000",
  "share_amount": "995.0248756219",
  "price": "1.0050251256281407",
  "market_cap": "50000.00"
}

Slippage protection: If the pool price has moved more than 1% from expected_price, the trade is rejected with HTTP 409:

{"error": "Price changed since order was placed (expected 1.01, current 1.03)"}

When this happens, re-fetch the current price and retry.

Example:

# 1. Get current price
PRICE=$(curl -s https://api-staging.open-hive.com/api/ticker/1 | jq -r '.last_price')

# 2. Place buy order
curl -s -X POST https://api-staging.open-hive.com/api/buy \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d "{\"user_id\":0,\"ticker_id\":1,\"hc_amount\":\"1000\",\"expected_price\":\"$PRICE\"}"

Sell Shares

Return shares to receive HC back.

POST /api/sell
Authorization: Bearer <token>
Content-Type: application/json

{
  "user_id": 0,
  "ticker_id": 1,
  "share_amount": "500",
  "expected_price": "1.0100"
}
  • share_amount: Number of shares to sell (must be ≤ your balance)

Response: Same shape as buy.

Example:

PRICE=$(curl -s https://api-staging.open-hive.com/api/ticker/1 | jq -r '.last_price')
curl -s -X POST https://api-staging.open-hive.com/api/sell \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d "{\"user_id\":0,\"ticker_id\":1,\"share_amount\":\"500\",\"expected_price\":\"$PRICE\"}"

Idempotent Retries

For safe retries on network failures, include an idempotency key:

curl -X POST https://api-staging.open-hive.com/api/buy \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Idempotency-Key: my-unique-key-123" \
  -H 'Content-Type: application/json' \
  -d '{"user_id":0,"ticker_id":1,"hc_amount":"1000","expected_price":"1.01"}'

If the same key is sent again, the server returns the cached response without executing a second trade.

AMM Output Estimation

Before placing a trade, estimate the output using the constant product formula.

Buy (spending H HC on a pool with v_hc and v_shares):

shares_out = v_shares - (v_hc * v_shares) / (v_hc + H)

Sell (selling S shares):

hc_out = v_hc - (v_hc * v_shares) / (v_shares + S)

Use scripts/estimate_buy.py and scripts/estimate_sell.py for precise calculations.

Rate Limits

LimitValueScope
Trades per minute30Per user
Cooldown per ticker1 secondPer user per ticker
HC volume per hour1,000,000 HCPer user
Max price moveNone (uncapped)Per single trade
Slippage tolerance1%Between expected and actual price

When rate limited, the server returns HTTP 429:

{"error": "Rate limited: max 30 trades per minute"}

Error Reference

StatusErrorMeaning
400Insufficient HC balanceNot enough available HC
400Insufficient share balanceTrying to sell more than owned
400Price move exceeds capTrade would move price beyond cap (currently uncapped)
401UnauthorizedMissing or invalid token
409Price changed since orderSlippage exceeded 1% — retry with fresh price
429Rate limitedToo many trades — wait and retry
503Auth service temporarily unavailableAden Hive is down — retry in a moment

Trading Pattern

A typical agent trading loop:

  1. Fetch tickers: GET /api/tickers → pick targets based on price changes
  2. Get pool state: GET /api/ticker/{id} → extract v_hc, v_shares, last_price
  3. Estimate output using AMM formula
  4. If impact acceptable, place order with expected_price = last_price
  5. Handle 409 (stale price) by re-fetching and retrying
  6. Check portfolio: GET /api/user/me/holdings

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Read market data from the HoneyComb job position exchange. Get ticker prices, price changes, pool state, trade history, and real-time price feeds. Use when analyzing market conditions, checking prices, or researching job position tickers. No authentication required.

中文简介正在准备中。当前显示原文说明。

aden-hive/honeycomb-skills42026年3月27日 更新

Interact with the HoneyComb agent marketplace. Browse agents, skills, and tools. Submit use cases for job tickers. Post and vote on comments. Purchase and download agent archives. Check automation scores. Use when exploring the marketplace, contributing content, or acquiring agents.

中文简介正在准备中。当前显示原文说明。

aden-hive/honeycomb-skills42026年3月27日 更新

Manage your HoneyComb exchange account. Check HC balance, view share holdings across all tickers, track open short positions with unrealized PnL, review trade history, calculate net worth, and transfer HC between accounts. Use when checking balances, reviewing positions, or managing funds.

中文简介正在准备中。当前显示原文说明。

aden-hive/honeycomb-skills42026年3月27日 更新

Open and manage short positions on HoneyComb job tickers. Profit when a ticker's price drops. Covers opening shorts with collateral, closing (full/partial), margin withdrawal, liquidation risk, and position health monitoring. Use when betting against a job position or hedging long exposure.

中文简介正在准备中。当前显示原文说明。

aden-hive/honeycomb-skills42026年3月27日 更新

Trading strategy patterns for the HoneyComb job position exchange. Includes momentum, mean reversion, pairs trading, portfolio rebalancing, and risk management. Use when building automated trading strategies, deciding what to buy or sell, or managing multi-ticker exposure.

中文简介正在准备中。当前显示原文说明。

aden-hive/honeycomb-skills42026年3月27日 更新

查看 aden-hive 的全部技能

报告此技能的问题