Quick Start
Environment Setup
Environment
Value
Chain ID
Description
Reading Market Data
import { GrvtEnv, GrvtRawClient } from "@wezzcoetzee/grvt";
const client = new GrvtRawClient({
env: GrvtEnv.TESTNET,
});
// Get all active instruments
const instruments = await client.getAllInstruments({ is_active: true });
console.log("Instruments:", instruments.result.map((i) => i.instrument));
// Get ticker for a specific instrument
const ticker = await client.getTicker({ instrument: "BTC_USDT_Perp" });
console.log("Last price:", ticker.result.last_price);
console.log("Mark price:", ticker.result.mark_price);
// Get orderbook
const orderbook = await client.getOrderbookLevels({
instrument: "BTC_USDT_Perp",
depth: 10,
});
console.log("Best bid:", orderbook.result.bids[0]);
console.log("Best ask:", orderbook.result.asks[0]);Placing Orders
WebSocket Subscriptions
Complete Example
Next Steps
Last updated