Skip to main content

Polygon - Ethereum-Compatible Layer 2 Scaling Solution

Polygon RPC
With Dwellir, you get access to our global Polygon network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.

Try Free →

Why Build on Polygon?

Polygon is a leading Ethereum scaling solution, providing a framework for building and connecting Ethereum-compatible blockchain networks. Built with Proof of Stake consensus, Polygon offers:

🚀 Lightning Fast Performance

  • 2 second block times - Fast transaction confirmations
  • Up to 65,000 TPS - Massive throughput capacity
  • $0.01 average transaction cost - 10,000x cheaper than Ethereum

🛡️ Enterprise Security

  • 100+ validators - Highly decentralized network
  • $2B+ staked - Strong economic security
  • Battle-tested since 2020 - Processing billions of transactions

🌍 Massive Ecosystem

  • 50M+ unique addresses - One of the largest L2 user bases
  • 7,000+ dApps - Comprehensive DeFi, Gaming, and NFT ecosystem
  • Major integrations - Aave, Uniswap, OpenSea, Chainlink

Quick Start with Polygon

Connect to Polygon in seconds with Dwellir's optimized endpoints:

🔗 RPC Endpoints

Polygon Mainnet (Chain ID: 137)Live
https://api-polygon-mainnet-full.n.dwellir.com/YOUR_API_KEY
✓ Archive Node✓ Trace API✓ Debug API✓ WebSocket

Quick Connect:

curl -X POST https://api-polygon-mainnet-full.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Installation & Setup

import { JsonRpcProvider } from 'ethers';

// Connect to Polygon via Dwellir
const provider = new JsonRpcProvider(
'https://api-polygon-mainnet-full.n.dwellir.com/YOUR_API_KEY'
);

// Test connection
const blockNumber = await provider.getBlockNumber();
console.log('Connected to Polygon at block:', blockNumber);

Available Methods

Available JSON-RPC Methods

📊 Reading Blockchain Data

Query blocks, transactions, and account states

+

📤 Sending Transactions

Submit and manage transactions

+

📝 Smart Contract Interaction

Call and interact with smart contracts

+

🔧 Node & Network Info

Query node status and network information

+

🎯 Polygon Specific

Methods specific to Polygon PoS

+

Ready to integrate Polygon into your dApp?

Get Your Free API Key →

Core JSON-RPC Methods

Essential methods for interacting with the Polygon network:

MethodDescriptionLink
eth_blockNumberGet the latest block numberView docs →
eth_getBalanceQuery MATIC/POL balance of an addressView docs →
eth_getBlockByNumberRetrieve block details by numberView docs →
eth_callExecute smart contract callsView docs →
eth_getTransactionByHashGet transaction detailsView docs →
eth_getTransactionReceiptFetch transaction receiptsView docs →
eth_sendRawTransactionBroadcast signed transactionsView docs →
eth_estimateGasEstimate gas for transactionsView docs →
eth_gasPriceGet current gas priceView docs →
eth_getLogsQuery event logsView docs →

Debug & Trace Methods

Advanced methods for debugging and analyzing transactions:

MethodDescriptionLink
debug_traceTransactionDetailed transaction execution traceView docs →
debug_traceBlockTrace all transactions in a blockView docs →
debug_traceBlockByNumberTrace block by numberView docs →

Network Information

Chain Details

ParameterMainnetTestnet (Amoy)
Chain ID13780002
CurrencyMATIC (transitioning to POL)MATIC
Block Time~2 seconds~2 seconds
Block Gas Limit30M30M
RPC Endpointhttps://api-polygon-mainnet-full.n.dwellir.comhttps://api-polygon-amoy.n.dwellir.com

Important Addresses

ContractAddress
WMATIC0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270
USDC0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
USDT0xc2132D05D31c914a87C6611C10748AEb04B58e8F
Multicall30xcA11bde05977b3631167028862bE2a173976CA11

Best Practices

1. Optimize Gas Usage

Polygon has low fees, but optimizing gas usage is still important:

// Use gas estimation for accurate pricing
const gasEstimate = await contract.estimateGas.transfer(to, amount);
const gasPrice = await provider.getGasPrice();
const txCost = gasEstimate * gasPrice;

2. Handle Network Congestion

Monitor and adapt to network conditions:

// Implement dynamic gas pricing
const gasPrice = await provider.getGasPrice();
const adjustedGasPrice = gasPrice * 110n / 100n; // 10% buffer

3. Leverage Polygon's Speed

Take advantage of fast block times for better UX:

// Quick confirmation monitoring
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait(1); // Usually confirms in 1 block (~2 seconds)

Resources

Support

Need help? Our team is available 24/7:

Start building on Polygon with Dwellir's enterprise-grade infrastructure today.