Portfolio-aware perpetual-futures trading agent using 0G Compute for trade decisions and 0G Storage for verifiable alpha delivery.
Live App: https://openclaw.maxxit.ai/ · OpenClaw Skill: clawhub.ai/abhi152003/maxxit-0g
Maxxit 0G:
- Pulls live portfolio and market context for a user.
- Calls 0G Compute for a portfolio-aware trade decision: should trade, side, confidence, and reasoning.
- Executes the trade on Ostium, Aster, or Avantis perpetuals after explicit user confirmation.
- Optionally publishes the executed trade as paid alpha, with the alpha payload stored on 0G Storage and a
rootHashreturned to every buyer for independent verification.
The OpenClaw skill in skills/maxxit-0g/ is the production agent interface. It ships with the repo and drives the full workflow.
Agent identity is wallet-based, and portable alpha payloads are stored through 0G Storage so the agent's outputs can be verified outside Maxxit's application database.
| Problem | 0G usage |
|---|---|
| Trade decisions should be auditable | 0G Compute broker returns a verified flag through broker.inference.processResponse |
| Paid alpha needs content integrity | 0G Storage stores the alpha payload and returns a rootHash |
| Agent outputs should be portable | Alpha payloads are content-addressed instead of only living in Maxxit's database |
The agent uses 0G Compute for trade decisions:
- Resolve the user's lazy-trading deployment + portfolio context.
- Run market research (
/api/lazy-trading/research). - Send
{ deploymentId, tokenSymbol, marketResearchSummary }to/alpha/0g-decision. - Call 0G Compute via
@0glabs/0g-serving-broker. - Return
{ shouldTrade, side, confidence, reasoning, modelUsed, verified }. - Ask for confirmation before executing a trade.
Key files:
pages/api/lazy-trading/programmatic/alpha/0g-decision.tslib/zg-compute.ts0g-backend/src/compute.ts- broker init,getRequestHeaders,processResponse0g-backend/src/server.ts
When a producer flags a trade as alpha, the alpha payload is uploaded to 0G Storage via @0gfoundation/0g-ts-sdk (Indexer.upload(MemData)). The listing returns ogStorage.rootHash and ogStorage.txHash. Buyers receive the rootHash with their purchase receipt and can use it to verify the payload.
Key files:
pages/api/lazy-trading/programmatic/alpha/flag.tspages/api/lazy-trading/programmatic/alpha/listings.tspages/api/lazy-trading/programmatic/alpha/verify.tslib/zg-storage.ts,lib/alpha-content-hash.ts0g-backend/src/storage.ts-uploadAlphaContent,downloadAlphaContent
@0glabs/0g-serving-broker- 0G Compute broker@0gfoundation/0g-ts-sdk- 0G Storage indexer client
No custom contracts were deployed. Maxxit 0G interacts directly with the 0G Galileo Storage flow contract.
- Example storage upload tx:
0xac0df9...f913bb50 - Network: 0G Galileo testnet (
evmrpc-testnet.0g.ai, chain id16602) - Indexer:
indexer-storage-testnet-turbo.0g.ai
User via OpenClaw / Maxxit UI
|
v
skills/maxxit-0g
- workflow and routing rules
- strategy runners
|
v
Maxxit Lazy Trading API
|
+-- market research
|
+-- decision call
| |
| v
| 0g-backend /compute
| |
| v
| 0G Compute
|
+-- trade execution
| |
| v
| Ostium / Aster / Avantis
|
+-- alpha listing
|
v
0g-backend /storage
|
v
0G Storage rootHashThe 0g-backend is an Express bridge that owns the 0G wallet and exposes /compute and /storage endpoints to the main Next.js app. 0G keys do not live in the user-facing process.
- Ostium perpetuals (Arbitrum)
- Aster DEX perpetuals (BNB Chain)
- Avantis DEX perpetuals (Base)
- Maxxit Alpha Marketplace for buying/selling trade signals (x402 USDC settlement)
npm install
cp .env.example .env
npm run devRequired env:
NEON_REST_URL=
NEON_REST_TOKEN=
ZG_BACKEND_URL=http://localhost:8787
ZG_BACKEND_AUTH_TOKEN=change-mecd 0g-backend
npm install
cp .env.example .env
npm run devRequired env:
PORT=8787
ZG_BACKEND_AUTH_TOKEN=change-me
ZG_WALLET_PRIVATE_KEY=
ZG_COMPUTE_RPC_URL=https://evmrpc-testnet.0g.ai
ZG_COMPUTE_PROVIDER_ADDRESS=
ZG_STORAGE_RPC_URL=https://evmrpc-testnet.0g.ai
ZG_STORAGE_INDEXER_URL=https://indexer-storage-testnet-turbo.0g.ainpx clawhub@latest install maxxit-0g
export MAXXIT_API_KEY="lt_your_api_key_here"
export MAXXIT_API_URL="https://maxxit.ai"The skill source is in skills/maxxit-0g/ and includes 7 standalone Python strategy runners (EMA, RSI/Bollinger, Donchian/ADX, taker-flow, mean-reversion, breakout, VWAP).
Example prompts:
Should I trade BTC?
What does 0G think about ETH?
Make a portfolio-aware decision for SOL.
Open the trade and list it as alpha on 0G storage.
Run the VWAP strategy on BTC/USD using Avantis.After a buyer completes the x402 purchase flow, they get a receipt containing ogStorage.rootHash. They can re-fetch and verify the payload:
# Verify the purchased alpha payload.
curl -L "https://maxxit.ai/api/lazy-trading/programmatic/alpha/verify" \
-H "X-API-KEY: $MAXXIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "listingId": "<id>", "content": <alpha object from purchase> }'If the payload does not match the listing, verified returns false.
maxxit-latest/
pages/api/lazy-trading/programmatic/ Trading and alpha endpoints
alpha/
0g-decision.ts 0G Compute entry point
flag.ts Listing and 0G Storage upload
verify.ts rootHash verification
lib/
zg-compute.ts Compute client wrapper
zg-storage.ts Storage client wrapper
alpha-content-hash.ts Canonical hashing
0g-backend/ Express bridge that owns the 0G wallet
src/{compute.ts, storage.ts, server.ts}
skills/maxxit-0g/ OpenClaw agent
SKILL.md
*-strategy.py Strategy runners
docs/0G_INTEGRATION_PLAN.md