Embed liquidity walls
The lp.xyz widget puts a Sell wall, Buy wall and Provide block on your own site, in your own style. Your users sign with their own wallet. lp.xyz builds the transactions, and its fee is inside them, shown before anyone signs.
Get set up
- 1. Partner access
- Get API access set up with the team, as on the Partner API page.
- 2. Publishable key
- Ask for a publishable key. It starts with
lpx_pub_and is the only kind of key that belongs in a browser. - 3. Allowed origins
- List every origin that will embed the block (https://app.example.com, plus your preview and staging origins). Calls from any other origin are refused.
- 4. Install and embed
- Add the widget and the SDK to your app (the team sends you both packages while they are in private preview), pass your wallet as a signer, and theme it by overriding our design tokens.
Publishable keys only in browsers
A publishable key travels in the same X-API-Key header as a server key, but it is only admitted from your allowed origins and can only read, quote, build and confirm. Never put an lpx_live_ server key in front-end code.
Install
The widget and the SDK are in private preview. They are not on the public npm registry yet, so the install line below does not work on its own today: the lp.xyz team provides both packages on request, together with your key. Once they are published, this is the line.
pnpm add @lpxyz/widget @lp-xyz/sdk react react-dom # and the wallet library you already use: @solana/web3.js, or viem / ethers
The stylesheet is small and scoped to the block, and needs no CSS framework on your side.
import { Connection } from "@solana/web3.js";
import { useWallet } from "@solana/wallet-adapter-react";
import { createLpxyzClient } from "@lp-xyz/sdk";
import { createSolanaWalletSigner } from "@lp-xyz/sdk/solana";
import { LpxyzWall } from "@lpxyz/widget";
import "@lpxyz/widget/styles.css";
const client = createLpxyzClient({ apiKey: "lpx_pub_…" });
const connection = new Connection("<your Solana RPC URL>", "confirmed");
// Inside a component, under wallet-adapter's WalletProvider:
const { publicKey, signTransaction, signAllTransactions } = useWallet();
// Pass signAllTransactions when the wallet has it: a wide wall is then one prompt.
const signer = publicKey && signTransaction
? createSolanaWalletSigner({ connection, wallet: { publicKey, signTransaction, ...(signAllTransactions ? { signAllTransactions } : {}) } })
: null;
<LpxyzWall client={client} chain="solana" pool="<DLMM pool address>" signer={signer} defaultSide="ask" />On EVM, build the signer with createViemSigner from @lp-xyz/sdk/viem, which returns it directly, or with createEthersSigner from @lp-xyz/sdk/ethers, which returns a Promise: await it and pass the result. With no wallet connected, pass null: the block shows a Select a wallet button when you give it onConnectWallet.
Make it look like your site
The block is lp.xyz's own provide block: the same tiles, fields, distribution, range presets, chart and button users see in the app. You re-skin it by overriding our design tokens on the block's root, plus a font and a corner radius. With no theme it looks exactly like the app, and appearance="light" is the app's light theme. The chart and the popovers read the same tokens, so they follow too.
<LpxyzWall
appearance="light"
theme={{
background: "#ffffff", card: "#ffffff",
border: "#e2e8f0", primary: "#4f46e5",
primaryForeground: "#ffffff",
accentBlue: "#4f46e5",
font: '"Inter", system-ui, sans-serif',
radius: "12px",
}}
{...props}
/>The keys are the token names (background, foreground, card, border, primary, success, danger and the rest), so you can also set the same CSS variables (--primary, --card, …) on .lpx-root in your own stylesheet. The shipped stylesheet is already compiled and scoped to the block, so your site needs no Tailwind and nothing leaks into your page.
Prefer your own components? The same logic ships headless as useLpxyzWall in @lpxyz/widget/headless.
How a wall is placed
- The block reads the pool's own price first (the active bin, or the pool's tick price). Until it loads, nothing can be submitted, and if it fails the block offers a retry. It never substitutes a market price.
- A sell wall sits above the pool price and a buy wall below it. The range is entered as distances from that price, so the wrong side can't be picked.
- Just before building, the block reads the pool again, so the wall is placed against the price at signing time.
- Progress shows under the button: building, each signature, confirming. The result (an error, or success with an explorer link) appears in the same place.
- If the pool needs a safety review, the block shows the reasons and asks the user to acknowledge them before it builds.
- A wide Meteora wall goes out in parts. If a run stops part way, the block keeps each part's outcome. While a part's outcome is unknown nothing can be sent, and the block keeps reading the chain for it. Once every part is settled, Finish the wall deposits only the bins that never landed, so nothing is deposited twice.
- If you keep the block mounted but hidden, behind a tab for instance, pass paused. It holds the background price refresh without touching a deposit in flight.
The fee
A deposit built through the widget pays the lp.xyz liquidity fee of 0.25%, taken from the deposit's native leg (SOL, ETH or BNB), or its stable leg when the pool has no native side. A token/token pool pays nothing, and so does a wall that deposits none of the fee leg, such as a sell wall of a token paired with SOL. On Arc, where the native coin is USDC, a pair that holds it pays nothing. The fee settles inside the same transaction as the deposit. The block shows the rate and the amount before the user signs, and the build is attributed to your key. See Fees for the full schedule.
Supported pools
- Meteora DLMM (Solana)
- Walls placed as exact bins next to the pool's active bin, up to 1,400 bins. A wall wider than one transaction (about 70 bins) goes out as Helius Sender bundles, part by part, as in the app.
- Uniswap v3 (Ethereum, Base, BNB Chain, Robinhood Chain, Arc)
- Walls placed as price bounds, rounded to the pool's tick spacing.
- PancakeSwap v3 (BNB Chain)
- Walls placed as price bounds, rounded to the pool's tick spacing.
Limitations
- No automation. Walls placed from the widget are plain positions. Autoharvest, trailing and the strategy engines live in the lp.xyz app.
- Other venues (Raydium, Orca, Meteora DAMM, Uniswap v4, PancakeSwap Infinity, v2 pairs) aren't offered in the widget yet.
