Repository navigation
Description
Background
const onPricePublished = (event: PricePublishedEvent) => {
app.graphql.pubsub.publish({ topic: PRICE_TOPIC, payload: { priceUpdated: event } })
}Every price goes onto one topic, PRICE_UPDATED, and each subscriber filters it
down with withFilter. Correct, and simple — but the filter runs per subscriber
per event. With a thousand subscribers each watching one pair, a single price
update runs a thousand filter callbacks, nine hundred and ninety-nine of which
discard it.
At the current scale this is invisible. It is also the kind of thing that is
cheap to fix now and a rewrite once there is traffic.
What to build
- Publish to a topic keyed by pair and network, so the pubsub layer does the
routing and a subscriber is only woken for its own pair. - Keep the current behaviour for a subscription with no network argument, which
deliberately receives every network — the existing test covers this and must
keep passing. - A metric of active subscriptions by pair, so the distribution is visible.
- Measure before and after with a representative number of subscribers, and put
the numbers in the PR. A performance change without a measurement is a guess.
Acceptance criteria
- A subscriber is only woken for events matching its subscription
- All five existing subscription tests still pass unchanged
- A network-less subscription still receives every network
- Active subscriptions are exported as a metric
- The PR contains a before-and-after measurement
Drips Wave · Complexity: Intermediate · 150 points
Repo: Divinity-Labs/Lens. Node + TypeScript, Fastify, mercurius for
GraphQL at POST /graphql, Prisma on Postgres, Redis, Prometheus.
Run the tests: npm test. The tests are vitest, not jest. Running jest
here reports "66 suites, 0 tests" and means nothing. A single file is
npx vitest run src/__tests__/graphqlSubscription.test.ts.
Load test (prices) is already failing on main and has been for some
time. It is not your PR. Everything else should be green.
Read src/__tests__/graphqlSubscription.test.ts before you start. It is the
house pattern for testing this surface and it is good — it drives a real
subscription through a real server and asserts on what a client receives.
This service prices real assets on Stellar mainnet. A wrong number is worse
than a missing one, because the caller cannot tell.
Never elide an address, a contract id or a key in code, comments or test
fixtures. A previous batch shortened a contract id in an issue and five
contributors invented plausible-looking ids to fill the gap. Write it in full or
not at all.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
Activity
Muyideen-js commentedon Oct 16, 2026
@Muyideen-js has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Muyideen-js to this issue.
nonchalanttee22-lgtm commentedon Oct 16, 2026
@nonchalanttee22-lgtm has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @nonchalanttee22-lgtm to this issue.
drips-wave commentedon Oct 16, 2026
Congratulations, @nonchalanttee22-lgtm! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.
🧑💻 @nonchalanttee22-lgtm: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
drips-wave commentedon Oct 25, 2026
This issue has been completed by @nonchalanttee22-lgtm as part of the Stellar Wave Program's 10th Wave 🥳
😎 @nonchalanttee22-lgtm: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.