Skip to content
Magma Devs
Platform

Stop paying your providers for the same answer twice.

Your deposit scanners, balance checks and reconciliation jobs ask for the same blocks and receipts again and again. Smart Router answers the repeats from memory, because it knows which block each call is about and whether that block is final on that chain. It works across our providers, yours, or both.

How much you save depends on how often your systems repeat the same calls.

Same question, asked again

Deposit scanner
latest block?block 21,000,000
answered from memory
Balance checks
latest block?receipt 0xab…
answered from memory
Nightly reconciliation
block 21,000,000receipt 0xab…
answered from memory
Smart Router
chain clock · Newest block: 21,000,040
  1. 1. A write, or tied to one node?
    always to a provider
  2. 2. Which block is this about?
    latest -> 21,000,040
  3. 3. Is that block final on this chain?
    final: keptnear the newest block: kept until the next block
  4. 4. Newer than what you already saw?
    block 21,000,038
only new questions
Provider A
Provider B

What you get

  • Your provider bill shrinks with it. Providers charge per request or per compute unit, so every read we answer is one you don't pay for.
  • You stay on your plan longer. Fewer requests means fewer rate limits and fewer forced upgrades to the next tier.
  • Fewer rate-limit errors in your own systems. The requests that would hit the cap never leave.
  • Faster answers. A repeat read comes back from memory inside your network in milliseconds, not from a provider round trip that slows down exactly when the market is busy.

Where the savings come from

  • Block scanning: every deposit and withdrawal service reading the same new blocks.
  • "What is the latest block?": asked by every service, many times per block. Answered once per block.
  • Receipts and transactions: kept by their own hash, so reconciliation reads each one once.
  • Old blocks read again every night: final, so they come from memory.

How it decides

  1. A write, or tied to one node? It goes straight to a provider. Writes, pending nonces, filters, subscriptions and mempool calls are never answered from memory.
  2. Which block is this about? The router reads the block out of every call. A call for "latest" is answered for the actual newest block, so when the chain moves one block, every "latest" answer is retired at once.
  3. Is that block final on this chain? Each chain has its own rule for when a block is final, and it is configurable. Final answers are kept. Answers near the newest block live for less than one block.
  4. Newer than what you already saw? Every answer from memory is checked against the newest block the router has seen.

What keeps the cache safe

  • A node that is behind the chain cannot put its old answer into the cache.
  • The same question with a different request id still counts as a repeat.
  • If the cache goes down, requests go straight to your providers and your app keeps getting answers.
  • Every reply can tell you whether it came from memory.