Skip to content

Conversation

@FionnL
Copy link
Contributor

@FionnL FionnL commented Jan 8, 2026

Closes #ISSUE_NUMBER_GOES_HERE

Description

  • Add LVP_HEARTBEAT_INTERVAL config (default 30s)
  • Emit heartbeat events from NetDania StreamingClient on interval
  • Add updateTTL method to extend cache TTLs for active subscriptions
  • Track current subscriptions in transport for TTL refresh
  • Start/stop heartbeat on connect/disconnect events

This ensures cached prices remain available during off-market hours when no price updates are received from the data provider, similar to the TP/ICAP EA implementations.

Changes

Added Last Value Persistence (LVP) to the ICE adapter by implementing a configurable heartbeat interval (LVP_HEARTBEAT_INTERVAL, default 30s) that periodically extends cache TTLs for all active subscriptions, ensuring cached prices remain available during off-market hours when no price updates are received from the data provider.

Steps to Test

  1. Steps
  2. to
  3. test

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

- Add LVP_HEARTBEAT_INTERVAL config (default 30s)
- Emit heartbeat events from NetDania StreamingClient on interval
- Add updateTTL method to extend cache TTLs for active subscriptions
- Track current subscriptions in transport for TTL refresh
- Start/stop heartbeat on connect/disconnect events

This ensures cached prices remain available during off-market hours
when no price updates are received from the data provider, similar
to the TP/ICAP EA implementations.
@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

🦋 Changeset detected

Latest commit: b7381b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@chainlink/ice-adapter Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

- Add ONHEARTBEAT event to NetDania jsApi (fires when internal heartbeat succeeds)
- Modify heartBeatTask to emit ONHEARTBEAT event confirming DP connection is alive
- Update StreamingClient to listen for native heartbeat instead of using setInterval
- Remove LVP_HEARTBEAT_INTERVAL config (no longer needed)
- Update unit tests to verify event-driven heartbeat behavior

This approach is more reliable because it confirms the actual data provider
connection is healthy, rather than just running a local timer. The heartbeat
automatically stops when the connection is lost (ONDISCONNECTED).
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