Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/arc-mainnet/.subgraph-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
V2_TOKEN_SUBGRAPH_NAME="uniswap-v2-tokens-arc-mainnet"
V2_SUBGRAPH_NAME="uniswap-v2-arc-mainnet"
39 changes: 39 additions & 0 deletions config/arc-mainnet/chain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Address, BigDecimal, BigInt } from '@graphprotocol/graph-ts/index'

export const FACTORY_ADDRESS = '0x89e5db8b5aa49aa85ac63f691524311aeb649eba'

// Arc (chainId 5042) is Circle's USDC-native L1: the native gas token is USDC and there is no
// wrapped native (the deployment's "WETH9" slot is the UnsupportedProtocol stub), so pairs pair
// against native USDC and USDC is the reference token. Because the reference token IS the dollar,
// getEthPriceInUSD() returns 1 — opted in by including REFERENCE_TOKEN in STABLE_TOKEN_PAIRS.
const USDC = '0x3600000000000000000000000000000000000000'.toLowerCase()
const EURC = '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a'.toLowerCase()
const USYC = '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C'.toLowerCase()
const CIRBTC = '0x171A4217b86A807A64eB94757Db6849fb4bDbAA0'.toLowerCase() // cirBTC (BTC-pegged) — whitelist only, not a USD stable
const WETH = '0x128cC466B61f542da60c70e3aA11c10e19B84EDB'.toLowerCase() // bridged ETH — whitelist only (not the native/reference; Arc's native is USDC)

export const REFERENCE_TOKEN = USDC
export const STABLE_TOKEN_PAIRS = [REFERENCE_TOKEN]

// token where amounts should contribute to tracked volume and liquidity
export const WHITELIST: string[] = [USDC, EURC, USYC, CIRBTC, WETH]

// USD-pegged stablecoins only (EURC is EUR-pegged, USYC is yield-bearing → excluded)
export const STABLECOINS = [USDC]

// minimum liquidity required to count towards tracked volume for pairs with small # of Lps
export const MINIMUM_USD_THRESHOLD_NEW_PAIRS = BigDecimal.fromString('40000')

// minimum liquidity for price to get tracked
export const MINIMUM_LIQUIDITY_THRESHOLD_ETH = BigDecimal.fromString('2000')

export class TokenDefinition {
address: Address
symbol: string
name: string
decimals: BigInt
}

export const STATIC_TOKEN_DEFINITIONS: TokenDefinition[] = []

export const SKIP_TOTAL_SUPPLY: string[] = []
5 changes: 5 additions & 0 deletions config/arc-mainnet/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"network": "arc-mainnet",
"factory": "0x89e5db8b5aa49aa85ac63f691524311aeb649eba",
"startblock": "1948011"
}
1 change: 1 addition & 0 deletions script/utils/prepareNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as process from 'process'

export enum NETWORK {
ARBITRUM = 'arbitrum-one',
ARC = 'arc-mainnet',
AVALANCHE = 'avalanche',
BASE = 'base',
BLAST = 'blast-mainnet',
Expand Down
6 changes: 6 additions & 0 deletions src/common/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import {
import { ADDRESS_ZERO, ONE_BD, ZERO_BD } from './constants'

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