> For the complete documentation index, see [llms.txt](https://docs.trover.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trover.tech/engineering/stock-token-trading.md).

# Robinhood Chain stock-token trading

The trading module accepts strict buy, sell, and hold commands from the API, X mentions, and X direct messages. Wallet capability is explicit: external/manual, embedded/manual, embedded/delegated, review-required, or disabled. Server submission requires the embedded/delegated mode and a policy profile that permits it.

Controls are changed through `PUT /v1/admin/trading/settings/:key`. Environment variables establish startup defaults and can disable the entire trading or X-trading surface. Optional Dexscreener liquidity enforcement is controlled by `enforce_min_liquidity` and `TRADE_MIN_LIQUIDITY_USD`; it is disabled by default. Transaction correctness checks remain mandatory: the chain must be `4663`, the stock token must be in the operator-managed canonical registry and pass Robinhood/onchain verification and policy, the quote must be valid and unexpired, and every intent and Privy submission is idempotent and audited. Blockscout publication is retained as independent evidence, not a product-support prerequisite.

## Social commands

```
@troverobinhood buy $AAPL with 100 USDG
@troverobinhood buy TSLA with 0.2 ETH
buy 5 NVDA
@troverobinhood sell 25% of $NVDA
sell half my AAPL to ETH
buy $TSLA with 0.05 WETH
sell all $SPY
hold $MSFT
```

Mentions are accepted only when the bot is mentioned. Incoming DMs do not require a mention. The X user ID maps to a Privy-authenticated `TradingProfile` and its single canonical trading wallet. Embedded or smart Privy wallets can execute server-side. External wallets are supported for identity and reads; direct execution requires a delegated Privy wallet ID or a client-side signing flow.

If no profile or executable wallet is linked, the intent is retained with a machine-readable rejection reason. When optional confirmation is enabled, the bot sends a one-time deep link and the intent resumes through `POST /v1/trading/intents/:id/confirm`.

## Canonical registry

`syncRobinhoodStockTokens` pulls the official Robinhood asset registry, validates every chain-4663 address onchain, records Blockscout verification, checks configured Chainlink/Robinhood feeds and heartbeat freshness, and upserts instead of deleting. Provider checks are isolated so an explorer outage cannot erase successful RPC verification. Assets removed upstream become `delisted_pending_review`. Explicit operator policy remains the only symbol exclusion layer.

ETH, WETH, and USDG are supported settlement assets. Canonical allowed ERC-20 routes can be added through the local pool configuration.

## Valuation and execution

`getUserRawBalance` is the tradable token balance. `getUserUIBalance` is the share-equivalent display view. Chainlink provides the full per-token price, including the multiplier's economic effect. Holding value is `raw token balance × full Chainlink token price`; the multiplier is never applied to the feed price again.

The worker requests hosted Uniswap and local-quoter routes in parallel, selects the best successful exact-input or exact-output result, records every route, and requires review when venue divergence exceeds the configured threshold. The local fallback supports direct paths and deterministic WETH/USDG multi-hop paths. It encodes bounded approvals and router calldata locally; the LLM never supplies transaction calldata.

Every execution stores the intent, settings snapshot, provider request ID, quote and Permit2 data, selected route, simulation, policy decision, approval identifiers, transaction hash, receipt, expected output, notional, Privy `reference_id`, and reconciliation status. A recurring job resolves pending/ambiguous submissions through Privy and onchain receipts without rebroadcasting.

Set `WEB_ALLOWED_ORIGINS` to the comma-separated browser origins allowed to call the API. A Privy authorization key is private signing material; it is never sent as a request signature. If delegated wallets require an authorization-key quorum, configure a supported Privy request signer rather than copying that key into an HTTP header.

## Product notice

Robinhood Stock Tokens are tokenized debt securities. They are not the underlying stock and do not grant voting, legal ownership, or beneficial rights in the underlying. Jurisdictional restrictions may apply. Direct issuer redemption is not supported in v1.

The disclosure, eligibility, and screening controls are available but disabled by default per product configuration. Enabling them does not replace legal or compliance review.

## Endpoints

* `GET /v1/trading/settings`
* `POST|GET /v1/trading/profile`
* `DELETE /v1/trading/profile/x`
* `DELETE /v1/trading/profile/wallets/:id`
* `POST /v1/trading/enrollment`
* `POST /v1/trading/siwe/nonce|verify`
* `POST|GET /v1/trading/intents`
* `POST /v1/trading/intents/:id/confirm`
* `GET /v1/trading/holdings`
* `GET /v1/stock-tokens`
* protected `/v1/admin/stock-tokens`, `/trading/settings`, `/trading/intents`, and `/treasury`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.trover.tech/engineering/stock-token-trading.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
