Docs
Build on Shardline
Plug split routing into your wallet, bot or dApp. Quotes, markets and ready-to-sign swap transactions over a keyless API.
Arc testnet
Arc is Circle's EVM-compatible layer 1. Its gas token is USDC, so fees are priced in dollars. Shardline asks your wallet to add the network automatically, or add it by hand:
- Network
- Arc Testnet
- Chain ID
- 5042002
- RPC
- https://rpc.testnet.arc.network
- Gas token
- USDC
- Explorer
- https://testnet.arcscan.app
- Faucet
- https://faucet.circle.com
Quick start
- 1
Get gas
Request testnet USDC for your wallet address at faucet.circle.com (choose Arc Testnet).
- 2
Connect
Open Trade, connect a browser wallet and accept the switch to Arc Testnet.
- 3
Mint tUSD
Press “Mint 10,000 test tUSD”. The faucet can be used once every six hours per wallet.
- 4
Approve, then swap
Approve the router once per token, enter a size and swap. The split is shown before you sign.
API
Read-only JSON over HTTPS. No key, no account, CORS open. Amounts in responses are integer strings in the token's smallest unit (tUSD has 6 decimals, instruments have 18).
/api/v1/tokensEvery address you need in one call: the router, the tUSD cash token and each instrument with its decimals and pools.
/api/v1/tokens ↗/api/v1/marketsEvery instrument with its liquidity-weighted price, total liquidity and per-venue reserves, read at the latest Arc block.
/api/v1/markets ↗/api/v1/quotePlans a split route for an order. `symbol` is the instrument, `side` is buy (pay tUSD) or sell (pay the instrument), `amount` is a decimal in the input token.
/api/v1/quote?symbol=NVDA&side=buy&amount=25000 ↗/api/v1/swapThe full integration in one call: a split route plus a ready-to-sign transaction. Returns `tx` (router address and calldata for swapSplit), `approval` (the token and amount to approve first) and `minAmountOut`, the floor the router enforces. Optional: `slippageBps` (default 50), `deadline` in seconds (default 600), `from`.
/api/v1/swap?symbol=NVDA&side=buy&amount=1000&slippageBps=50 ↗/api/v1/healthThe latest Arc block and whether the market contracts are deployed.
/api/v1/health ↗$ curl -s '<your-domain>/api/v1/quote?symbol=NVDA&side=buy&amount=25000'
{
"blockNumber": "…",
"symbol": "NVDA",
"side": "buy",
"amountIn": "25000000000",
"amountOut": "…",
"bestSingle": { "venue": "Deep", "amountOut": "…" },
"improvementBps": 12,
"legs": [
{ "venue": "Deep", "feeBps": 5, "pool": "0x…", "amountIn": "…", "amountOut": "…" },
{ "venue": "Core", "feeBps": 30, "pool": "0x…", "amountIn": "…", "amountOut": "…" }
]
}Integrate a swap in your app (viem)
import { createWalletClient, custom, erc20Abi } from "viem";
const base = "https://shardline.tech/api/v1";
const res = await fetch(`${base}/swap?symbol=NVDA&side=buy&amount=1000&slippageBps=50`);
const swap = await res.json();
const wallet = createWalletClient({ transport: custom(window.ethereum) });
const [account] = await wallet.requestAddresses();
// 1. approve the router once for the input token
await wallet.writeContract({
account, chain: null,
address: swap.approval.token, abi: erc20Abi, functionName: "approve",
args: [swap.approval.spender, BigInt(swap.approval.amount)],
});
// 2. send the split route — every leg fills in one transaction or none do
await wallet.sendTransaction({ account, chain: null, to: swap.tx.to, data: swap.tx.data });Keyless
No API key, no sign-up, CORS open. Call it from a browser, a bot or a backend.
Non-custodial
The API never touches keys or funds. It returns calldata; the user's wallet signs.
Protected
minAmountOut is baked into the calldata. If the route can't clear it, the chain reverts.
Contracts
Three small Solidity contracts, deployed to Arc testnet with Foundry.
ShardlinePool
Constant-product pool with a fixed fee and a venue label. getAmountOut is the formula the app uses.
ShardlineRouter
Pulls the input once, fans it out across legs, and enforces one minimum on the total.
TestToken
Minimal ERC-20. The tUSD instance has a public faucet with a six-hour cooldown.
# from contracts/ PRIVATE_KEY=0x… ./deploy.sh # deploys to Arc testnet and writes src/lib/deployments.ts