Skip to content

Commit 468ce7b

Browse files
Merge pull request #217 from Uniswap/rseitz/add-arc-mainnet
add arc-mainnet (5042) support
2 parents 91ba4b1 + 020e043 commit 468ce7b

5 files changed

Lines changed: 53 additions & 0 deletions

File tree

config/arc-mainnet/.subgraph-env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
V2_TOKEN_SUBGRAPH_NAME="uniswap-v2-tokens-arc-mainnet"
2+
V2_SUBGRAPH_NAME="uniswap-v2-arc-mainnet"

config/arc-mainnet/chain.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Address, BigDecimal, BigInt } from '@graphprotocol/graph-ts/index'
2+
3+
export const FACTORY_ADDRESS = '0x89e5db8b5aa49aa85ac63f691524311aeb649eba'
4+
5+
// Arc (chainId 5042) is Circle's USDC-native L1: the native gas token is USDC and there is no
6+
// wrapped native (the deployment's "WETH9" slot is the UnsupportedProtocol stub), so pairs pair
7+
// against native USDC and USDC is the reference token. Because the reference token IS the dollar,
8+
// getEthPriceInUSD() returns 1 — opted in by including REFERENCE_TOKEN in STABLE_TOKEN_PAIRS.
9+
const USDC = '0x3600000000000000000000000000000000000000'.toLowerCase()
10+
const EURC = '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a'.toLowerCase()
11+
const USYC = '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C'.toLowerCase()
12+
const CIRBTC = '0x171A4217b86A807A64eB94757Db6849fb4bDbAA0'.toLowerCase() // cirBTC (BTC-pegged) — whitelist only, not a USD stable
13+
const WETH = '0x128cC466B61f542da60c70e3aA11c10e19B84EDB'.toLowerCase() // bridged ETH — whitelist only (not the native/reference; Arc's native is USDC)
14+
15+
export const REFERENCE_TOKEN = USDC
16+
export const STABLE_TOKEN_PAIRS = [REFERENCE_TOKEN]
17+
18+
// token where amounts should contribute to tracked volume and liquidity
19+
export const WHITELIST: string[] = [USDC, EURC, USYC, CIRBTC, WETH]
20+
21+
// USD-pegged stablecoins only (EURC is EUR-pegged, USYC is yield-bearing → excluded)
22+
export const STABLECOINS = [USDC]
23+
24+
// minimum liquidity required to count towards tracked volume for pairs with small # of Lps
25+
export const MINIMUM_USD_THRESHOLD_NEW_PAIRS = BigDecimal.fromString('40000')
26+
27+
// minimum liquidity for price to get tracked
28+
export const MINIMUM_LIQUIDITY_THRESHOLD_ETH = BigDecimal.fromString('2000')
29+
30+
export class TokenDefinition {
31+
address: Address
32+
symbol: string
33+
name: string
34+
decimals: BigInt
35+
}
36+
37+
export const STATIC_TOKEN_DEFINITIONS: TokenDefinition[] = []
38+
39+
export const SKIP_TOTAL_SUPPLY: string[] = []

config/arc-mainnet/config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"network": "arc-mainnet",
3+
"factory": "0x89e5db8b5aa49aa85ac63f691524311aeb649eba",
4+
"startblock": "1948011"
5+
}

script/utils/prepareNetwork.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as process from 'process'
55

66
export enum NETWORK {
77
ARBITRUM = 'arbitrum-one',
8+
ARC = 'arc-mainnet',
89
AVALANCHE = 'avalanche',
910
BASE = 'base',
1011
BLAST = 'blast-mainnet',

src/common/pricing.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ import {
1313
import { ADDRESS_ZERO, ONE_BD, ZERO_BD } from './constants'
1414

1515
export function getEthPriceInUSD(): BigDecimal {
16+
// On chains where the reference token is itself a USD stablecoin (e.g. Arc, whose native gas
17+
// token is USDC and which has no wrapped-native / reference-stable pair), the reference token's
18+
// USD price is 1 by definition. Such chains opt in by including REFERENCE_TOKEN in STABLE_TOKEN_PAIRS.
19+
if (STABLE_TOKEN_PAIRS.includes(REFERENCE_TOKEN)) {
20+
return ONE_BD
21+
}
1622
// create an array with same length as STABLE_TOKEN_PAIRS
1723
let stableTokenPairs = new Array<Pair | null>(STABLE_TOKEN_PAIRS.length)
1824
let stableTokenReserves = new Array<BigDecimal>(STABLE_TOKEN_PAIRS.length)

0 commit comments

Comments
 (0)