Skip to content

Feat/OPDATA-6934 nobi ea#5020

Open
mmcallister-cll wants to merge 7 commits into
mainfrom
feat/OPDATA-6934-nobi-ea
Open

Feat/OPDATA-6934 nobi ea#5020
mmcallister-cll wants to merge 7 commits into
mainfrom
feat/OPDATA-6934-nobi-ea

Conversation

@mmcallister-cll
Copy link
Copy Markdown
Contributor

@mmcallister-cll mmcallister-cll commented Jun 2, 2026

Closes #OPDATA-6934

Description

Adds Nobi state price EA

Changes

  • Added standard plumbing & WsTransport implementation
  • Interesting part: NobiTransportManager in src/endpoint/transportManager that controls request routing based on a max number of WS subscriptions per connection and max number of connections per key (see ticket for details)

Steps to Test

  1. yarn test nobi
  2. with payloads
{
    "data": {
        "endpoint": "price",
        "base": "BTC",
        "quote": "USD"
    }
}

Set MAX_SUBSCRIPTIONS_PER_TRANSPORT sufficiently low (eg: 2) and request other common crypto pairs (eg: ETH/USD, SOL/USD) to see transport rollover

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.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

🦋 Changeset detected

Latest commit: dc1a2c5

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

This PR includes changesets to release 1 package
Name Type
@chainlink/nobi-adapter Major

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

Comment on lines +5 to +6
- `MAX_TRANSPORTS`: The maximum number of WebSocket transports to manage. Default is 10.
- `MAX_SUBSCRIPTIONS_PER_TRANSPORT`: The maximum number of currency pairs to route through a single transport before routing to the next one. Default is 100.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are these not in packages/sources/nobi/src/config/index.ts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think they could be, but then we'd have to lazy load the transport manager as a singleton

Copy link
Copy Markdown
Collaborator

@alejoberardino alejoberardino left a comment

Choose a reason for hiding this comment

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

PR with suggested approach: #5021

},
},
builders: {
// Nobi's WS API requires sending the full list of pairs to subscribe, keep track of activePairs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should use this

requestCount: number
}

export class NobiTransportManager {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I get why but it's way too much imo, I don't believe having this be configurable is a good thing. I'd still loop and make 10 transports (the documented max connections) and have max subs as a proper config (which you could since the only place we'd need it is in the customRouter I think)

If we do see this as a repeated pattern (haven't so far afaik) and want to build some more complex abstracted logic we should put this in the fw

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.

3 participants