Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupiter Funding Rates Data Streams #40

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

athon-millane
Copy link

@athon-millane athon-millane commented Jan 23, 2025

Jupiter Perpetuals Borrow Rates Data Stream

Overview

Implements data streaming functionality for Jupiter Perpetuals borrow rates by fetching and transforming pool information.

Changes

  • Added getBorrowRates function that accepts an asset parameter
  • Created PerpsApiService for handling Jupiter Perps API interactions:
    • getPoolInfo: Fetches raw pool data
    • transformToMarketData: Converts pool info to market data format
  • Defined types for API responses and market data structures
  • Added test suite covering:
    • Successful rate fetching
    • Invalid asset handling
    • API error handling
    • Data transformation error handling

Testing

  • Unit tests verify both success and failure paths
  • Mocked API responses for consistent testing
  • Verified error handling for invalid inputs

- Add getBorrowRates function to fetch pool info and transform to market data
- Create PerpsApiService with getPoolInfo and transformToMarketData methods
- Add type definitions for PoolInfo and PerpsMarketData
- Implement test coverage for success and error scenarios
- Add input validation for supported assets

Technical details:
- Fetches pool info from perps-api.jup.ag/v1/pool-info endpoint
- Transforms pool info into standardized market data format
- Includes proper error handling for API and transformation failures
- Validates asset input against TOKEN_MINTS
- Add getBorrowRates function to fetch pool info and transform to market data
- Create PerpsApiService with getPoolInfo and transformToMarketData methods
- Add type definitions for PoolInfo and PerpsMarketData
- Implement test coverage for success and error scenarios
- Add input validation for supported assets

Technical details:
- Fetches pool info from perps-api.jup.ag/v1/pool-info endpoint
- Transforms pool info into standardized market data format
- Includes proper error handling for API and transformation failures
- Validates asset input against TOKEN_MINTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant