Polygon Adapter (Feeder TS)

The Polygon Adapter uses the Charli3 Feeder service to fetch price data from Uniswap V3 on Polygon PoS.

Network Details

  • Chain ID: 137
  • DEX: Uniswap V3
  • Factory Address: 0x1F98431c8aD98523631AE4a59f267346ea31F984
  • RPC Endpoint: e.g., https://polygon-rpc.com

Prerequisites

  • Node.js v18+
  • npm

Installation

npm install
npm run build

Configuration

Create a polygon-config.yml file:

EVMChains:
  - chain_id: 137
    name: polygon
    rpc_url: https://polygon-rpc.com
    factory_address: "0x1F98431c8aD98523631AE4a59f267346ea31F984"
 
Rates:
  MATIC-USD:
    general_base_symbol: MATIC-USD
    base_currency:
      dexes:
        - adapter: uniswap-v3
          chain_id: 137
          asset_a: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270" # WMATIC
          asset_b: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" # USDC
          sources: [500]

Running

# Run with Polygon config
npm run cli:config -- polygon-config.yml