Docs
Two read-only APIs, paid per call.
StockFi answers two questions about Robinhood Chain Stock Tokens with public data only: the Robinhood Stock Token API, onchain reads on chain 4663 (Chainlink, Uniswap v3, the token contracts), and Longbow's public read-only MCP. Every call is paid in USDG over x402. There are no accounts and no API keys. Machine-readable spec: /openapi.json.
Data checks only. Not investment advice, not a recommendation to trade or borrow, and not an offer or solicitation. Stock Tokens are not intended for U.S. persons and are not available to U.S. persons. StockFi never holds funds or keys, never signs, never sends a transaction and never routes a swap or a borrow.
Try a call
Without a payment, every endpoint answers 402 Payment Required with the price, the payee and the asset. Bad input answers 400 first, so a malformed request is never charged.
curl -i "https://stockfi.trade/v1/preflight?symbol=AAPL"
HTTP/2 402
PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6Mi… (base64 JSON, same as the body)
{"x402Version":2,"accepts":[{"scheme":"exact","network":"eip155:4663",
"amount":"20000","asset":"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
"payTo":"0xc32A9e2f1092F1D57D3267C2E70b80DA9De06D59",
"extra":{"name":"Global Dollar","version":"1"}}], …}
Paying with x402
- Read the requirements from the 402 (USDG, 6 decimals, on Robinhood Chain,
eip155:4663). - Sign an EIP-3009
TransferWithAuthorizationfor exactlyamounttopayTowith your own wallet. - Repeat the request with the base64 payload in
PAYMENT-SIGNATURE(v1 clients may sendX-PAYMENT).
StockFi verifies the authorization through x402Fi's public facilitator, runs the checks, and settles only after the result is ready. If the checks cannot run, you are not charged (503, charged: false). If settlement fails (an expired or reused authorization), no result is returned. USDG moves from your wallet straight to the StockFi service wallet; nobody in between holds it.
You can also buy the same calls through the StockFi listing on x402Fi, the dedicated x402 marketplace on Robinhood Chain, which adds a public receipt for each payment.
Receipts and response hashes
Every paid 200 body is canonical JSON (object keys sorted, no whitespace). Its SHA-256 is in X-Response-SHA256 (hex) and Content-Digest (RFC 9530). The settlement result, including the transaction hash, is in PAYMENT-RESPONSE. Keep all three and the call is reproducible evidence of what you paid for and what you got.
Before a result is released or any payment settles, it passes the same delivery check x402Fi's gateway runs (AgentWormhole's rules, an offline scan for malformed bodies and prompt-injection text). A result that fails is not released and you are not charged. X-Delivery-Scan reports the outcome. The check catches careless injection; it does not certify a response.
GET /v1/preflight
One call before a swap into or out of a Stock Token. Returns GO, CAUTION or STOP: STOP if any STOP rule fires, CAUTION if any CAUTION rule fires, GO only when every check passes. The facts are always included, so you can ignore the verdict and use the data.
| Param | Notes |
|---|---|
address | Stock Token contract on chain 4663. Wins over symbol; symbol is then a consistency check. |
symbol | Underlying ticker, no X prefix (AAPL). |
side | buy (default) or sell. |
sizeUsdg | Notional. Adds a Uniswap v3 route and price-impact quote and the $0.05 price. Also at /v1/preflight/quote. |
venue | Hint only: uniswap, rfq, any. Nothing is executed. |
Reason codes
| Code | Severity | When |
|---|---|---|
LOOKALIKE_OR_NOT_CANONICAL | STOP | Address is not the official deployment in the Robinhood asset registry, or a matching ticker sits at a different address. |
NOT_ON_ROBINHOOD_CHAIN | STOP | The asset has no deployment on chain 4663. |
ASSET_INACTIVE | STOP | Registry status is not active. |
TRADING_HALT | STOP | The underlier is halted. |
SESSION_CLOSED | CAUTION | The underlier is outside a tradable US-equity session. Onchain swaps can still happen. |
PENDING_MULTIPLIER | CAUTION | A corporate-action multiplier change is scheduled (registry or onchain newUIMultiplier). |
ORACLE_PAUSED | CAUTION | The token reports oraclePaused() = true. Reported as unavailable when a token lacks the method. |
WEEKEND_FEED_FREEZE | CAUTION | Chainlink Stock Token feeds run 24/5 and freeze on weekends and holidays while the token trades. Expected. |
STALE_FEED | CAUTION | Feed older than 30 minutes in the regular session, or past its heartbeat otherwise. |
DEX_PREMIUM | CAUTION | Uniswap mid differs from Chainlink by more than 1%. |
PRICE_IMPACT | CAUTION | Impact for sizeUsdg above 2%. |
THIN_BOOK | CAUTION | The size does not fit the available onchain depth. |
DATA_UNAVAILABLE | CAUTION | A required source could not be read for this call. Never treated as a pass. |
REST bid/ask are raw underlier prices; bidPerToken/askPerToken apply the current multiplier. Chainlink prices are already multiplier-adjusted and are never multiplied again.
GET /v1/reopen-risk
?wallet=0x… (required) and report=snapshot|weekend. Reads the wallet's Longbow positions (public MCP read tools only; onchain Morpho reads if the MCP is down) and, for each position backed by a Stock Token or a 24/5-priced RWA, projects the health factor at Monday's reopen:
- mark_to_dex — today's Uniswap price as the Monday open.
- gap_down_20 / gap_down_40 — 20% and 40% below the oracle price.
- gap_up_20 / gap_up_40 — on the weekend report, and whenever the debt is not USDG.
Each report also carries market.nextRegularOpen (the next 09:30 ET open, holiday-aware: the reopen these scenarios describe) and market.feedsResumeAt (when 24/5 Chainlink feeds resume). Each position carries corporateAction: a pending multiplier change from the Robinhood registry or the token contract, its effective time, and effectiveBeforeReopen when it lands before that open.
The weekend report (/v1/reopen-risk/weekend, $0.10) adds a short factual summary. When Guard is off and a scenario falls below 1.10, the position carries suggestedGuard as plain data, to be set by the owner in Longbow. A wallet with no positions returns 200 with positions: []. A number that cannot be computed is null with a note; it is never guessed. Information only; model risk applies.
Pricing
USDG on Robinhood Chain. Listed on x402Fi: listing is free and x402Fi takes 0%.
Source and security
Apache-2.0 at github.com/RWA-ID/stockfi. Report payment bugs privately through the repository's security advisories or contact@x402fi.dev.