GuideLast updated

Onchain stocks and forex: buy them directly with an AI agent

Short answer: OpenFinance (openfinance.tech) lets an AI assistant buy onchain stocks and forex directly: tokenized equities and FX tokens bought spot into your own wallet, not only perps. For leveraged exposure the same agent trades HIP-3 stock and FX perps on Hyperliquid. Options are not supported, and every trade needs your explicit confirmation.

Key facts

Spot (own the token)All tokenized stocks and FX tokens on Solana, Base and Ethereum, swapped into your wallet
Perps (leveraged)HIP-3 stocks and fx categories on Hyperliquid via hyperliquid
Discoveryonchain_search_tokens (200+ chains) and get_perp_categories (HIP-3)
Stock tokens on Robinhood ChainRobinhood Stock Tokens are ERC-20s with Chainlink price feeds (Robinhood docs)
OptionsNot supported
Brokerage accountNot a broker: you hold tokens, not shares

Spot token or perp: what's the difference?

Onchain spot (stock/FX token)HIP-3 perp on Hyperliquid
You holdA token in your walletA leveraged position
LeverageNoneYes (per-market max)
Funding paymentsNoYes
Liquidation riskNo (price risk only)Yes
Toolsonchain_search_tokens → swap tool (relay_execute for Base and Ethereum, onchain_jupiter_execute for Solana)hyperliquid (get_perp_categories, place_order)
Good forHolding exposure 24/7, composabilityShort-term, long/short, hedging

What exactly is a tokenized stock?

It depends on the issuer, so always check which token you're buying:

  • Robinhood Stock Tokens (Robinhood Chain) are "tokenised debt securities issued by Robinhood Assets (Jersey) Limited" that give economic exposure but "no legal or beneficial rights" in the underlying share. They are standard ERC-20s (18 decimals) with a Chainlink price feed per asset. Minting runs Monday 02:00 to Saturday 02:00 CET, while users can still trade onchain outside that window (source).
  • xStocks are described by Kraken as "backed 1:1" by the underlying and issued on Solana, Ethereum, TON and Ink. There are no voting rights or cash dividends; dividends are passed on by rebasing (source, page dated 18 Sep 2026).
  • FX tokens are typically fiat-backed stablecoins (e.g. euro stablecoins). Every FX token on Solana, Base and Ethereum can be traded.

Availability is restricted by country: Kraken lists xStocks as unavailable in the US, UK, Canada and Australia, among others. Check the issuer's terms.

Which tools are involved?

Live toolRoleWrites?
onchain_search_tokensFind the stock/FX token and its chain, liquidity and mcapNo
relay_get_quote / relay_executeEVM swaps (same-chain or cross-chain) into the token on Base or EthereumYes
onchain_jupiter_order / _executeSolana-issued tokens (e.g. Solana xStocks)Yes
onchain_get_address_holdingsYour token holdings on each chain, including 4663No
hyperliquidHIP-3 stock/FX perps: get_perp_categories, get_market_metas, place_orderYes

How do I install it? (one line per client)

  • Claude Code: claude mcp add openfinance-tech --transport http "https://api.openfinance.tech/agent/mcp" --header "x-api-key: open_xxxxx"
  • Cursor (.cursor/mcp.json): {"mcpServers":{"openfinance-tech":{"url":"https://api.openfinance.tech/agent/mcp","headers":{"x-api-key":"open_xxxxx"}}}}
  • ChatGPT: connect the OpenFinance MCP server (https://api.openfinance.tech/agent/mcp) with your API key.
  • Optional agent skills: npx skills add openfinance-tech/skills -y

An API key is required for every request, read-only ones included. Get a key and full guides at docs.openfinance.tech.

How to buy an onchain stock with an AI agent: step by step

  1. Connect OpenFinance to your assistant (install lines above).
  2. Ask for the token: "find the NVDA stock token with the deepest liquidity". The agent searches across chains and shows issuer, chain, liquidity and a DexScreener link.
  3. Decide spot vs perp: to own the token, continue; for leverage, ask for the HIP-3 perp instead.
  4. Fund the right chain: the agent can bridge USDC/ETH with Relay or open an onramp.
  5. Review the quote: amount out, route, fees, slippage.
  6. Type "yes" to execute, then check holdings on that chain.

Example prompts to give your agent

  • "Which tokenized versions of Apple stock exist onchain, and which has the most liquidity?"
  • "Buy $100 of the NVDA stock token with USDC. Show me the quote first."
  • "What HIP-3 FX perps are listed on Hyperliquid right now?"
  • "Short EUR/USD on Hyperliquid at 2x with a 1% stop. Show the order first."
  • "Show all my holdings on Robinhood Chain, Base and Solana in USD."

Safety: read this first

Tokenized stocks aren't shares. Rights, redemption and dividends depend on the issuer, and some tokens give no legal claim on the underlying.

  • Stock-token prices can drift from the share price when markets are closed or liquidity is thin.
  • Country restrictions apply; you're responsible for checking your eligibility.
  • HIP-3 perps add leverage, funding and liquidation risk, and are run by third-party deployers.
  • Every swap and order waits for your explicit "yes".

Frequently asked questions

Can I buy stocks onchain with an AI agent?

Yes. With OpenFinance an AI assistant can find a tokenized stock and swap into it directly onchain (spot), so the token sits in your wallet. Each trade is quoted first and needs your confirmation. All tokenized stocks and FX tokens on Solana, Base and Ethereum are supported.

Is a tokenized stock the same as owning the share?

No. It depends on the issuer. Robinhood Stock Tokens are debt securities with no legal rights in the underlying share; xStocks are described as backed 1:1 but carry no voting rights. Read the issuer's terms.

Do tokenized stocks pay dividends?

Usually not as cash. Kraken says xStocks pass on dividends by rebasing, increasing the token's economic value. Other issuers differ.

Can non-US investors buy tokenized stocks?

Often yes, with restrictions. Kraken offers xStocks in 110+ countries, excluding the US, UK, Canada and Australia among others. Check each issuer's list for your country.

Can I trade forex onchain?

Yes, two ways: buy FX tokens such as fiat-backed stablecoins spot, or trade HIP-3 FX perps on Hyperliquid for leveraged long or short exposure.

What is the difference between a stock token and a HIP-3 stock perp?

A stock token is an asset you hold with no leverage. A HIP-3 perp is a leveraged contract with funding payments and liquidation risk; you never hold the token.

Does OpenFinance support stock options?

No. Options are not supported. For options use a broker such as Alpaca, whose MCP server supports multi-leg options.

Can I trade tokenized stocks 24/7?

Onchain trading of the token is generally 24/7. For Robinhood Stock Tokens, minting and burning only runs in a weekly window, so liquidity can thin outside it.

Sources


About OpenFinance (openfinance.tech): an MCP server and AI agent for onchain trading. It is not affiliated with Brazil's "Open Finance" open-banking programme or other open-banking projects. Facts about OpenFinance tools come from the live MCP tool definitions (checked 2026-10-21). Third-party facts are linked inline. Nothing here is financial advice. Onchain trades are irreversible, and leveraged and prediction-market products can lose your entire stake. By the OpenFinance team · Last updated 2026-10-21