@opp-app/connect
v1.2.0
Published
The OpenPerps App kit: plug a bot, launchpad, or new feature into the App's markets, liquidity, keeper, live prices, and Official Integration listing. The App is the power source. This is the wire.
Maintainers
Readme
@opp-app/connect
The OpenPerps App kit. Plug a bot, launchpad, or terminal straight into the live OpenPerps App: its shared markets, Vault liquidity, always-on keeper, and live price feed. You use the running App, you do not run a protocol.
OpenPerps App is the live permissionless perpetual futures DEX on Solana. Open a leveraged long or short on any token that has a DEX pool, with isolated margin and one balance per market. Try it at openperps.fun.
Built on Percolator and OpenPerps OSS
OpenPerps App is built on Percolator, the formally verified risk engine by Anatoly Yakovenko (Toly), with the program, SDK, and keeper from OpenPerps OSS. Percolator handles risk. OpenPerps OSS handles integration.
This package is the App layer: a high-level kit that runs on the operated App. You
use the App's markets, Vault liquidity, always-on keeper, and live price feed, so
you only need this package and @solana/web3.js. The protocol layer stays internal.
Install
npm i @opp-app/connect @solana/web3.jsRead the App (no key)
import { OpenPerps } from "@opp-app/connect";
const op = new OpenPerps(); // devnet defaults
await op.markets(); // every market the App trades, real-priced + keeper-covered
await op.integrations(); // Official Integration markets + their coverage
await op.trades(wallet); // a wallet's fills
await op.candles(mint, "5m"); // OHLCV history for the native chart
await op.health(); // solvency / keeper health
op.priceFeedUrl(mint); // ws:// realtime price feed for a token
await op.positions(connection, owner, market); // a wallet's open positionsTrade (a Keypair is the trader)
Deposit collateral once, then open or close. The stale-lock clear, Vault routing, and mark price are handled for you.
import { Connection, Keypair } from "@solana/web3.js";
import { OpenPerps } from "@opp-app/connect";
const op = new OpenPerps();
const connection = new Connection("https://api.devnet.solana.com", "confirmed");
const market = "<market account pubkey>";
await op.deposit({ connection, trader, market, amountUsd: 100 });
await op.placeOrder({ connection, trader, market, side: "long", sizeBase: 250 });
await op.positions(connection, trader.publicKey, market);
await op.closePosition({ connection, trader, market });List a market on the App (Official Integration)
You create the market and seed its Liquidity Vault (the liquidity stays yours). The App's keeper then covers it (price relay, skew funding, liquidations) and it shows in the App with your badge. Needs a partner key from the OpenPerps team.
const op = new OpenPerps({ partnerKey: process.env.OPENPERPS_PARTNER_KEY });
const { market, registration } = await op.listMarket({
connection,
payer, // signs, pays, seeds the Liquidity Vault
baseMint: "<token mint>",
seedUsd: 5000, // Vault LP (yours)
houseCapBase: 50_000_000n, // turns skew funding on
});
registration.coverage; // { priceRelay, skewFunding, liquidations, ... }Built the creation txs yourself? op.registerMarket(entry) lists an existing
on-chain market.
What the App adds
The operated layer a market needs to be live and safe around the clock:
- Create a perp on any SPL token. Paste a mint and list a market in one flow: the App resolves the live price, seeds the Liquidity Vault (or opens it to community LPs), turns funding on, and the keeper covers it from the first tick. No approval, no admin key.
- Liquidity. Liquidity Vaults are community funded through HLP, so a market's depth is not capped by one creator's seed.
- Keeper, always on. A durable cron relays live prices, prices skew funding from the Vault's net position, runs liquidations, cranks Pyth markets, and rebalances HLP vaults.
- Explorer. A shared registry, realtime price feed, candles, and trade history that every wallet sees.
Config
new OpenPerps({
api: "https://...", // App API base (default: devnet indexer)
programId: "...",
quoteMint: "...",
partnerKey: "...", // server-side only, only listing methods need it
fetch, // inject for Node < 18
});License
MIT. OpenPerps App is built on the Apache-2.0 Percolator engine and on OpenPerps OSS. See openperps.fun.
