jupiter_perps_positions
Get open perpetual positions for a wallet, including leverage, entry price, PnL, and liquidation price.
Instructions
Get open perpetual positions for a wallet — leverage, entry price, PnL, liquidation price.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | Wallet address |
Implementation Reference
- src/tools/perps.ts:22-26 (handler)Handler function for jupiter_perps_positions — calls client.perpsPositions with the wallet argument and returns JSON result.
async (args) => { const result = await client.perpsPositions(args.wallet); return JSON.stringify(result, null, 2); }, ); - src/tools/perps.ts:5-27 (registration)registerPerpsTools function registers jupiter_perps_positions (and jupiter_perps_markets) via the ToolRegistrar callback, wiring schema and handler.
export function registerPerpsTools(register: ToolRegistrar, client: JupiterClient) { register( "jupiter_perps_markets", "List Jupiter perpetual futures markets — trading pairs, funding rates, open interest.", {}, async () => { const result = await client.perpsMarkets(); return JSON.stringify(result, null, 2); }, ); register( "jupiter_perps_positions", "Get open perpetual positions for a wallet — leverage, entry price, PnL, liquidation price.", { wallet: z.string().describe("Wallet address"), }, async (args) => { const result = await client.perpsPositions(args.wallet); return JSON.stringify(result, null, 2); }, ); } - src/tools/perps.ts:19-21 (schema)Input schema for jupiter_perps_positions — requires a 'wallet' string parameter describing the wallet address.
{ wallet: z.string().describe("Wallet address"), }, - src/client.ts:224-228 (helper)Client helper method perpsPositions — makes a GET request to /perps/v1/positions with wallet as query parameter.
async perpsPositions(wallet: string) { return this.request("/perps/v1/positions", { params: { wallet }, }); } - src/index.ts:68-69 (registration)Top-level registration call that wires registerPerpsTools into the MCP server.
registerPerpsTools(register, client); registerPortfolioTools(register, client);