docs
中文(简体)

此页面尚未翻译,以英文显示。

本页内容

RPC providers and monthly cost

Polysia reads Polygon through RPC endpoints from providers such as Alchemy, Infura or QuickNode. This page shows how to get free keys, how many requests the daemon makes, and what that means for the monthly bill.

1. Get free keys (5 minutes each)

ProviderStepsEndpoint looks like
Alchemyhttps://dashboard.alchemy.com → sign up → Create new app → chain Polygon PoS, network Mainnet → API key → copy the HTTPS URLhttps://polygon-mainnet.g.alchemy.com/v2/<key>
Infura (MetaMask Developer)https://developer.metamask.io → sign up → API keys → Create → enable Polygon PoS Mainnet → copy the HTTPS URLhttps://polygon-mainnet.infura.io/v3/<key>
QuickNodehttps://www.quicknode.com → sign up → Create endpoint → Polygon → Mainnet → copy the HTTP Provider URL (the entry plan may be a time-limited trial — check before relying on it)https://<name>.matic.quiknode.pro/<token>/

Then: Dashboard → Settings → RPC endpoints → paste the URL → 2FA code → Test and add. The URL is tested (chain id must be 137), stored encrypted with data/admin.key and shown only masked (https://polygon-mainnet.g.alchemy.com/v2/****). It is used immediately — no restart. Order = priority: the first healthy endpoint carries all traffic, the others are fallbacks when it fails or runs out of quota.

Use at least two different providers. One provider's outage or an exhausted free quota then does not stop deposits, sweeps and withdrawals. Keep the keys private: anyone with the URL can spend your quota.

2. How many requests Polysia makes

Counted from the code of polysiad (version on 2026-11-19), one business, nothing happening (idle):

LoopIntervalRequests per tickPer minute
Scanner (deposits)SCAN_POLL_SECONDS (default 20 s) + round trips ≈ every 20.5 seth_blockNumber, eth_getBlockByNumber(finalized), 2 × eth_getLogs (finalized + newest blocks)≈ 12
Alert monitor30 shead, finalized block, Gas Wallet balance, per business: Hot Wallet POL + USDT balance, blocklist / role checks (eth_call)≈ 16
Custody (Full mode)30 sper business: getBusiness, getPendingHotWallet, Hot Wallet balance≈ 6
Server monitor30 seth_blockNumber2
Tx queue, sweeps, withdrawals5–15 sonly while something is in flight (receipts, nonces, gas estimates, the sweep itself)≈ 0 idle

≈ 36 requests / minute ≈ 1.5 million requests / month at the default settings, regardless of how many payments arrive (the scanner asks for all USDT transfers in each new block and matches them locally, so 10 or 10 million deposit addresses cost the same). Each extra business adds ≈ 10 requests / minute. Payments add a few requests each (block timestamps, the sweep, its receipt).

Your real numbers: Dashboard → Server → Capacity shows requests / minute, ≈ requests / month and the error rate per endpoint.

3. What it costs (Alchemy compute units)

Alchemy bills compute units (CU) per method. With eth_getLogs = 60 CU, eth_blockNumber = 10 CU and the other methods at Alchemy's published weights (≈ 16–26 CU):

One scanner round ≈ 145 CU (2 × 60 + 10 + the finalized block). The 30-second loops ≈ 21M CU / month.

SCAN_POLL_SECONDSScannerOther loopsTotal per monthDeposit seen after
2≈ 150M CU≈ 21M CU≈ 171M CU≤ ≈ 3 s
5≈ 68M CU≈ 21M CU≈ 89M CU≤ ≈ 6 s
15≈ 24M CU≈ 21M CU≈ 45M CU≤ ≈ 16 s
20 (default)≈ 18M CU≈ 21M CU≈ 39M CU≤ ≈ 21 s
60≈ 6M CU≈ 21M CU≈ 27M CU≤ ≈ 1 min

Why 20 seconds is the default. A deposit is detected up to ≈ 20 s after its block (≈ 10 s on average). The customer hardly notices: the payment page only shows Paid once the block is final anyway, so the extra wait overlaps with the finality wait. In return the RPC bill drops by more than 75 % compared with 2 s. Shops that want the fastest possible confirmation can set SCAN_POLL_SECONDS=5 (or lower) and pay for the extra requests.

Use 2–3 providers on free tiers. ≈ 39M CU / month is a little above one Alchemy free plan (30M CU). Add a second (and third) provider in Settings → RPC endpoints: the first endpoint carries the traffic until its quota runs out (≈ day 23 on Alchemy free), then the next one takes over automatically for the rest of the month — no restart, no missed deposits. Two free plans are enough for one shop at the default speed.

  • Alchemy free: 30M CU / month — ≈ 23 days at the default speed on its own; with a second provider as fallback a whole month. For SCAN_POLL_SECONDS below ≈ 10 use a paid plan (pay-as-you-go).
  • Infura free: 3M credits per day (≈ 90M / month), with a per-second limit; credit weights per method are on Infura's pricing page — check eth_getLogs there before relying on it.
  • QuickNode: credits per method (e.g. eth_getLogs); the entry offer may be a trial.
  • Prices and free tiers change — numbers here are estimates from the code and the providers' pages as of November 2026. Measure with the Capacity card and compare with your provider's usage page after a day.

Set RPC_MONTHLY_LIMIT (requests per month of your plan) in .env: the Capacity card then warns at 80 %.

4. Tips

  • Put the provider whose quota you pay for first; free endpoints second / third as fallbacks.
  • A self-hosted Polygon node (http://127.0.0.1:8545 or a private-network address is allowed) has no per-request cost but needs a large server.
  • SCAN_MAX_RANGE (default 100 blocks) must stay within the provider's eth_getLogs block-range limit (Alchemy free: 10 → SCAN_MAX_RANGE=10).
  • Never put RPC URLs in screenshots, tickets or chat: the key is in the URL.