# Scale a MadeOnSol terminal to multiple viewers

Share upstream subscriptions and snapshots across terminal viewers while budgeting connections, filters, backpressure and display rights.

Access: Pro and above internally; public display requires appropriate licensing

[Compare plans and subscribe](https://madeonsol.com/pricing#pricing)

Author: MadeOnSol

Updated: 2026-11-17

## Integration choice

Build one backend data layer that owns upstream connections and fans selected updates out to authorized viewers. Share equivalent watches, isolate distinct filters, and measure the number of upstream resources rather than assuming every browser needs a MadeOnSol socket.

## Before you start

- A working terminal integration and a backend that authenticates its own viewers.
- An agreed scope for internal use or customer-facing display.

## Implementation steps

1. Define a watch identity from chain, token, modules, filters and access scope. Keep viewer session IDs separate from this identity.
2. Create one shared watch when the first viewer requests an identity; attach later equivalent viewers to it. Release the watch only after the last viewer leaves.
3. Use the terminal helper to acknowledge the named subscription before loading the baseline. Keep price overlays distinct from snapshot modules.
4. Budget sockets, named subscriptions and address or mint caps independently. Check the discovery fields returned by the stream-token endpoint for the current account.
5. Bound outgoing queues per viewer. Coalesce superseded state updates, but do not silently discard historical events that the product promises to retain.

## Own subscriptions at the backend

A browser tab is a viewer, not necessarily an upstream subscriber. Keep a registry of shared watches and reference counts on your backend. Closing one viewer should remove only that viewer’s reference, not close a socket shared by other watches.

Across backend replicas, assign a watch to one owner or explicitly budget duplicate ownership. A deployment can temporarily overlap old and new processes; include that overlap in connection capacity. Avoid reconnect storms that evict another healthy process.

## A shared socket still has limits

One connection does not mean unlimited named subscriptions, filters or token addresses. POST /api/v1/stream/token exposes named_subscriptions.max_per_connection and the relevant token-price caps. Channel eligibility also remains plan-dependent.

The helper selects a bounded set of intelligence modules and uses push events to refresh affected modules. Snapshot-only modules still need an application freshness policy. Robinhood Chain DEX firehose opt-in is a broad tape, not a promise of server-side address filtering; account for its traffic before enabling it.

## Send each viewer only useful work

Fan out the fields and channels each viewer is authorized to see. Bound queue length and track the age of the oldest queued update. For prices, replacing an unsent obsolete state with the latest state can be appropriate. For transaction history, persist or reconcile rather than silently dropping events.

For customer-facing terminals, Business provides an embed licence for one branded product under the current terms, including required attribution. Raw-data redistribution, white-label use and multiple products require an Enterprise agreement. Technical sharing does not expand those rights.

![MadeOnSol terminal displaying a Solana token chart and recent trades in separate panels.](https://madeonsol.com/guides/terminal-overview.jpg)

Existing terminal capture: the chart and trade panel use the same token context. In your integration, equivalent viewers can share that context through a backend watch. The image illustrates the interface, not a measured connection count or capacity result.

## Reference-count shared watches (standalone JavaScript)

~~~javascript
// Local ownership demonstration. start() returns a disposable watch.
// This registry is per process; it does not create SDK methods or sockets.
function createWatchRegistry(start) {
  const watches = new Map();
  return function acquire(key) {
    let entry = watches.get(key);
    if (!entry) {
      entry = { resource: start(key), refs: 0 };
      watches.set(key, entry);
    }
    entry.refs += 1;
    let released = false;
    return {
      resource: entry.resource,
      release() {
        if (released) return;
        released = true;
        entry.refs -= 1;
        if (entry.refs === 0) {
          watches.delete(key);
          entry.resource.dispose();
        }
      },
    };
  };
}
let opened = 0, disposed = 0;
const acquire = createWatchRegistry(() => {
  opened += 1;
  return { dispose() { disposed += 1; } };
});
const key = JSON.stringify(["account-a", "solana", "token-a", ["snapshot", "risk"]]);
const first = acquire(key), second = acquire(key);
first.release();
console.log({ opened, disposed }); // { opened: 1, disposed: 0 }
second.release();
console.log({ opened, disposed }); // { opened: 1, disposed: 1 }
~~~

## Common mistakes and fixes

- One viewer closes the shared stream. Fix: Dispose that viewer’s watch reference; close the upstream only when its owner has no remaining consumers.

- Treat every price tick as a signal to fetch every module. Fix: Use the helper’s module-specific refresh policy and a separate price overlay.

- Assume one socket supports unlimited tokens. Fix: Budget named subscriptions, address caps and socket limits separately.

## Verify your integration

Open the same watch from multiple viewers, disconnect one, and confirm the others keep receiving updates. Open a different chain or module set and confirm it is isolated. Simulate a slow viewer and verify its queue cannot exhaust the backend or block other viewers.

## Production checklist

- Equivalent watches share upstream work.
- Distinct permissions and chains stay isolated.
- Slow-viewer queues bounded and monitored.
- Load test includes process overlap, reconnects and cold snapshots.

## Frequently asked questions

### How many viewers can one socket support?

There is no universal viewer count. Measure your watch overlap, filters, event volume, backend fan-out and per-connection limits.

### Does Business allow me to expose a raw data API?

The embed licence covers display inside the licensed product. Raw-data redistribution requires a separate Enterprise agreement under the current terms.

## Continue building

- [Reduce REST polling in a trading terminal](https://madeonsol.com/docs/terminal)
- [Reduce MadeOnSol API calls with safe backend caching](https://madeonsol.com/docs/caching)
- [Build reliable MadeOnSol WebSocket recovery](https://madeonsol.com/docs/realtime-reliability)

## Match your plan to your workload

Compare capacity, channel access and display rights before launching.

[Compare plans and subscribe](https://madeonsol.com/pricing#pricing)

## Related reference

- [Terminal helper reference](https://madeonsol.com/api-docs#terminal-helper)
- [Stream subscription builder](https://madeonsol.com/api-docs#stream-config)
- [Terms and display rights](https://madeonsol.com/terms)
- [Plan comparison](https://madeonsol.com/pricing)

[Canonical guide](https://madeonsol.com/docs/terminal-at-scale)
