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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@pioneer-platform/e2e-endpoint-charts

v1.0.2

Published

Advanced charts endpoint performance testing

Readme

Charts Endpoint Testing

Performance and integration tests for Pioneer Server charts endpoints.

Current Status: ⚠️ API MISMATCH DISCOVERED

Issue Found

The /api/v1/charts/portfolio endpoint has a different API structure than expected:

Current API (Single network/address):

{
  "networkId": "eip155:1",
  "address": "0x141D9959cAe3853b035000490C03991eB70Fc4aC"
}

Expected API (Multi-chain like portfolio endpoint):

{
  "pubkeys": [
    { "pubkey": "0x141D9959cAe3853b035000490C03991eB70Fc4aC", "caip": "eip155:1/slip44:60" },
    { "pubkey": "cosmos1...", "caip": "cosmos:cosmoshub-4/slip44:118" }
  ]
}

What the SDK Does

The Pioneer SDK's app.getCharts() method:

  1. Processes multiple blockchains automatically
  2. Takes 30+ seconds to complete
  3. Likely calls /charts/portfolio once per chain

Performance Problem

The slowness is caused by:

  • Sequential API calls: One request per blockchain chain instead of batch
  • No batching: Each chain requires a separate HTTP request
  • No caching coordination: Multiple chains can't share cache hits

Available Endpoints

Based on Swagger spec analysis:

/charts/portfolio       - Single network portfolio (networkId + address)
/charts/customtokens    - Custom token charts
/charts/stablecoins     - Stablecoin-specific charts

Recommendations

Option 1: Create Batch Endpoint

Add /charts/portfolio/batch endpoint accepting multiple pubkeys:

{
  "pubkeys": [
    { "pubkey": "0x...", "caip": "eip155:1/slip44:60" },
    { "pubkey": "cosmos1...", "caip": "cosmos:cosmoshub-4/slip44:118" }
  ]
}

Benefits:

  • Matches portfolio endpoint pattern
  • Single HTTP round-trip
  • Better cache coordination
  • Parallel backend processing

Option 2: SDK Optimization

Update SDK to:

  • Call charts endpoints in parallel (Promise.all)
  • Cache results locally
  • Use HTTP/2 multiplexing

Option 3: GraphQL/Streaming

Consider GraphQL or Server-Sent Events for:

  • Subscription-based updates
  • Progressive rendering
  • Real-time balance updates

Test Structure

The test suite is ready but needs the correct endpoint:

cd /Users/highlander/WebstormProjects/keepkey-stack/projects/pioneer/e2e/endpoint/charts

# Install dependencies
bun install

# Run tests
bun run test

Test Features

  • ✅ Performance benchmarking (cold vs cached)
  • ✅ Multi-chain testing
  • ✅ Response structure validation
  • ✅ Bottleneck identification
  • ✅ Server log diagnostics
  • ⚠️ Waiting for correct API endpoint

Next Steps

  1. Decide on API design: Batch endpoint vs. optimization
  2. Implement chosen solution in pioneer-server
  3. Update tests to match new API
  4. Verify 10x+ performance improvement

Files

  • src/index.ts - Main test suite (currently incompatible with API)
  • package.json - Dependencies and scripts
  • tsconfig.json - TypeScript configuration
  • README.md - This file

Related

  • Portfolio tests: ../portfolio/
  • Pioneer Server: /services/pioneer-server/
  • Charts controller: /services/pioneer-server/src/controllers/charts.controller.ts