-
Notifications
You must be signed in to change notification settings - Fork 0
[server] fetch funding rate from testnet #5
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
Conversation
- Add modular service architecture with separate concerns:
- FundingDataProcessorService: handles database operations
- FundingDataStorageService: handles S3 storage operations
- Create network-specific job classes:
- BaseFundingRatesJob: abstract base class
- MainnetFundingRatesJob: mainnet-specific implementation
- TestnetFundingRatesJob: testnet-specific implementation
- Update TasksController to accept network parameter via request body
- Add network-aware S3 storage paths (funding-rates/{network}/raw/)
- Maintain backward compatibility with existing FundingRatesJob
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
|
Caution Review failedThe pull request is closed. WalkthroughAdds a Hyperliquid NestJS module and service with shared types; introduces a base job for funding-rate workflows; splits funding-rate jobs into mainnet and testnet with hourly schedules; adds services to process and store data; updates tasks module wiring and controller to route triggers by network. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant Controller as TasksController
participant Job as Mainnet/Testnet Job
participant Base as BaseFundingRatesJob
participant HL as HyperliquidService
participant S3 as FundingDataStorageService
participant DB as FundingDataProcessorService
Client->>Controller: POST /tasks/funding-rates { network? }
Controller->>Job: scheduledFetch()
Job->>Base: fetchAndSaveFundingData()
Base->>HL: fetchPredictedFundings()
HL-->>Base: { rawData, hlPerpData }
par Store raw
Base->>S3: saveRawData(rawData, network)
S3-->>Base: OK
and Process normalized
Base->>DB: processFundingData(hlPerpData, network)
DB-->>Base: OK
end
Base-->>Job: Done
Job-->>Controller: Done
Controller-->>Client: { message: "Triggered for <network>" }
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Free 📒 Files selected for processing (13)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary by CodeRabbit
New Features
Refactor