vybenetwork/solana-swap-api: a reference implementation for quoting and building Solana swaps
Solana Swap API & Router
At a glance
- What is it?
- The repository is a Node.js and browser demo that proxies Vybe's swap quote and build endpoints, compares Vybe, Jupiter and Titan routes, and returns unsigned base64 transactions. It is a starter kit, not a hosted service, and it assumes you have a Vybe API key.
- Who is it for?
- Adopt it if you want a working reference for the Vybe swap quote and build flow, or a starting point for a Solana swap UI that has to compare routers. Do not adopt it if you need a self-contained router: the routing, pricing and transaction construction live behind Vybe's API, and the repository is a client of that service.
- Can I use it commercially?
- Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
- Is it still maintained?
- Yes. The repository last received commits 54 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 17, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What vybenetwork/solana-swap-api actually is
The README describes the project as a reference implementation and starter kit for Solana swap UIs, wallet integrations and on-chain trading apps. It ships two halves: a Node.js backend that proxies Vybe's trading endpoints, and a single-page frontend built from src/frontend/ into public/app.js. The frontend has no framework dependency, which keeps the bundle small and makes the quote and route rendering easy to read.
The audience is narrow. You are expected to already understand SPL and Token-2022 mints, wallet signing, and the difference between a quote and a built transaction. The app never signs anything itself. It returns an unsigned base64 transaction, and the browser wallet does the signing. That boundary is the most important design decision in the repository, and it is what makes the code safe to read as a teaching example.
What it is not: a router. The routing logic runs on Vybe's side. This repository calls it, renders the result, and gives you three ways to hand the transaction to a wallet.
How the quote and build flow moves through the server
The Express server proxies several Vybe endpoints. According to the README, GET /v4/trading/swap-quote is the Jupiter and Titan quote path, POST /v4/trading/swap builds the unsigned transaction, and GET /v4/tokens/{mintAddress} returns token metadata and price fields. Wallet balance and sell-balance checks go through Vybe's wallet APIs.
The native Vybe path is different. POST /api/trading/vybe-quote resolves token prices, builds through the Vybe router, and synthesizes a full quote plus route plan in a single call. That is a server-side composition step, not a passthrough.
Timing is handled explicitly. A built transaction is reused without rebuilding while the 30-second Build & Sign window is active, with a shorter 10-second hot reuse for unchanged parameters. Quotes are cached per router, so switching between the Vybe, Jupiter and Titan tabs restores that router's last quote, route plan and timers. Get Quote and Build run on separate timers.
Route discovery is configurable for the Vybe router only. The market fetch mode can be full, trades, markets or rpc. Multiple Quotes enumerates markets and ranks up to three route options, and you can pin a specific market and protocol to skip discovery entirely. That last option is the one to reach for when you already know the venue and want the quote latency down.
Installing it and getting a first quote
Prerequisites are Node.js 20 or newer and npm 10 or newer. The README gives a five-command path from clone to running app. After npm start the server listens on port 3000 by default, and prestart runs the frontend bundle step first.
git clone https://github.com/vybenetwork/solana-swap-api.git
cd solana-swap-api
npm install
cp .env.example .env
npm startOpen http://localhost:3000. The key step is the .env file. VYBE_DATA_API_KEY is required unless VYBE_API_KEY is set, in which case the latter is used as a fallback for data endpoints. VYBE_API_KEY covers swap quote and build and may be left empty for a local Rust or proxy setup. VYBE_API_BASE defaults to https://api.vybenetwork.xyz.
# .env
VYBE_DATA_API_KEY=your_api_key_here
VYBE_API_KEY=your_api_key_hereKeys come from https://vybe.fyi/api-pricing. For wallet balances, blockhash and the browser RPC proxy, the priority order is SOLANA_RPC_URL first, then HELIUS_API_KEY, then public mainnet. Public mainnet is rate limited in practice, so set one of the other two if you plan to click around for more than a minute.
# .env, optional RPC override
SOLANA_RPC_URL=https://api.mainnet-beta.solana.comIn the UI, pick a router, set the sell and buy mints and an amount, connect a wallet or paste an address, and click Get quote. The default mode is Build & Sign, which builds and opens a confirm dialog for the wallet. Switch to Build only to copy the unsigned base64 transaction, or Paste & Sign to sign an existing one.
Where the design puts you at the mercy of the API
Every route, price and fee figure in this app comes from Vybe. If the upstream quote endpoint is slow or returns an error, the UI has nothing to fall back on except the optional Jupiter or Titan fallback that the Vybe router can use. The README does not document a retry policy, an offline mode, or a cached quote store beyond the per-router in-memory cache and the 30-second build window. Restart the server and that state is gone.
There is a debug flag, ENABLE_SWAP_QUOTE_BTN_DEBUG, that shows inline "Get quote blocked" metadata under the quote button. Its existence suggests blocked quotes are a real operational state rather than an edge case. The DISABLED_QUOTE_BRIDGE_HOP_COMBOS variable does the same for a specific failure class: setting it to damm2-damm2 skips quote-bridge routes between Meteora DAMM2 and itself across two hops. That is a targeted workaround, not a general routing control, and it tells you the router will sometimes propose a two-hop path through the same protocol twice.
The README does not document rollback, and there are no retrieved releases, so there is no versioned upgrade path to follow. You are tracking the main branch.
Jupiter and Titan are aggregator paths, not peers of the Vybe router
The three router tabs look symmetrical in the UI. They are not. Jupiter quotes through swap-quote and then immediately builds the swap. Titan uses the same aggregator flow through the Vybe proxy. Only the Vybe router gets route discovery with market fetch modes, Multiple Quotes ranking up to three options, and the ability to pin a market and protocol.
The route options panel reflects that asymmetry. Vybe can show up to three ranked market cards. Jupiter and Titan show the real route as card one, with the remaining slots filled differently. If your goal is to compare router output, the comparison is between a native router you can configure and two aggregators you cannot.
If you want a standalone aggregator integration without Vybe in the middle, Jupiter's own API is the direct alternative, and the difference is architectural: you call Jupiter yourself and own the retry, caching and fallback logic that this repository delegates to Vybe. The trade is more code against fewer intermediaries.
Maintenance, licence and what an upgrade costs
The repository is not archived, and the last push was on 2026-07-27. The package.json pins most dependencies to exact versions: @solana/web3.js at 1.98.4, axios at 1.7.9, express at 4.21.1, dotenv at 16.4.5. TypeScript is 5.6.3 and tsx is 4.19.2 in devDependencies. Exact pins make installs reproducible and make dependency upgrades a deliberate act rather than something npm does on its own. The cost is that security patches arrive only when someone edits the file.
The project is TypeScript with typecheck and build scripts, so a dependency bump is verifiable with npm run typecheck before you commit. The tools/ directory holds the catalog and benchmarking scripts, including a Jupiter benchmark against the hosted demo, which is separate from the app runtime.
The licence field in package.json says MIT. That covers the code in this repository. It does not cover the Vybe API, its data, or your use of it, which is governed by the terms at vybe.fyi/api-pricing. Read those before you ship anything commercial, and do not treat the MIT line as permission to redistribute API responses.
Editorial conclusion
Adopt it if you want a working reference for the Vybe swap quote and build flow, or a starting point for a Solana swap UI that has to compare routers. Do not adopt it if you need a self-contained router: the routing, pricing and transaction construction live behind Vybe's API, and the repository is a client of that service. Before you build on it, confirm the current Vybe key terms and rate limits, check whether the Jupiter and Titan paths carry the same fallback behaviour as the native Vybe router, and read src/server.ts for the endpoints the README does not list. The MIT licence in package.json covers the code in this repository only; it says nothing about the Vybe API itself, which is governed by vybe.fyi/api-pricing.
Frequently asked questions
How does Solana swap work in vybenetwork/solana-swap-api?
The app fetches a quote from Vybe, then builds an unsigned base64 transaction through the build endpoint. The transaction is handed to a Phantom-compatible wallet for signing, so the server never holds keys.
How can I swap to Solana with vybenetwork/solana-swap-api?
Run the app locally, set VYBE_DATA_API_KEY in .env, open http://localhost:3000, choose a router and mints, then click Get quote. Build & Sign mode opens a wallet confirm dialog from there.
Where can I swap Solana with vybenetwork/solana-swap-api?
The repository points to a hosted demo at https://solana-swap-api.vybenetwork.com, and the same app runs locally on port 3000 after npm start.
Can I swap ETH for Solana with vybenetwork/solana-swap-api?
The README scopes the project to SPL and Token-2022 tokens on Solana, with no cross-chain bridge described.
Community notes