Build on LitVMSwap
LitVMSwap is the DEX on LitVM. Swaps, pools, a token launchpad, and a router that finds the best path across all of it. These docs show you how to plug into it, from a single HTTP call to talking to the pools directly.
What's under the hood
Here's the short version, so the rest of the docs make sense:
- V2 pools. Classic constant-product pairs. Full range liquidity, LP tokens, the usual
x * y = k. - V3 pools. Concentrated liquidity. LPs pick a price range and get an NFT for their position.
- The aggregator. One entrypoint contract that takes a swap, routes it through whichever V2 or V3 pools give the best price, and checks the user gets at least the minimum they agreed to.
- The launchpad. New tokens start on a bonding curve and graduate into a normal pool once the curve fills. After that they're just regular ERC-20s that trade like anything else.
The V2 and V3 contracts speak the standard Uniswap V2 and V3 interfaces, so the ABIs and math you already know work here too.
Pick how deep you want to go
| I want to... | Use this | Effort |
|---|---|---|
| Put a swap box on my site, no code | Swap widget | 2 minutes |
| Let my app or bot swap at the best price | Swap API | An afternoon |
| Show token names and logos | Token List API | Minutes |
| Swap or LP against one specific pool | V2 or V3 | A day |
| Count swaps, run a quest, build analytics | Events and indexing | Depends on your stack |
Quickstart
Quote and execute a real swap with viem, start to finish.
Contract addressesEvery public contract, plus the init code hashes for computing pool addresses.
Good to know before you start
- Chain id is
4441. The gas token is zkLTC. Full details on Network setup. - Native vs wrapped. Pools hold wzkLTC (wrapped zkLTC). The APIs use the placeholder address
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeEwhen they mean native zkLTC. - API amounts are human numbers. Send
"1.5", not"1500000000000000000". On chain everything is in base units as usual. - No API keys. The HTTP APIs are open and CORS is on, so you can call them straight from a browser.
- Be kind to the APIs. There's no published rate limit, so please cache what you can (the token list changes rarely) and don't poll quotes faster than your UI needs.
- Decimals vary. Always read
decimals()from the token. Don't assume 6 for anything that looks like a dollar token.
Stuck?
Say hi in the builders Telegram. Tell us what you're building and paste the request or transaction hash that's giving you trouble.