Skip to content

feat: implement data reception layer with WebSocket and HTTP support#27

Merged
FabianSanchezD merged 2 commits intoNeko-Protocol:mainfrom
Jopsan-gm:feat/data-reception-layer-16
Jan 31, 2026
Merged

feat: implement data reception layer with WebSocket and HTTP support#27
FabianSanchezD merged 2 commits intoNeko-Protocol:mainfrom
Jopsan-gm:feat/data-reception-layer-16

Conversation

@Jopsan-gm
Copy link
Contributor

🚀 Neko Pull Request

Mark with an x all the checkboxes that apply (like [x])

  • Closes Data Reception Layer #16
  • Added tests (if necessary)
  • Run tests
  • Run formatting
  • Evidence attached (Add your Loom/Cap video link here)
  • Commented the code

📌 Type of Change

  • Documentation (updates to README, docs, or comments)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

📝 Changes description

Implemented the Data Reception Layer for the Aggregator service, enabling efficient communication with the Ingestor service.

Key Features:

  • WebSocket Client: Real-time connection to receive price streams.
  • Automatic Reconnection: Implementation of retry logic using Exponential Backoff (maximum 5 attempts).
  • HTTP Fallback: Methods to retrieve price snapshots and historical data via REST requests.
  • Data Validation: Used class-validator and class-transformer to ensure the integrity of incoming messages (DTOs).
  • Event-Driven Architecture: Emits internal events (price.received) using EventEmitter2 for asynchronous processing.
  • Unit Testing: Achieved >80% coverage using mocks for WebSocket and HttpService.
  • Documentation: Updated README.md and .env.example.

📸 Evidence (A Loom/Cap video is required as evidence, we WON'T merge if there's no proof)

image image

Test Execution Results:

  • Test Suites: 1 passed, 1 total
  • Tests: 14 passed, 14 total

⏰ Time spent breakdown

  • Research and Project Structure: 0.5h
  • DataReceptionService Implementation (WS/HTTP): 1.5h
  • Validation and DTOs: 0.5h
  • Unit Testing and Coverage: 1.0h
  • Documentation and Refactoring: 0.5h
  • Total: ~4.0h

🌌 Comments

The service is designed to be resilient to network failures thanks to the reconnection logic. NestJS best practices were followed, utilizing dependency injection and decorators throughout the implementation.


Thank you for contributing to Neko, you just helped us make RWAs consumer friendly on Stellar! We hope you can continue contributing to this project.

@Jopsan-gm
Copy link
Contributor Author

Hi @FabianSanchezD Could you please review my issue?

Copy link
Contributor

@FabianSanchezD FabianSanchezD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FabianSanchezD FabianSanchezD merged commit 2028f7c into Neko-Protocol:main Jan 31, 2026
1 check passed
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.

Data Reception Layer

2 participants