Skip to main content

Prerequisites

Before you begin, make sure you have:
  • An API key from the Nefarious Labs dashboard
  • Node.js 18+ or any HTTP client

Installation

npm install @nefarious/sdk

Quick Example

import { NefariousClient } from '@nefarious/sdk';

const client = new NefariousClient({
  apiKey: process.env.NEFARIOUS_API_KEY
});

// Get DeFi positions for a wallet
const positions = await client.positions.get({
  wallet: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
  protocols: ['marginfi', 'drift']
});

console.log(positions);

Next Steps

DeFi Positions

Learn about position tracking

API Reference

Explore all endpoints