rh-swap README

The project's README from github.com/kinexbtdev/rh-swap. As one markdown file: README.md.

rh-swap — Uniswap Stock Token Swap UI on Robinhood Chain (4663)

Minimal web app to quote and plan swaps of Robinhood Stock Tokens (NVDA, AAPL, SPY) and USDG on Robinhood Chain via Uniswap. Chain ID is hardcoded to 4663. Quotes use the Uniswap Trading API (Universal Router 2.1.1 / UniswapX v3) when an API key is set; otherwise Uniswap v3 QuoterV2 on-chain.

What this repo does

This is a developer-facing swap surface for Robinhood Chain, not a hosted exchange. It:

  1. Lets you pick a sell token and a buy token (Stock Tokens or USDG) and an amount.
  2. Requests a quote with tokenInChainId = tokenOutChainId = 4663 only.
  3. Applies slippage (hard cap 300 bps) and a 30-minute deadline bound.
  4. Plans ERC-20 approval to Permit2 (not arbitrary spenders).
  5. Never stores a private key; a connected wallet would sign in the browser.

Use it to learn Uniswap routing on Robinhood Chain, test slippage/approval logic, or embed the quote helpers in another dApp.

Stock Tokens are not DTCC shares; they are Robinhood-issued ERC-20s. See Stock Token documentation.

Keywords

Robinhood Chain Uniswap, Stock Token swap, USDG swap, Universal Router 4663, Permit2, UniswapX v3, QuoterV2, slippage, tokenized NVDA AAPL SPY.

Quick start

npm install
npm test
npm run dev

UI: http://localhost:4663. Optional VITE_UNISWAP_API_KEY for the hosted Trading API.

Constraint Detail
Chain ID Always 4663
Slippage Maximum 300 bps
Approvals Permit2, Universal Router, or SwapRouter02 only
Keys Not in the repository
Contract Address Source
Universal Router 0x8876789976dEcBfCbBbe364623C63652db8C0904 Uniswap v3 deployments
Permit2 0x000000000022D473030F116dDEE9F6B43aC78BA3 same
QuoterV2 0x33e885eD0Ec9bF04EcfB19341582aADCb4c8A9E7 same
USDG 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168 Token contracts
NVDA, AAPL, SPY RHJ /prices/{symbol} Stock Token APIs

On-chain AMM liquidity for Stock Tokens can be thin. Official venues also include RFQ, Rialto, and Lighter (building guide).

References

Contact

Telegram: kinexbtdev

rh-swap (kinexbtdev/rh-swap)

Searching Database…

这是什么?一个极简 Web 应用,用于通过 Uniswap 在 Robinhood Chain 上,对 Robinhood 发行的股票代币(NVDA、AAPL、SPY)与 USDG 之间的兑换进行报价和规划,链 ID 被硬编码为 4663。
这是一个真实运行的交易所,还是只是开发者工具?它是一个面向开发者的兑换界面,不是托管交易所:它负责生成报价和授权计划,而交易由你自己连接的钱包在浏览器中签名。
怎么运行它?克隆仓库并运行 Vite 开发服务器(先 npm install,再 npm run dev);可选设置 VITE_UNISWAP_API_KEY,以便使用托管的 Uniswap Trading API 获取报价。
获取报价需要 Uniswap API 密钥吗?不需要——没有 API 密钥时,应用会退而通过 Uniswap 的 QuoterV2 合约在链上获取报价,而不是使用托管的 Trading API。
兑换的主要限制和风险是什么?滑点被硬性限制在 300 个基点,报价时限为 30 分钟,而且这些股票代币的链上流动性可能很薄。
这个应用会碰我的私钥吗?不会——它从不存储私钥;交易由你连接的钱包直接在浏览器中签名。
可以兑换哪些代币?可以在 Robinhood 发行的股票代币(NVDA、AAPL、SPY)与 USDG 之间兑换,全部限定在 Robinhood Chain 的链 ID 4663 上。
为什么链 ID 被硬编码为 4663?因为该应用只面向 Robinhood Chain,卖出和买入代币的链 ID 都必须等于 4663——它不会在任何其他网络上报价或兑换。
这些股票代币和真实的 NVDA/AAPL/SPY 股票一样吗?不一样——按照项目引用的 Stock Token 文档,它们是 Robinhood 发行的 ERC-20 代币,不是经 DTCC 结算的股票。
这里的 Permit2 是做什么用的?授权计划通过 Permit2(或 Universal Router/SwapRouter02)进行,而不是让任意合约动用你的代币,以此限制授权范围。
Creator
kinexbtdev
Size
<0.1 MB
Stars
148
Updated
CommitAug 31
Age
1mo
Commits · 90 Days