Execute perpetual trades on Ostium and Aster via Maxxit's Lazy Trading API. Includes programmatic endpoints for opening/closing positions, managing risk, fetching market data, copy-trading other OpenClaw agents, and a trustless Alpha Marketplace for buying/selling ZK-verified trading signals (Arbitrum Sepolia).
Execute perpetual trades on Ostium and Aster via Maxxit's Lazy Trading API. Includes programmatic endpoints for opening/closing positions, managing risk, fetching market data, copy-trading other OpenClaw agents, and a trustless Alpha Marketplace for buying/selling ZK-verified trading signals (Arbitrum Sepolia).
Execute perpetual futures trades on Ostium and Aster DEX through Maxxit's Lazy Trading API. This skill enables automated trading through programmatic endpoints for opening/closing positions and managing risk.
When to Use This Skill
User wants to execute trades on Ostium
User wants to execute trades on Aster DEX
User asks about their lazy trading account details
User wants to check their USDC/ETH balance
User wants to view their open positions or portfolio
User wants to see their closed position history or PnL
User wants to discover available trading symbols
User wants to get market data or LunarCrush metrics for analysis
User wants a whole market snapshot for the trading purpose
User wants to compare altcoin rankings (AltRank) across different tokens
User wants to identify high-sentiment trading opportunities
User wants to know social volume trends for crypto assets
User wants to open a new trading position (long/short)
User wants to close an existing position
User wants to set or modify take profit levels
User wants to set or modify stop loss levels
User wants to fetch current token/market prices
User mentions "lazy trade", "perps", "perpetuals", or "futures trading"
User wants to automate their trading workflow
User wants to copy-trade or mirror another trader's positions
User wants to discover other OpenClaw agents to learn from
User wants to see what trades top-performing traders are making
User wants to find high-impact-factor traders to replicate
User wants to sell their trading signals as alpha
User wants to browse or buy trustless alpha from ZK-verified traders
User wants to generate a ZK proof of their trading performance or flag a position as alpha
User mentions "alpha marketplace", "sell alpha", "buy alpha", or "ZK proof"
⚠️ DEX Routing Rules (Mandatory)
Always ask venue first if unclear: "Do you want to trade on Ostium or Aster?"
Always state the active venue explicitly in your response (e.g., "Using Ostium..." or "Using Aster...").
Do not mix venue suggestions:
If user is trading on Ostium, only suggest Ostium endpoints/actions.
If user is trading on Aster, only suggest Aster endpoints/actions.
Do not ask network clarification:
Ostium is mainnet-only in this setup.
Aster is testnet-only in this setup.
Therefore do not ask "mainnet or testnet?" for either venue.
If user switches venue mid-conversation, confirm the switch and then continue with only that venue's flow.
⚠️ CRITICAL: API Parameter Rules (Read Before Calling ANY Endpoint)
NEVER assume, guess, or hallucinate values for API request parameters. Every required parameter must come from either a prior API response or explicit user input. If you don't have a required value, you MUST fetch it from the appropriate dependency endpoint first.
Parameter Dependency Graph
The following shows where each required parameter comes from. Always resolve dependencies before calling an endpoint.
Always call /club-details first to get user_wallet (used as userAddress/address) and ostium_agent_address (used as agentAddress). Cache these for the session — they don't change.
Never hardcode or guess wallet addresses. They are unique per user and must come from /club-details.
For opening a position: Fetch market data first (via /lunarcrush or /market-data), present it to the user, get explicit confirmation plus trade parameters (collateral, leverage, side, TP, SL), then execute.
Market format rule (Ostium):/symbols returns pairs like ETH/USD, but /open-position expects market as base token only (e.g. ETH). Convert by taking the base token before /.
For setting TP/SL after opening: Use the actualTradeIndex from the /open-position response. If you don't have it (e.g., position was opened earlier), call /positions to get tradeIndex, pairIndex, and entryPrice.
For closing a position: You need the tradeIndex — always call /positions first to look up the correct one for the user's specified market/position.
Ask the user for trade parameters — never assume collateral amount, leverage, TP%, or SL%. Present defaults but let the user confirm or override.
Validate the market exists by calling /symbols before trading if you're unsure whether a token is available on Ostium.
For Alpha consumer flow: Follow the exact order: /alpha/agents → /alpha/listings → /alpha/purchase (402) → /alpha/pay → /alpha/purchase (with X-Payment) → /alpha/verify → /club-details → /alpha/execute. Never skip steps. For /alpha/verify, pass the content object exactly as received from purchase — do not modify keys or values.
Pre-Flight Checklist (Run Mentally Before Every API Call)
✅ Do I have the user's wallet address? → If not, call /club-details
✅ Do I have the agent address? → If not, call /club-details
✅ Does this endpoint need a tradeIndex? → If not in hand, call /positions
✅ Does this endpoint need entryPrice/pairIndex? → If not in hand, call /positions
✅ Did I ask the user for all trade parameters? → collateral, leverage, side, TP%, SL%
✅ Is the market/symbol valid? → If unsure, call /symbols to verify
✅ (Alpha) Do I have commitment? → If not, call /alpha/agents
✅ (Alpha) Do I have listingId? → If not, call /alpha/listings
✅ (Alpha) For /verify: Am I passing content exactly as received? → No modifications
✅ (Alpha) For /execute: Do I have agentAddress + userAddress? → Call /club-details
Authentication
All requests require an API key with prefix lt_. Pass it via:
Retrieve cached LunarCrush market metrics for a specific symbol. This data includes social sentiment, price changes, volatility, and market rankings.
⚠️ Dependency: You must call the /symbols endpoint first to get the exact symbol string (e.g., "BTC/USD"). The symbol parameter requires an exact match.
# First, get available symbols
SYMBOL=$(curl -s -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/symbols" \
-H "X-API-KEY: ${MAXXIT_API_KEY}" | jq -r '.symbols[0].symbol')
# Then, get LunarCrush data for that symbol
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/lunarcrush?symbol=${SYMBOL}" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"
Current price in USD (decimal string for precision)
volume_24h
String
Trading volume in last 24 hours (decimal string)
market_cap
String
Market capitalization (decimal string)
market_cap_rank
Int
Rank by market cap (lower is better)
social_dominance
Float
Social volume relative to total market
market_dominance
Float
Market cap relative to total market
interactions_24h
Float
Social media interactions in last 24 hours
galaxy_score_previous
Float
Previous galaxy score (for trend analysis)
alt_rank_previous
Int
Previous alt rank (for trend analysis)
Data Freshness:
LunarCrush data is cached and updated periodically by a background worker
Check the updated_at field to see when the data was last refreshed
Data is typically refreshed every few hours
Get Account Balance
Retrieve USDC and ETH balance for the user's Ostium wallet address.
⚠️ Dependency: The address field is the user's Ostium wallet address (user_wallet). You MUST fetch it from /club-details first — do NOT hardcode or assume any address.
Get all open positions for the user's Ostium trading account. This endpoint is critical — it returns tradeIndex, pairIndex, and entryPrice which are required for closing positions and setting TP/SL.
⚠️ Dependency: The address field must come from /club-details → user_wallet. NEVER guess it.
tradeIndex — needed for /close-position, /set-take-profit, /set-stop-loss
pairIndex — needed for /set-take-profit, /set-stop-loss
entryPrice — needed for /set-take-profit, /set-stop-loss
side — needed for /set-take-profit, /set-stop-loss
### Get Position History
Get raw trading history for an address (includes open, close, cancelled orders, etc.).
**Note:** The user's Ostium wallet address can be fetched from the `/api/lazy-trading/programmatic/club-details` endpoint (see Get Account Balance section above).
```bash
curl -L -X POST "${MAXXIT_API_URL}/api/lazy-trading/programmatic/history" \
-H "X-API-KEY: ${MAXXIT_API_KEY}" \
-H "Content-Type: application/json" \
-d '{"address": "0x...", "count": 50}'
Request Body:
{"address":"0x...",// User's Ostium wallet address (required)"count":50// Number of recent orders to retrieve (default: 50)}
⚠️ Dependencies — ALL must be resolved BEFORE calling this endpoint:
agentAddress → from /club-details → ostium_agent_address (NEVER guess)
userAddress → from /club-details → user_wallet (NEVER guess)
market → validate via /symbols endpoint if unsure the token exists
If /symbols returns ETH/USD, pass market: "ETH" to /open-position (not ETH/USD)
side, collateral, leverage → ASK the user explicitly, do not assume
📊 Recommended Pre-Trade Flow:
Call /lunarcrush?symbol=TOKEN/USD or /market-data to get market conditions
Present the market data to the user (price, sentiment, volatility)
Ask the user: "Do you want to proceed? Specify: collateral (USDC), leverage, long/short"
Only after user confirms → call /open-position
🔐 Verification Note: Every trade is analyzed by EigenAI for alignment with market conditions. Users can verify the cryptographic signatures and reasoning for all their trades at maxxit.ai/openclaw.
🔑 SAVE the response — actualTradeIndex and entryPrice are needed for setting TP/SL later.
{"agentAddress":"0x...",// REQUIRED — from /club-details → ostium_agent_address. NEVER guess."userAddress":"0x...",// REQUIRED — from /club-details → user_wallet. NEVER guess."market":"BTC",// REQUIRED — Base token only for Ostium (e.g. "ETH", not "ETH/USD"). Validate via /symbols if unsure."side":"long",// REQUIRED — "long" or "short". ASK the user."collateral":100,// REQUIRED — Collateral in USDC. ASK the user."leverage":10,// Optional (default: 10). ASK the user."deploymentId":"uuid...",// Optional — associated deployment ID"signalId":"uuid...",// Optional — associated signal ID"isTestnet":false// Optional (default: false)}
Response (IMPORTANT — save these values):
{"success":true,"orderId":"order_123","tradeId":"trade_abc","transactionHash":"0x...","txHash":"0x...","status":"OPEN","message":"Position opened successfully","actualTradeIndex":2,// ← SAVE THIS — needed for /set-take-profit and /set-stop-loss"entryPrice":95000.0,// ← SAVE THIS — needed for /set-take-profit and /set-stop-loss"reasoning":"Market sentiment is bullish...",// EigenAI trade alignment analysis"llmSignature":"0x..."// Cryptographic signature for auditability}
Close Position
Close an existing perpetual futures position on Ostium.
⚠️ Dependencies — resolve BEFORE calling this endpoint:
agentAddress → from /club-details → ostium_agent_address
userAddress → from /club-details → user_wallet
tradeIndex → call /positions first to find the position you want to close, then use its tradeIndex
NEVER guess the tradeIndex or tradeId. Always fetch from /positions endpoint.
Set or update take-profit level for an existing position on Ostium.
⚠️ Dependencies — you need ALL of these before calling:
agentAddress → from /club-details → ostium_agent_address
userAddress → from /club-details → user_wallet
tradeIndex → from /open-position response → actualTradeIndex, OR from /positions → tradeIndex
entryPrice → from /open-position response → entryPrice, OR from /positions → entryPrice
pairIndex → from /positions → pairIndex, OR from /symbols → symbol id
takeProfitPercent → ASK the user (default: 0.30 = 30%)
side → from /positions → side ("long" or "short")
If you just opened a position: Use actualTradeIndex and entryPrice from the /open-position response.
If the position was opened earlier: Call /positions to fetch tradeIndex, entryPrice, pairIndex, and side.
{"agentAddress":"0x...",// REQUIRED — from /club-details. NEVER guess."userAddress":"0x...",// REQUIRED — from /club-details. NEVER guess."market":"BTC",// REQUIRED — Token symbol"tradeIndex":2,// REQUIRED — from /open-position or /positions. NEVER guess."takeProfitPercent":0.30,// Optional (default: 0.30 = 30%). ASK the user."entryPrice":90000,// REQUIRED — from /open-position or /positions. NEVER guess."pairIndex":0,// REQUIRED — from /positions or /symbols. NEVER guess."side":"long",// Optional (default: "long") — from /positions."isTestnet":false// Optional (default: false)}
Response:
{"success":true,"message":"Take profit set successfully","tpPrice":117000.0}
Set Stop Loss
Set or update stop-loss level for an existing position on Ostium.
⚠️ Dependencies — identical to Set Take Profit. You need ALL of these before calling:
agentAddress → from /club-details → ostium_agent_address
userAddress → from /club-details → user_wallet
tradeIndex → from /open-position response → actualTradeIndex, OR from /positions → tradeIndex
entryPrice → from /open-position response → entryPrice, OR from /positions → entryPrice
pairIndex → from /positions → pairIndex, OR from /symbols → symbol id
stopLossPercent → ASK the user (default: 0.10 = 10%)
side → from /positions → side ("long" or "short")
If you just opened a position: Use actualTradeIndex and entryPrice from the /open-position response.
If the position was opened earlier: Call /positions to fetch tradeIndex, entryPrice, pairIndex, and side.
# Same dependency resolution as Set Take Profit (see above for full example)# Step 1: Get addresses from /club-details# Step 2: Get position details from /positions# Step 3: Set stop loss with user-specified stopLossPercent
curl -L -X POST "${MAXXIT_API_URL}/api/lazy-trading/programmatic/set-stop-loss" \
-H "X-API-KEY: ${MAXXIT_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"agentAddress": "0x...",
"userAddress": "0x...",
"market": "BTC",
"tradeIndex": 2,
"stopLossPercent": 0.10,
"entryPrice": 90000,
"pairIndex": 0,
"side": "long"
}'
Request Body:
{"agentAddress":"0x...",// REQUIRED — from /club-details. NEVER guess."userAddress":"0x...",// REQUIRED — from /club-details. NEVER guess."market":"BTC",// REQUIRED — Token symbol"tradeIndex":2,// REQUIRED — from /open-position or /positions. NEVER guess."stopLossPercent":0.10,// Optional (default: 0.10 = 10%). ASK the user."entryPrice":90000,// REQUIRED — from /open-position or /positions. NEVER guess."pairIndex":0,// REQUIRED — from /positions or /symbols. NEVER guess."side":"long",// Optional (default: "long") — from /positions."isTestnet":false// Optional (default: false)}
Response:
{"success":true,"message":"Stop loss set successfully","slPrice":81000.0,"liquidationPrice":85500.0,"adjusted":false}
Get All Market Data
Retrieve the complete market snapshot from Ostium, including all symbols and their full LunarCrush metrics. This is highly recommended for AI agents that want to perform market-wide scanning or analysis in a single request.
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/market-data" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"
Discover other OpenClaw Traders and top-performing traders to potentially copy-trade. This is the first step in the copy-trading workflow — the returned wallet addresses are used as the address parameter in the /copy-trader-trades endpoint.
⚠️ Dependency Chain: This endpoint provides the wallet addresses needed by /copy-trader-trades. You MUST call this endpoint FIRST to get trader addresses — do NOT guess or hardcode addresses.
🚫 Self-copy guard: Never use your own user_wallet from /club-details as a copy-trader address.
# Get all traders (OpenClaw + Leaderboard)
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/copy-traders" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"# Get only OpenClaw Traders (prioritized)
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/copy-traders?source=openclaw" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"# Get only Leaderboard traders with filters
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/copy-traders?source=leaderboard&minImpactFactor=50&minTrades=100" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"
Query Parameters:
Parameter
Type
Default
Description
source
string
all
openclaw (OpenClaw agents only), leaderboard (top traders only), all (both)
Next step: After reviewing the trades, use /open-position to open a similar position. You'll need your own agentAddress and userAddress from /club-details.
Signal Format Examples
The lazy trading system processes natural language trading signals. Here are examples:
Opening Positions
"Long ETH with 5x leverage, entry at 3200"
"Short BTC 10x, TP 60000, SL 68000"
"Buy 100 USDC worth of ETH perpetual"
With Risk Management
"Long SOL 3x leverage, entry 150, take profit 180, stop loss 140"
"Short AVAX 5x, risk 2% of portfolio"
Closing Positions
"Close ETH long position"
"Take profit on BTC short"
Complete Workflow Examples
These are the mandatory step-by-step workflows for common trading operations. Follow these exactly.
Workflow 1: Opening a New Position (Full Flow)
Step 1: GET /club-details
→ Extract: user_wallet (→ userAddress), ostium_agent_address (→ agentAddress)
→ Cache these for the session
Step 2: GET /symbols
→ Verify the user's requested token is available on Ostium
→ Extract exact symbol string and maxLeverage
→ Convert pair format to market token for /open-position:
"ETH/USD" -> "ETH"
Step 3: GET /lunarcrush?symbol=TOKEN/USD (or GET /market-data for all)
→ Get market data: price, sentiment, volatility, galaxy_score
→ Present this data to the user:
"BTC is currently at $95,000 with sentiment 68.3 (bullish) and volatility 0.032 (normal).
Galaxy Score: 72.5/100. Do you want to proceed?"
Step 4: ASK the user for trade parameters
→ "Please confirm: collateral (USDC), leverage, long or short?"
→ "Would you like to set TP and SL? If so, what percentages?"
→ Wait for explicit user confirmation before proceeding
Step 5: POST /open-position
→ Use agentAddress and userAddress from Step 1
→ Use market, side, collateral, leverage from Step 4
→ IMPORTANT: Pass market as base token only (e.g. ETH), not pair format (ETH/USD)
→ SAVE the response: actualTradeIndex and entryPrice
Step 6 (if user wants TP/SL): POST /set-take-profit and/or POST /set-stop-loss
→ Use tradeIndex = actualTradeIndex from Step 5
→ Use entryPrice from Step 5
→ For pairIndex, use the symbol id from Step 2 or call /positions
→ Use takeProfitPercent/stopLossPercent from Step 4
Workflow 2: Closing an Existing Position
Step 1: GET /club-details
→ Extract: user_wallet, ostium_agent_address
Step 2: POST /positions (address = user_wallet from Step 1)
→ List all open positions
→ Present them to the user if multiple: "You have 3 open positions: BTC long, ETH short, SOL long. Which one do you want to close?"
→ Extract the tradeIndex for the position to close
Step 3: POST /close-position
→ Use agentAddress and userAddress from Step 1
→ Use market and actualTradeIndex from Step 2
→ Show the user the closePnl from the response
Workflow 3: Setting TP/SL on an Existing Position
Step 1: GET /club-details
→ Extract: user_wallet, ostium_agent_address
Step 2: POST /positions (address = user_wallet from Step 1)
→ Find the target position
→ Extract: tradeIndex, entryPrice, pairIndex, side
Step 3: ASK the user
→ "Position: BTC long at $95,000. Current TP: none, SL: $85,500."
→ "What TP% and SL% would you like to set?"
Step 4: POST /set-take-profit and/or POST /set-stop-loss
→ Use ALL values from Steps 1-3 — NEVER guess any of them
Workflow 4: Checking Portfolio & Market Overview
Step 1: GET /club-details
→ Extract: user_wallet
Step 2: POST /balance (address = user_wallet)
→ Show the user their USDC and ETH balances
Step 3: POST /positions (address = user_wallet)
→ Show all open positions with PnL details
Step 4 (optional): GET /market-data
→ Show market conditions for tokens they hold
Workflow 5: Copy-Trading Another OpenClaw Agent (Full Flow)
Step 1: GET /copy-traders?source=openclaw
→ Discover other OpenClaw Trader agents
→ Extract: creatorWallet from the trader you want to copy
→ Exclude your own wallet (`/club-details.user_wallet`) if it appears
→ IMPORTANT: This is a REQUIRED first step — you cannot call
/copy-trader-trades without an address from this endpoint
Step 2: GET /copy-trader-trades?address={creatorWallet}
→ Fetch recent trades for that trader from the Ostium subgraph
→ Review: side (LONG/SHORT), tokenSymbol, leverage, collateral, entry price
→ Decide: "Should I copy this trade?"
→ DEPENDENCY: The address param comes from Step 1 (creatorWallet or walletAddress)
Step 3: GET /club-details
→ Get YOUR OWN userAddress (user_wallet) and agentAddress (ostium_agent_address)
→ These are needed to execute your own trade
Step 4: POST /open-position
→ Mirror the trade from Step 2 using your own addresses from Step 3:
- market = tokenSymbol from the copied trade
- side = side from the copied trade (LONG/SHORT → long/short)
- collateral = decide based on your own risk tolerance
- leverage = match the copied trader's leverage or adjust
→ SAVE: actualTradeIndex and entryPrice from response
Step 5 (optional): POST /set-take-profit and/or POST /set-stop-loss
→ Use actualTradeIndex and entryPrice from Step 4
→ Match the copied trader's TP/SL ratios or set your own
Aster DEX is a perpetual futures exchange on BNB Chain. Use Aster endpoints when the user wants to trade on BNB Chain. The Aster API uses API Key + Secret authentication (stored server-side) — you do NOT need agentAddress. You only need userAddress from /club-details.
Venue Selection
Venue
Chain
Symbol Format
Auth Required
When to Use
Ostium
Arbitrum (mainnet only)
BTC, ETH
agentAddress + userAddress
Default for most trades
Aster
BNB Chain (testnet only)
BTCUSDT, ETHUSDT
userAddress only
When user specifies BNB Chain or Aster
Network behavior rule: Do not ask users to choose mainnet/testnet for these venues. Ostium is fixed to mainnet and Aster is fixed to testnet in this environment.
How to check if Aster is configured: In the /club-details response, aster_configured: true means the user has set up Aster API keys. If false, direct them to set up Aster at maxxit.ai/openclaw.
Aster Symbols
Aster uses Binance-style symbol format: BTCUSDT, ETHUSDT, etc. The API auto-appends USDT if you pass just BTC.
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/aster/symbols" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"
{"userAddress":"0x...",// REQUIRED — from /club-details → user_wallet"symbol":"BTC",// REQUIRED — token or full symbol (BTC or BTCUSDT)"limit":100,// Optional — default depends on exchange (max 1000)"orderId":12345,// Optional — fetch from this orderId onward"startTime":1709251200000,// Optional — ms timestamp"endTime":1709856000000// Optional — ms timestamp}
POST /api/lazy-trading/programmatic/aster/history now proxies to Aster /fapi/v3/allOrders.
Use this endpoint when users ask for "all old trades/orders", "order history", or "past orders" on Aster.
Aster Open Position
📋 LLM Pre-Call Checklist — Ask the user these questions before calling this endpoint:
Symbol: "Which token do you want to trade?" (e.g. BTC, ETH, SOL)
Side: "Long or short?"
Quantity: "How much [TOKEN] do you want to trade?" — get the answer in base asset units (e.g. 0.01 BTC, 0.5 ETH).
Leverage: "What leverage? (e.g. 10x)"
Order type: "Market order or limit order?" (default: MARKET). If LIMIT, also ask for the limit price.
Aster requires quantity (base asset) for open-position. Do not use collateral.NEVER call this endpoint without a confirmed quantity in base asset units.
{"userAddress":"0x...",// REQUIRED — from /club-details → user_wallet. NEVER guess."symbol":"BTC",// REQUIRED — Token name or full symbol (BTCUSDT). ASK the user."side":"long",// REQUIRED — "long" or "short". ASK the user."quantity":0.01,// REQUIRED — Position size in BASE asset (e.g. 0.01 BTC). ASK the user."leverage":10,// Optional — Leverage multiplier. ASK the user."type":"MARKET",// Optional — "MARKET" (default) or "LIMIT". ASK the user."price":95000// Required only for LIMIT orders. ASK the user if type is LIMIT.}
⚠️ IMPORTANT:quantity must always be specified in the base asset (e.g. 0.01 for 0.01 BTC).
If the user provides a USDT/collateral amount, ask them to provide the exact token quantity instead.
Do not convert collateral to quantity in this workflow.
Response (IMPORTANT — save these values):
{"success":true,"orderId":12345678,"symbol":"BTCUSDT","side":"BUY","status":"FILLED","avgPrice":"95000.50","executedQty":"0.010","message":"Position opened: long BTCUSDT"}
User specifies in base asset units (e.g. 0.01 BTC)
User input (required). If user provides USDT/collateral amount, ask for quantity instead. Do not calculate in the workflow.
leverage
User specifies
User input
entryPrice
/aster/positions → entryPrice
From position data
stopPrice
User specifies or calculated from percent
User input or calculated
Aster Workflow: Open Position on BNB Chain
Step 1: GET /club-details
→ Extract: user_wallet
→ Check: aster_configured == true (if false, tell user to set up Aster at maxxit.ai/openclaw)
Step 2: GET /aster/symbols
→ Verify the token is available on Aster
Step 3: GET /aster/price?token=BTC
→ Get current price, present to user
Step 4: ASK the user for ALL trade parameters
→ "Which token?" (e.g. BTC, ETH, SOL)
→ "Long or short?"
→ "How much [TOKEN] do you want to buy/sell?" — collect answer in BASE asset units (e.g. 0.01 BTC)
• If user gives a USDT/collateral amount, ask them to provide token quantity instead.
→ "Leverage? (e.g. 10x)"
→ "Market or limit order?" — if LIMIT, also ask for the limit price
Step 5: POST /aster/open-position
→ Use userAddress from Step 1
→ Use symbol, side, quantity (base asset), leverage from Step 4
→ SAVE orderId and avgPrice from response
Step 6 (if user wants TP/SL): POST /aster/set-take-profit and/or POST /aster/set-stop-loss
→ Use entryPrice = avgPrice from Step 5
→ Use side from Step 4
→ Ask user for takeProfitPercent / stopLossPercent (or exact stopPrice)
Aster Workflow: Close Position
Step 1: GET /club-details → Extract user_wallet
Step 2: POST /aster/positions (userAddress = user_wallet)
→ Show positions to user, let them pick which to close
Step 3: POST /aster/close-position
→ Pass userAddress and symbol
→ Omit quantity to close full position
Alpha Marketplace (Arbitrum Sepolia)
Trustless ZK-verified trading signals. Producers generate proofs and flag positions as alpha; consumers discover agents by commitment, purchase alpha via x402, verify content, and execute.
Base path:${MAXXIT_API_URL}/api/lazy-trading/programmatic/alpha/* Auth:X-API-KEY header (same as other endpoints). Payment: On-chain USDC on Arbitrum Sepolia (testnet) or Arbitrum One (mainnet).
Prerequisites for consuming alpha:
User must have completed Lazy Trading setup (agent deployed) — /club-details must return ostium_agent_address. The /pay endpoint uses this agent to send USDC; without it, /pay returns 400.
Agent wallet must hold enough USDC for the listing price. If insufficient, /pay returns 402 with required and available amounts — inform the user to fund the agent address.
(Producer) Body: { positionId, priceUsdc, leverage? }. Flag open position as alpha.
How x402 Purchase Works (3 API Calls)
⚠️ CRITICAL: To purchase alpha content you MUST call these 3 endpoints in this exact order. Do NOT skip steps. The /pay endpoint handles all wallet operations server-side — you do NOT need a private key.
Step A: GET /alpha/purchase/{listingId} → 402 + paymentDetails
Step B: POST /alpha/pay/{listingId} → { txHash }
Step C: GET /alpha/purchase/{listingId} → 200 + alpha content
+ Header: X-Payment: {txHash from Step B}
Step A — Get payment details:
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/alpha/purchase/{listingId}" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"
Response: 402 with paymentDetails.price, paymentDetails.payTo, paymentDetails.network.
If response is 200: you already own this listing — alpha is returned directly, skip to Step 4.
Step B — Send USDC (server handles everything):
curl -L -X POST "${MAXXIT_API_URL}/api/lazy-trading/programmatic/alpha/pay/{listingId}" \
-H "X-API-KEY: ${MAXXIT_API_KEY}"
Response: 200 with txHash, from, to, amount.
If alreadyPaid: true: use the returned txHash directly.
If 402: insufficient USDC balance — response has required and available amounts.
Step C — Retrieve alpha content:
curl -L -X GET "${MAXXIT_API_URL}/api/lazy-trading/programmatic/alpha/purchase/{listingId}" \
-H "X-API-KEY: ${MAXXIT_API_KEY}" \
-H "X-Payment: {txHash from Step B}"
SAVE from Step C:alpha, contentHash, listingId — needed for /verify and /execute.
Pass content exactly as received: For /alpha/verify, the content field must be the exact alpha object from Step C. Do not modify keys, values, or key order — the hash is computed using sorted keys and any change will cause verification to fail.
Step 1: GET /alpha/agents
→ Pick an agent by commitment, winRate, totalPnl
→ SAVE: commitment
Step 2: GET /alpha/listings?commitment={commitment}
→ Browse listings, pick one
→ SAVE: listingId
Step 3a: GET /alpha/purchase/{listingId}
→ If 200: already purchased, skip to Step 4
→ If 402: need to pay → go to Step 3b
Step 3b: POST /alpha/pay/{listingId}
→ Server sends USDC from your agent to the producer
→ If 402: insufficient USDC balance → fund your agent wallet and retry
→ If alreadyPaid: use the returned txHash
→ SAVE: txHash
Step 3c: GET /alpha/purchase/{listingId}
→ Header: X-Payment: {txHash from Step 3b}
→ SAVE: alpha, contentHash, listingId
Step 4: POST /alpha/verify
→ Body: { "listingId": "...", "content": { ...alpha from Step 3c } }
→ Check: verified === true
Step 5: GET /club-details
→ Extract: user_wallet → userAddress
→ Extract: ostium_agent_address → agentAddress
Step 6: POST /alpha/execute
→ Body: { "alphaContent": { ...alpha }, "agentAddress": "...",
"userAddress": "...", "collateral": 100 }
→ alphaContent must include at least token and side (from alpha)
→ agentAddress = ostium_agent_address, userAddress = user_wallet (both from /club-details)
→ collateral: ask user or use default (e.g. 100 USDC)
→ Check: success === true
Workflow: Producing Alpha
POST /alpha/generate-proof with { autoProcess: false } → queues proof and returns proofId
Example: