@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:
- Processes multiple blockchains automatically
- Takes 30+ seconds to complete
- Likely calls
/charts/portfolioonce 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 chartsRecommendations
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 testTest Features
- ✅ Performance benchmarking (cold vs cached)
- ✅ Multi-chain testing
- ✅ Response structure validation
- ✅ Bottleneck identification
- ✅ Server log diagnostics
- ⚠️ Waiting for correct API endpoint
Next Steps
- Decide on API design: Batch endpoint vs. optimization
- Implement chosen solution in pioneer-server
- Update tests to match new API
- Verify 10x+ performance improvement
Files
src/index.ts- Main test suite (currently incompatible with API)package.json- Dependencies and scriptstsconfig.json- TypeScript configurationREADME.md- This file
Related
- Portfolio tests:
../portfolio/ - Pioneer Server:
/services/pioneer-server/ - Charts controller:
/services/pioneer-server/src/controllers/charts.controller.ts
