liquid-agent-stocks
Buy, hold, rebalance and sell a basket of Coinbase tokenized US stocks (NVDA, AAPL, META, GOOGL) on Base from $1 through the free Liquid Agent API. Use when a user asks to invest i…
LeftyChris
@leftychris13
Install
$ openclaw skills install @leftychris13/liquid-agent-stocksLiquid Agent — tokenized stock basket for agents
One HTTP API lets you open a self-custodied vault on Base that holds a band-rebalanced basket of Coinbase's tokenized NVDA, AAPL, META, GOOGL, buy in from $1 USDC, rebalance, and sell any block. No account, no API key, no project token, no oracle. The server never holds a key: every write returns an unsigned transaction that you sign with your own wallet and broadcast on Base.
Base URL: https://api.liquidagent.ai · Chain: Base mainnet (eip155:8453)
When to use this skill
- "Buy some stocks", "invest $50 in tech stocks", "get me NVDA and AAPL exposure", "buy an index / ETF on-chain"
- "How is my stock portfolio doing", "rebalance my stocks", "sell my stocks", "cash out to USDC"
- "Send my stock basket to <address>", "gift stocks to a friend's wallet"
If the user wants a single individual stock rather than the four-stock basket, say so and offer the basket anyway; the vault always holds all four at the target weights.
What you need
- A wallet on Base that can sign transactions and EIP-712 typed data (
eth_signTypedData_v4). - USDC on Base for the purchase (min $1, 0.20% mint fee). USDC is
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. - A little ETH on Base for gas. Deposits swap precompile tokens and need an explicit gas limit of about 3,000,000; at Base fees that is usually well under $0.05, but a wallet with zero ETH cannot buy. Check ETH first and tell the user if it is missing.
- Amounts in requests are USDC-6 integers:
2000000= $2.00. Weights are basis points summing to 10000.
The flow (run top to bottom the first time)
Always start with the free guide if anything is unclear: GET /v1/guide.
- Discover the basket —
GET /v1/basket→ constituents with live prices, fees,minDepositUsdc. - Quote (optional) —
GET /v1/quote?usdc=2000000→ shares,mintFeeUsdc,netUsdc. Show this to the user before spending. - Do you already have a vault? —
GET /v1/balance/<yourAddress>. IfvaultCount > 0, usevaults[0].vaultand skip step 4. Creating a second vault is almost never what the user wants. - Create your vault (once) —
POST /v1/create-vaultbody{}→{to,data,value,chainId}. Sign, broadcast, wait for the receipt, then re-run step 3 to get the vault address. - Custom weights (optional) —
POST /v1/set-weightsbody{"vault":"0x…","weightsBps":[4000,2000,2000,2000]}→ unsigned tx. Order is NVDA, META, AAPL, GOOGL. Each weight can move at most 2000 bps per call. Default is 2500 each. - Buy — two calls, one on-chain transaction:
POST /v1/buybody{"vault":"0x…","usdc":"2000000","permit":true,"owner":"0xYourAddress"}→{typedData}.- Sign
typedDataoff-chain witheth_signTypedData_v4(free, no gas). POST /v1/buyagain with{"vault":"0x…","usdc":"2000000","permit":{"deadline":<typedData.message.deadline>,"signature":"0x…"}}→ ONE unsigneddepositWithPermittx. Sign and broadcast with gas limit ~3,000,000.- No
approvestep is needed. Omitpermitentirely only if your wallet cannot sign typed data; then you get{steps:[approve, deposit]}to send in order.
- Check it —
GET /v1/vault/<vault>→navUsdc, current vs targetweightsBps,rebalanceNeeded. - Rebalance (optional) —
POST /v1/rebalancebody{"vault":"0x…"}→ unsigned tx. Only whenrebalanceNeededis true or after changing weights. - Sell / cash out —
POST /v1/redeembody{"vault":"0x…","shares":"<amount>","inKind":false}→ unsigned tx that burns shares and pays USDC.inKind:truereturns the raw stock tokens instead and works even if pricing is unavailable.sharescomes from step 3. - Send / gift (optional) —
POST /v1/sendbody{"vault":"0x…","to":"0xRecipient","shares":"<amount>"}→ unsigned tx. The recipient needs no vault and can redeem the shares themselves. Irreversible.
Every unsigned tx has the shape {to, data, value, chainId}. Sign it with the wallet that owns the funds and submit with eth_sendRawTransaction to any Base RPC (for example https://mainnet.base.org).
Example: buy $5 into an existing vault
API=https://api.liquidagent.ai
ME=0xYourAddress
VAULT=$(curl -s $API/v1/balance/$ME | jq -r '.vaults[0].vault')
# 1) get the permit to sign
curl -s -X POST $API/v1/buy -H 'content-type: application/json' \
-d "{\"vault\":\"$VAULT\",\"usdc\":\"5000000\",\"permit\":true,\"owner\":\"$ME\"}" > permit.json
# 2) sign permit.json .typedData with eth_signTypedData_v4 -> SIG, read DEADLINE from .typedData.message.deadline
# 3) get the single deposit tx
curl -s -X POST $API/v1/buy -H 'content-type: application/json' \
-d "{\"vault\":\"$VAULT\",\"usdc\":\"5000000\",\"permit\":{\"deadline\":$DEADLINE,\"signature\":\"$SIG\"}}"
# -> {to,data,value,chainId}: sign + broadcast with gas limit 3000000
Optional paid extras (x402, USDC on Base)
These return HTTP 402 with an x402 v2 challenge. If your runtime can pay x402 (agentcash, an x402 fetch wrapper, or the OpenClaw x402 skill), just retry with payment. Everything above stays free.
GET /v1/signals— $0.04. The whole basket's rebalancing signal in one call: per-stock returns, volatility, RSI, trend, relative strength, correlation, and an inverse-volatilitysuggestedWeightsBpsyou can pass straight to/v1/set-weights. Add?vault=<yours>for your drift.POST /v1/publishbody{"vault":"0x…","label":"Alice's stocks"}— $0.25 flat. Mints a live shareable portfolio page athttps://api.liquidagent.ai/v/<slug>for 24 hours; the user opensviewUrlwith no wallet or login. Re-publish to keep it alive.
Rules
- Never send a private key or seed phrase anywhere. This API never asks for one; it only returns data for you to sign locally.
- Confirm the USD amount with the user before broadcasting a buy, and report the tx hash after.
- Reuse the vault from
/v1/balance. Create a new one only ifvaultCountis 0. - Wait for each transaction receipt before the next step (create → balance → buy).
- Redeem and send are final once mined.
- Signals are aggregated data, not investment advice; say so if you relay them.
More: https://api.liquidagent.ai/v1/guide (plain-English), https://api.liquidagent.ai/openapi.json (full spec), https://api.liquidagent.ai/llms.txt.
Top skills in this category
Stock Analysis
@udiedrichsenAnalyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock scoring, viral trend detection (Hot Scanner), and rumor/early signal detection. Use for stock analysis, portfolio tracking, earnings reactions, crypto monitoring, trending stocks, or finding rumors before they hit mainstream.
Stock Market Pro
@kys42Yahoo Finance (yfinance) powered stock analysis skill: quotes, fundamentals, ASCII trends, high-resolution charts (RSI/MACD/BB/VWAP/ATR), plus optional web a...
A股量化 AkShare
@mbpzA股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
Stock Watcher
@robin797860Manage and monitor a personal stock watchlist with support for adding, removing, listing stocks, and summarizing their recent performance using data from 10jqka.com.cn. Use when the user wants to track specific stocks, get performance summaries, or manage their watchlist.
Intelligent Stocks Screener
@financial-ai-analyst基于东方财富数据库,支持通过自然语言输入筛选A港美股、基金、债券等多种资产,支持多元指标筛选,含技术面、消息面、基本面及市场情绪等,可用于全球资产速筛、跨市场监控、投资组合构建、策略回测等场景。返回结果包含数据说明及 csv 文件。Natural language screener for investment...