Yearn RPC Read Proxy
A minimum, cached, read-only proxy for Ethereum JSON-RPC requests, optimized for frontend.
Endpoint
POST /chain/[chainId]
Supported Chains
-
1Ethereum Mainnet -
10Optimism -
100Gnosis -
137Polygon -
146Chain 146 -
250Fantom -
8453Base -
42161Arbitrum One -
747474Chain 747474
Supported Methods
-
eth_blockNumberReturns the current block number -
eth_chainIdReturns the chain ID -
eth_gasPriceReturns the current gas price -
eth_callExecutes a call without creating a transaction -
eth_getBalanceReturns the balance of an address -
eth_getCodeReturns the code at an address -
eth_getStorageAtReturns storage at a position -
eth_getBlockByNumberReturns block by number -
eth_getBlockByHashReturns block by hash -
eth_getTransactionByHashReturns transaction by hash -
eth_getTransactionReceiptReturns transaction receipt -
eth_getTransactionCountReturns transaction count (nonce) -
eth_getLogsReturns logs matching filter -
eth_estimateGasEstimates gas for a transaction
Example Request
curl -v -X POST https://rpc.yearn.fi/chain/1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x134a5b2"
}
Caching
-
-
Queries with
latest,pending, or absent block parameters are cached for 3 seconds - - Queries with numeric block parameters are cached for 3600 seconds
- - Batch requests cache each item individually for maximum efficiency
Usage with Libraries
// viem
const client = createPublicClient({
transport: http('https://rpc.yearn.fi/chain/1')
})
// ethers
const provider = new JsonRpcProvider('https://rpc.yearn.fi/chain/1')