Integrating Qian tokens
Swap Qian-launched tokens from your own contract, aggregator, bot, or frontend. Every pool is canonical Uniswap (v3 or v4) with no custom AMM code, so you can route through the Uniswap PoolManager directly; Qian's routers just package the multi-hop paths and ETH wrapping.
All contracts are verified — read the source on the explorer for any address below. Addresses are Robinhood Chain (chainId 4663) unless noted; the WETH-pair stack has identical addresses on Base and Ethereum.
ABIs
| Contract | ABI | Address |
|---|---|---|
| QianSwapRouter | JSON | 0xEE540d2496cfFDf17E29a04bcd7b6dc795C61d66 |
| QianRWARouterV3 | JSON | 0x9DBe86fd9Bd0F346d741387936c5B46ff6437763 |
| QianRWAFactory | JSON | 0x04953F4322BB1b800C438a9426cDacfCD9785860 |
| QianRWAFeeRouter | JSON | 0xc3a89be96b8BDb1123d2Fa40f18000e3FB1A7aAf |
| QianLocker (RWA stack) | JSON | 0x38ceAf1eF6528Aa5775820696A7D14e64136a22d |
| QianToken | JSON | per launch |
Also useful: Uniswap v4 PoolManager 0x8366a39cc670b4001a1121b8f6a443a643e40951, v4 Quoter 0x8dc178efb8111bb0973dd9d722ebeff267c98f94, WETH 0x0bd7d308f8e1639fab988df18a8011f41eacad73, USDG 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168 (6 decimals). The full address set per chain, including the approved quote assets, is on Contracts & security.
Two kinds of Qian token
- WETH-paired (the default launchpad): one v3 or v4 pool against WETH. Call
QianSwapRouter.buy(token, minTokensOut)(payable) /sell(token, tokensIn, minEthOut)— it detects v3 vs v4 itself. One call, no path building. Live on Robinhood Chain, Base, and Ethereum at the same address. - Quote-paired (stock launchpad, v4 only, Robinhood Chain): the token's pool is against a tokenized stock (NVDA, TSLA, …) or USDG. Reaching it from ETH takes a multi-hop through
QianRWARouterV3, which can cross Uniswap v3 and v4 pools in one call.
Trading a quote-paired token
QianRWARouterV3 takes an explicit Hop[] path and executes it in one transaction. Each hop names its venue: Uniswap v3 (a fee tier) or Uniswap v4 (a full PoolKey), so a route can leave a launch pool on v4 and cross a deep v3 stock pool on the way to USDG. Consecutive v4 hops run inside one PoolManager lock.
enum Venue { V3, V4 }
struct Hop { Venue venue; address tokenIn; address tokenOut; uint24 fee; int24 tickSpacing; address hooks; }
function buy(Hop[] path, address token, uint256 minTokensOut, uint256 deadline) payable returns (uint256);
function sell(Hop[] path, address token, uint256 tokensIn, uint256 minEthOut, uint256 deadline) returns (uint256);buystarts from ETH (msg.value) and the path must start at WETH and end attoken;selltakestoken(approve the router first) and the path must end at WETH. There is no ERC20-in/ERC20-out call: every trade starts or ends in ETH.- The router's fee is always on the ETH side — off
msg.valueon a buy, off the WETH out on a sell. The exactFEE_BPSconstant is in the verified source.sellhandles fee-on-transfer inputs. minOutapplies to the final amount only; intermediate hops carry no floor.deadlineis your staleness guard. The router is stateless and holds nothing between calls; the pools are canonical.- Every hop's
tokenInmust equal the previous hop'stokenOut(the first equals the input asset), or the call revertsInvalidConfig(). A v3 hop that a pool can only fill partially revertsInsufficientOutput()rather than stranding the remainder.
Building the path
A buy path runs WETH → USDG → quote → token; a sell path is the same hops reversed (order flipped, tokenIn/tokenOut swapped). A token paired to USDG drops the quote hop.
- WETH/USDG and quote/USDG hops: liquidity is split across many pools and venues, and the deepest one changes. Read them from
GET https://api.qian.ag/rwa/tiers:tiers[<asset>]is{ venue: "v3" | "v4", fee, tickSpacing }for the pool that fills a $10k round trip best; build the hop withhooks = address(0)and, for v3,tickSpacing = 0. (v4[<asset>]is the best v4-only pool, for the launch factory's dev-buy prefix, which is v4-only.) - Final hop (the launch pool): always v4. Use the token's exact PoolKey from the API below — unlike the intermediate hops it carries a non-zero
hooksaddress (the launchpad's guard hook) and the fee tier the creator chose at launch. The guard hook only restricts pool initialization, not swaps — a token whose PoolKey ends in a hook address is not a honeypot. - The API also serves each quote-paired token's complete buy route as
buy_path(an array of hops in the shape above, with venue as the string"v3"/"v4"); encodevenueas0/1for the router.
Quote each hop before sending — v4 hops through the v4 Quoter (quoteExactInputSingle with the PoolKey), v3 hops through QuoterV2 0x33e885ed0ec9bf04ecfb19341582aadcb4c8a9e7 (quoteExactInputSingle with tokenIn/tokenOut/fee) — via eth_call. Both quoters revert to return their result by design, so a simulateContract/static-simulation wrapper that treats reverts as failures will report "no liquidity" on every pool.
Getting a token's PoolKey and pair
GET https://api.qian.ag/tokens/robinhood/<address> — no API key needed. The response wraps everything in a token object, and pool_key is a tuple array [currency0, currency1, fee, tickSpacing, hooks] (already sorted), not an object:
{
"asOf": { "block": 14386380, "status": "running" },
"token": {
"address": "0x8a816cb55c8f48f5589b8622043b61447c5d4e37",
"symbol": "JENSEN",
"pool_kind": "v4",
"pool_key": ["0x8a816CB55c8f48f5589b8622043b61447C5D4e37",
"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
15000, 60, "0x2725462a10d14D863CE9A2Ec5d95895d7D65A000"],
"quote": "0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec",
"quote_symbol": "NVDA",
"quote_decimals": 18
}
}quote: null means WETH-paired. The endpoint only serves launchpad tokens — the tokenized stocks themselves 404 there; their pool parameters are in the tier table above.
Creator fees
QianRWAFeeRouter.collectFees(token) is permissionless and pays the creator's share to locker.creatorOf(token) in the pool's two assets. If a transfer fails (an issuer blocklist, for example), the amount defers to owed(receiver, asset) and claimOwed releases it later. WETH-paired tokens claim through the main QianFeeRouter the same way.
Launching via the factory
QianRWAFactory.deployCoin launches a 1B-supply token with the full supply as locked one-sided liquidity against your chosen quote. msg.value must cover deployFee(); anything above it executes a same-transaction dev buy along devBuyPath (your WETH→quote hops — the factory appends the new pool itself) with devBuyMinOut as the floor. Liquidity tiers are configId 0–3. The token has no owner, no mint, no pause, no blocklist, and the LP position stays locked forever.
Agents
AI agents can do all of the above through the MCP server: npx -y @qianexchange/mcp.
