Build on Fetch.
Contract-based liquidity routing on DogeOS. A single API is planned.
The app simulates a quoter contract over RPC, presents a route, and asks the wallet to submit the router transaction. DogeOS SDK handles wallet connection and embedded login.
Available on testnet
Open the swap page, choose a token pair and enter an amount to request an onchain quote. Inspect the quoted output, the minimum you receive and the signed price impact under it, and the route details, including venue names, pool links, allocation percentages and pool fees. Before the wallet opens, a review sheet repeats what you pay, what you receive at least, the route, slippage, deadline and an estimated network fee. Adjust slippage and the transaction deadline in settings. Wallet connection and signing use the DogeOS SDK.
Risk uses one language across the swap. Price impact under 1% is shown plainly; 1–3% is a caution; 3–15% adds a caution banner; 15% or more is critical, and the review sheet then leads with Go back. Tokens Fetch has not verified show specific explorer checks: unverified source, a contract under a week old, supply held by a few addresses, a reused verified symbol, or no route.
The token selector exposes DOGE, LBTC, WETH, USD1, USDC and USDT, and every one of them is also a routing hub. Each listed asset carries a verified badge bound to its chain and exact address: DOGE as the native currency (no ERC-20 contract address), and LBTC, WETH, USD1, USDC and USDT as the contracts the official DogeOS testnet faucet sends, checked onchain on 10 October 2026. Look-alike tokens reuse these symbols, so imports that do so show a warning naming the verified address. DogeOS also predeploys an ERC-20 interface to native DOGE at 0x5300…d09e; the router reports it through its DOGE() getter and routes native DOGE through it, so Fetch lists it once, as DOGE.
Importing an address reads its name, symbol and decimals, then requires identity review and acknowledgment before selection. These metadata reads do not verify the issuer or safety. Imports are saved for this network in the current browser; removing an import does not affect wallet holdings. A listed or imported token does not guarantee a liquid route.
Your first testnet quote.
This example runs inside this repository using its existing Viem client, configuration, ABI and quote helper. It is not an installable Fetch SDK or a public REST endpoint. Call firstTestnetQuote() from your integration code; a wallet is not needed.
Run the read-only example
From an authorized checkout of this private repository, install the locked dependencies, then run the dedicated verification. This uses testnet RPC only: it does not connect a wallet, sign a message or submit a transaction.
pnpm install --frozen-lockfile pnpm exec vitest run --config examples/fetch/vitest.config.ts
The verification requests 1 DOGE → USDC, prints the current estimated output and pool allocations, and checks that each hop totals 10,000 allocation BPS. It fails if RPC is unavailable or no route exists. It is separate from the regular unit tests.
import { erc20Abi, formatUnits, parseUnits, zeroAddress } from "viem";
import { publicClient } from "@/lib/aggregator/config/chain";
import { config } from "@/lib/aggregator/config/env";
import { routerAbi } from "@/lib/aggregator/abi/router";
import { getQuote } from "@/lib/aggregator/lib/aggregator";
// Repository example, not a published SDK or REST API. Read-only: no wallet.
export async function firstTestnetQuote() {
if (!config.router || !config.quoter) throw new Error("Contracts not configured");
if (config.chainId !== 6281971) throw new Error("Use Chikyū Testnet for this example");
const usdc = "0xD19d2Ffb1c284668b7AFe72cddae1BAF3Bc03925" as const;
const doge = await publicClient.readContract({
address: config.router, abi: routerAbi, functionName: "DOGE",
});
const decimals = await publicClient.readContract({
address: usdc, abi: erc20Abi, functionName: "decimals",
});
const quote = await getQuote(publicClient,
{ router: config.router, quoter: config.quoter },
{ tokenIn: zeroAddress, tokenOut: usdc, amountIn: parseUnits("1", 18),
hubs: [doge, ...config.hubTokens], steps: 8 },
);
if (quote.kind === "none") return { status: "no-route" as const };
return { status: "quoted" as const,
estimatedUSDC: formatUnits(quote.amountOut, decimals),
hops: quote.hops,
};
}
What comes back
A quoted response includes an estimated USDC output and the actual hops. No output number is hardcoded. A no-route result means the helper received an empty route or zero output; it does not promise the pair will always be liquid. RPC errors reject the call.
The example is checked against the current TypeScript interfaces. A DOGE-to-USDC quote was observed on the live swap during the 9 October review; that observation is not a guarantee that this example or pair will succeed at another time. The repository example was independently executed against the testnet RPC during this review and returned real pool allocations. Quotes are estimates; rerun the check to inspect current liquidity.
Reading the allocation
For each hop, look up dexId in the router’s dexes() registry. shareBps / 100 is the percentage assigned to that pool within that hop. A 12.5% leg in one hop is not necessarily 12.5% of the entire multi-hop transaction. Pool fee tiers, routing allocations and proposed partner fees are different quantities.
Network & addresses
- Network
- DogeOS Chikyū Testnet
- Chain ID
- 6281971
- Native currency
- DOGE · 18 decimals on this EVM network
Addresses are defaults embedded in the inspected client. Confirm the deployment manifest and environment overrides before integrating. ERC-20 decimals are read per token. Native Dogecoin’s 8 decimals are distinct from this EVM network’s 18-decimal DOGE.
Venue labels in the client
MuchFi AMM (V2), MuchFi CLMM (V3, its old and current factories), BarkSwap (Algebra), and KingSwap (V2). The router’s registry is fixed at deployment and readable on chain through dexes(); router and quoter v2 source is verified on L2Scan and matches the deployed bytecode. Active pools and production coverage still need confirmation.
Reading a route
The client calls simulateContract for the following quoter functions. These signatures are taken from the frontend ABI, not a public REST API.
findBestRoute(tokenIn, tokenOut, amountIn, hubs, steps) returns (hops, amountOut) quoteRoute(tokenIn, amountIn, hops) returns (amountOut, hopAmounts)
Simulation is an RPC request, not a signed quote transaction. A route contains hops between assets. Each hop can contain multiple pool legs with shareBps allocations. Routing allocation shares are not partner fees.
Hop { tokenOut, legs: Leg[] }
Leg { dexId, pool, shareBps, deployer }Routes can be multi-hop and can allocate across pools within a hop. Search bounds and split rounding are defined in the quoter’s verified source; optimization guarantees are not established. An empty hop list or zero output is treated as no route by the client.
Execution
- Read the current account, chain, balance and ERC-20 allowance.
- For ERC-20 input, request approval if needed and wait for its receipt. Read allowance again; approval does not automatically submit the swap.
- Show a review sheet. Estimate gas for the exact router call with
eth_estimateGasandeth_gasPrice; if the node rejects it, report that the swap is expected to fail instead of opening the wallet. Both are read-only. - Simulate the router call with the selected route, minimum output, recipient and deadline.
- Save the request in browser activity before asking the wallet to sign. Capture its hash as soon as the wallet returns it, before receipt tracking finishes.
- Confirm only after a successful matching receipt. Keep submitted, rejected, reverted and replacement states distinct; an unresolved request blocks another submission from its originating account.
swap({ tokenIn, amountIn, hops, minAmountOut,
recipient, deadline }) returns amountOutNative DOGE input attaches amountIn as transaction value. ERC-20 input attaches zero. The client uses the zero address as the native-input sentinel. Legacy WDOGE is not listed; a route that reaches its pools includes a 1:1 conversion hop with no legs.
Observed UI defaults: 0.5% slippage, a 10-minute deadline, 8 split steps and unlimited approvals disabled. These are client defaults, not protocol limits. Approval can be a separate transaction; route execution in one transaction does not make every user flow a single transaction.
Wallet connection
Use the official DogeOS SDK quickstart. The SDK supports external wallets and embedded login through email, Google or X. Its current v4 documentation requires React 18+, Wagmi 2+ and an app-specific client ID with registered origins. This frontend is pinned to SDK 4.0.0; the official quickstart now covers 4.0.1+. Review the patch upgrade and test external and embedded wallet flows before changing the pin.
Mount WalletConnectProvider around the interactive swap experience in a client component and import its stylesheet once. The provider returns null during server rendering; keep marketing content and sharing metadata outside that boundary.
Configure your application
The deployed frontend uses its configured DogeOS client ID. A separate application needs its own SDK client ID and registered origins, and a WalletConnect project ID for that connection method. Do not assume the Fetch deployment’s credentials or origin registration authorize your app. Keep environment configuration aligned with the selected network.
Invalidate quotes when the account, network, pair, amount or relevant settings change. A wallet connection does not by itself establish a Fetch server session.
Errors & recovery
- No route
- The quoter returned zero output or no hops. Check the pair and amount; a listed token does not guarantee liquidity.
- Quote failed
- The RPC or quoter request failed. Preserve the request and retry. A previous quote is not a current executable quote.
- Wallet rejected
- A structured wallet rejection is shown as a cancelled request. Inputs are preserved. If a transaction was already submitted, check wallet activity before continuing.
- Expired
- The transaction deadline passed. Obtain a fresh quote before another attempt.
- Insufficient output
- The route did not meet the minimum output. Refresh and review the trade; do not automatically increase slippage.
- Partial fill
- The helper reports liquidity unavailable for the route. Refresh the quote.
When the outcome is unknown
A timeout or missing receipt is not proof of failure. The frontend saves a request before the wallet call and exposes the hash as soon as it is returned. Saved transaction activity is restored on reload in the same browser and origin. Receipt checks are read-only; they never resubmit the transaction. While a record is unresolved, another request from that account on the configured chain stays blocked. A hashless record can be released by the user once the account’s pending nonce still equals the nonce saved before the wallet request and a one-minute grace period has passed. Malformed records are moved to a quarantine key and block only their readable account, or every account when none is readable, until reviewed.
With a hash, use Check status or the configured explorer. Without a hash, inspect the originating wallet and enter the full hash in Transaction hash from your wallet, then choose Check transaction. Recovery checks the sender, exact request and nonce lower bound before attaching it. An unrelated or older transaction cannot resolve the record. A hashless request that was never submitted cannot be independently resolved by Fetch; checking a box or refreshing a quote does not clear that block.
Repricing can confirm the same operation after its matching receipt. A cancellation or different replacement is shown separately and does not mean the original swap succeeded. Replacement discovery depends on the RPC and the original transaction remaining available. Fetch does not submit cancel or speed-up transactions.
Browser activity and its limits
Web Locks coordinate wallet requests across tabs for the same account and chain. Unsupported coordination or unreadable storage stops signing. Completed records remain for seven days and can be cleared with confirmation; unresolved records have no time expiry and are preserved by Clear completed activity.
Activity is local to this browser, device and site origin. It includes the account, chain, operation, timestamps, hash when available, request digest and nonce lower bound; it does not store swap amounts, token selections, wallet credentials or private keys. Clearing site data externally removes these records and their duplicate-submission protection. It does not cancel a chain transaction. If saving fails during a request, keep the page open and copy any returned hash.
Network-switch, balance and allowance failures have retry controls. A missing balance is not treated as zero. Inputs and settings stay disabled during a transaction request. Successful approval requires a separate review and swap request. The frontend reports receipt status without decoding the exact received amount for display. Signed wallet flows remain unverified.
Roadmap
- Continuous indexing: track supported liquidity and market state.
- One API: quotes, routes and execution through a single integration.
- Partner economics: integration attribution and configurable fee sharing.
- Expanded split routing: expand split-route capabilities across supported liquidity. The current testnet client already supports pool-level split allocations within a hop.
- Cross-chain trades: extend routing and execution across networks. Supported networks and the execution architecture are not yet published.
These are planned capabilities. Public endpoints, authentication, API keys, partner fee settings and launch dates are not yet published.
Status and before production
This guide describes the frontend implementation reviewed on 11 October 2026, including token identity checks, saved transaction recovery and the review sheet. Read-only quotes, unit tests and preview layouts have been checked; signed wallet flows still need end-to-end verification. This frontend review does not verify contract source or security properties. A public Fetch API is planned, not available through this guide.
This is a current testnet guide. Public API authentication, API keys, partner fee configuration, a production SDK and mainnet coverage are not available through this guide. Repository access and the deployment manifest come from the Fetch team; a public contact for integration requests is not published yet.
Router and quoter v2 source is verified on L2Scan, and a source review on 27 October 2026 found no owner, upgrade path or fee. The final reference still needs the deployed commit, full ABIs, deployment manifests, pool registries, supported assets, tests and an audit status.
Latency, routed volume, transaction success and integrator revenue require actual telemetry. No performance or security guarantee is established by this client review.
Open testnet swap