A stateless HTTP API that lets AI agents build Solana transactions to trade tokenized U.S. stocks (xStocks). An agent with its own wallet signs and sends the transaction itself; for a person with Phantom or another Solana wallet, the agent hands over a Solana Pay link or QR code and the person approves it in their own wallet.
No account. No API key. No OAuth.
Plus many more tokenized stocks and ETFs, kept up to date automatically. Full machine-readable list: xstocker.com/agent/assets.json — a static file, no API call needed.
How It Works
01
Discover assets
Read xstocker.com/agent/assets.json — a static file listing every tradable xStock and its mint address. No API call needed; cache it.
02
Build an order
POST api.xstocker.com/agent/build-order with a wallet, asset, and amount. Get back an unsigned transaction.
03
Sign
An agent with its own signer signs the transaction. A person gets a Solana Pay link or QR and approves it in their own wallet, e.g. Phantom. xStocker never holds keys or funds.
04
Verify on-chain
GET api.xstocker.com/agent/order/{signature} confirms the trade landed on Solana.
Core Endpoints
GETxstocker.com/agent/assets.jsonStatic file: tradable xStocks with mint addresses (no API call)
POSTapi.xstocker.com/agent/build-orderBuild an unsigned buy or sell transaction
GETxstocker.com/agent/pay?asset=&amount=&side=&pay_token=&partner=Solana Pay transaction request (wallet GET + POST), works in Phantom
GETapi.xstocker.com/agent/order/{signature}Check on-chain confirmation status
GETapi.xstocker.com/agent/partners/check?wallet=Check a wallet can receive referral fees (no registration)
POSTapi.xstocker.com/agent/mcpMCP server (Streamable HTTP)
GETxstocker.com/.well-known/agent.jsonMachine-readable service description
On a sell, amount is in the units your wallet shows (xStocks are scaled-UI tokens, so this can differ from the raw on-chain amount). Up to 8 decimals; pass it as a number or a string. The API converts it to the exact on-chain amount and never sells more than the wallet holds.
Sell everything
POST api.xstocker.com/agent/build-order
{
"wallet": "USER_SOLANA_ADDRESS",
"asset": "NVDAx",
"amount": "max",
"side": "sell"
}
// "max" sells the entire balance: the API reads the exact on-chain balance itself.// details.amountIn shows how much was sold. "max" works on sells only.
With a referral partner
No registration, no API key, no claiming. A partner is just a Solana wallet address: pass it as partner and the partner's fee is sent to that wallet, on-chain, in the same transaction as the trade. The trader pays it on top of the standard fee (0.25% by default; USDC trades go to the partner's USDC token account, SOL trades to the wallet).
POST api.xstocker.com/agent/build-order
{ "wallet": "...", "asset": "NVDAx", "amount": 100, "partner": "PARTNER_WALLET_ADDRESS" }
→ details.partnerFee: { "applied": true, "bps": 25, "amount": "0.25 USDC", "destination": "..." }
// Works in the Solana Pay link too (partner= is added to it automatically), including in Phantom.// Check a wallet can receive fees (it needs a USDC token account for USDC trades):
GET api.xstocker.com/agent/partners/check?wallet=PARTNER_WALLET_ADDRESS→ { "usdc": { "ready": true }, "sol": { "ready": true }, "fee_bps": 25 }
// If the partner account can't receive the fee, the trade is still built normally// and details.partnerFee says why: { "applied": false, "reason": "partner_usdc_account_missing" }
Solana Pay (for people with a wallet)
When a person, not the agent, holds the wallet, skip the signing step: give them a solana: link or QR code. Their wallet (Phantom and other Solana Pay wallets) opens it, shows the trade, and the person approves it. The transaction is built at the moment the wallet asks for it, so it never expires while the person decides. The link is served from xstocker.com and works in Phantom without a security warning.
// 1. Build the link yourself — no API call needed:
const url = "https://xstocker.com/agent/pay?asset=NVDAx&amount=100&side=buy&pay_token=USDC";
const link = "solana:" + encodeURIComponent(url);
// link = solana:https%3A%2F%2Fxstocker.com%2Fagent%2Fpay%3Fasset%3DNVDAx%26amount%3D100%26side%3Dbuy%26pay_token%3DUSDC// With a referral partner: add partner= (any Solana wallet address). Its fee is paid on-chain in the same transaction.
const urlWithPartner = url + "&partner=PARTNER_WALLET_ADDRESS";
const linkWithPartner = "solana:" + encodeURIComponent(urlWithPartner);
// linkWithPartner = solana:https%3A%2F%2Fxstocker.com%2Fagent%2Fpay%3Fasset%3DNVDAx%26amount%3D100%26side%3Dbuy%26pay_token%3DUSDC%26partner%3DPARTNER_WALLET_ADDRESS// 2. Show it as a link or a QR code. build-order / MCP build_order also return it as solanaPayUrl.// Parameters: asset, amount, side (buy|sell), pay_token (USDC|SOL),// partner (optional referral wallet, paid on-chain in the same transaction).// Sell: amount is in the units the wallet shows, or "max" for the whole balance.// Slippage: 0.5%.
Under the hood this is the standard Solana Pay transaction request: the wallet sends GET (label and icon), then POST with {"account": "WALLET_ADDRESS"} and receives a base64 transaction to sign.
Embed the widget (for websites)
Add a “Buy xStocks” widget to any website with one iframe. Visitors scan the QR code with their wallet or copy the Solana Pay link: no wallet connection, no sign-up, and the buyer approves the trade in their own wallet. Add your Solana wallet as partner to earn 0.25% of every purchase made through your widget, paid on-chain in the same transaction.
You can customize
Partner wallet: earn 0.25% of every purchase
Theme: auto, dark or light
Language: English by default, 10 languages
Size: width and height
Set by xStocker
Quick buttons: the current top 5 xStocks
Payment in USDC or SOL
Search covers every xStock
Auto follows the visitor’s light or dark system setting.
Texts of the widget. Add the language that matches your site.
Live preview
partner
Optional. Your Solana wallet. It receives 0.25% of each purchase, on-chain, in the same transaction. The wallet needs a USDC token account to receive fees on USDC purchases.
theme
auto (default), dark or light.
lang
en (default), ru, es, pt, de, fr, it, zh, ja or ar. Arabic switches the widget to right-to-left.
stocks
Not configurable. The quick buttons always show the current top 5 xStocks by holders, and search covers every xStock.
size
640 px wide is recommended; the widget adapts down to about 280 px (below 560 px the QR code moves under the controls and it gets taller). Use the height the configurator shows, or let the page size it automatically with the snippet below.
Optional: automatic height. The widget reports its height to the page that embeds it:
Connect any MCP-compatible assistant (Claude, Cursor, and others) directly — no code, no API key. The server is stateless and non-custodial: it prepares orders, it never executes them and never sees a private key.
// Remote MCP server (Streamable HTTP)https://api.xstocker.com/agent/mcp// Local (stdio) server for Claude Desktop, Cursor and other stdio clients:
{
"mcpServers": {
"xstocker": {
"command": "npx",
"args": ["-y", "@xstocker/mcp"]
}
}
}
// Optional: add your referral partner wallet to every build_order
{
"mcpServers": {
"xstocker": {
"command": "npx",
"args": ["-y", "@xstocker/mcp"],
"env": { "XSTOCKER_PARTNER_WALLET": "YOUR_WALLET_ADDRESS" }
}
}
}
The local server is the @xstocker/mcp package on npm, also listed in the official MCP Registry as com.xstocker/agent-mcp.
Non-custodial. xStocker never holds user funds or private keys.
No accounts. No registration, no API keys, no OAuth flow required to trade.
Stateless trades. Every build-order request is self-contained.
Verifiable. Every trade settles and is confirmable on Solana.
⚠ Trading tokenized equities involves risk, including loss of principal. xStocks are issued by Backed Finance AG and are not available to U.S. citizens or residents. Prices, quotes, and execution are provided by Jupiter. xStocker does not custody funds or provide investment advice.