npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@builderz/maiker-analytics-sdk

v0.1.3

Published

TypeScript API client for Maiker Analytics

Readme

Maiker Analytics SDK

The Maiker Analytics SDK provides TypeScript clients for accessing Maiker Analytics data through multiple interfaces:

  • HTTP API Client: Access analytics via REST API endpoints (recommended for client-side applications)
  • Direct Database Client: Direct PostgreSQL access for server-side applications
  • Strategy Client: On-chain Solana strategy data access

Installation

npm install @builderz/maiker-analytics-sdk
# or
yarn add @builderz/maiker-analytics-sdk

HTTP API Client (Recommended)

The HTTP API client provides a clean interface to the Maiker Analytics API:

import { MaikerAnalyticsApiClient } from '@builderz/maiker-analytics-sdk';

// Initialize client
const client = new MaikerAnalyticsApiClient({
  baseUrl: 'https://api.maiker.fun', // Optional, defaults to production
  timeout: 30000, // Optional, defaults to 30 seconds
});

// Get all token pairs with statistics (includes volume, fees, TVL data)
const tokenMaps = await client.getPairTokenMaps();

// Get timeseries data (v2 endpoint optimized for charting)
const timeseries = await client.getLbPairTimeseries(
  ['lb_pair_1', 'lb_pair_2'],
  {
    start_timestamp: Math.floor(Date.now() / 1000) - 24 * 60 * 60, // Last 24 hours
  },
  '1h' // Hourly granularity
);

// Fee concentration analysis
const feeData = await client.getFeeConcentration('lb_pair_address');

// Position analytics
const positionPnL = await client.getPositionPnL('position_id');
const positionTimeseries = await client.getPositionTimeseries('position_id');
const userPositions = await client.getUserPositions('owner_address');

// Session analytics (all positions for owner/lb_pair)
const sessionPnL = await client.getSessionPnL('owner_address', 'lb_pair_address');
const sessionTimeseries = await client.getSessionTimeseries('owner_address', 'lb_pair_address');

Available Endpoints

Pairs API

  • getPairTokenMaps(): Get all token pairs with LB pairs and statistics (volume, fees, TVL across multiple timeframes)
  • getLbPairTimeseries(lbPairs, timeRange?, granularity?): Get timeseries data optimized for charting

Analysis API

  • getFeeConcentration(lbPair, startTimestamp?): Get fee concentration analysis

Position Analytics API

  • getPositionPnL(positionId, timeRange?): Get single position PnL analysis
  • getPositionTimeseries(positionId, timeRange?): Get single position timeseries data
  • getUserPositions(owner): Get positions for a specific owner
  • getSessionPnL(owner, lbPair, timeRange?): Get session PnL for all positions of owner/lb_pair
  • getSessionTimeseries(owner, lbPair, timeRange?): Get session timeseries for all positions

Direct Database Client

For server-side applications with direct database access:

import { AnalyticsClient } from '@builderz/maiker-analytics-sdk';

const client = new AnalyticsClient({
  connectionString: 'postgresql://user:pass@host:port/db',
  ssl: true,
});

// Use the various analytics modules
const positionAnalytics = await client.positions.getAnalytics('position_id');
const pairAnalytics = await client.pairs.getAnalytics('lb_pair');

Types

All TypeScript types are exported for use in your applications:

import {
  TokenPair,
  LBPair,
  TimeseriesDataPoint,
  PositionPnLResult,
  PositionTimeseriesResult,
  TokenMapsResponse,
  TimeRange,
  TimeGranularity,
} from '@builderz/maiker-analytics-sdk';

Environment Configuration

The HTTP API client automatically detects environment:

// For local development
process.env.NEXT_PUBLIC_LOCAL_API = 'true'; // Uses http://localhost:3000

// For production (default)
// Uses https://api.maiker.fun

Error Handling

All clients include comprehensive error handling:

try {
  const data = await client.getPairTokenMaps();
} catch (error) {
  console.error('API Error:', error.message);
  // Handle error appropriately
}

API Reference

Time Ranges

interface TimeRange {
  start_timestamp?: number; // Unix timestamp in seconds
  end_timestamp?: number;   // Unix timestamp in seconds
}

Time Granularities

  • TimeGranularity: '15m' | '1h' | '4h' | '12h' | '24h'

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request