Skip to content

Commit

Permalink
update network to optimism
Browse files Browse the repository at this point in the history
  • Loading branch information
mzywang committed Apr 17, 2024
1 parent b69cf8a commit 5ea5da6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/mappings/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Factory as FactoryContract } from '../types/templates/Pair/Factory'
import { TokenDefinition } from './tokenDefinition'

export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'
export const FACTORY_ADDRESS = '0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9'
export const FACTORY_ADDRESS = '0x0c3c1c532F1e39EdF36BE9Fe0bE1410313E074Bf'

export let ZERO_BI = BigInt.fromI32(0)
export let ONE_BI = BigInt.fromI32(1)
Expand Down
20 changes: 8 additions & 12 deletions src/mappings/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,23 @@ import { Address, BigDecimal, BigInt } from '@graphprotocol/graph-ts/index'
import { Bundle, Pair, Token } from '../types/schema'
import { ADDRESS_ZERO, factoryContract, ONE_BD, UNTRACKED_PAIRS, ZERO_BD } from './helpers'

const WETH_ADDRESS = '0x82af49447d8a07e3bd95bd0d56f35241523fbab1'
const USDC_WETH_PAIR = '0xf64dfe17c8b87f012fcf50fbda1d62bfa148366a' // created at block 150778518
const WETH_ADDRESS = '0x4200000000000000000000000000000000000006'
const USDC_ADDRESS = '0x0b2c639c533813f4aa9d7837caf62653d097ff85'
const USDC_WETH_PAIR = '0x4c43646304492a925e335f2b6d840c1489f17815'

export function getEthPriceInUSD(): BigDecimal {
let usdcPair = Pair.load(USDC_WETH_PAIR) // usdc is token1
let usdcPair = Pair.load(USDC_WETH_PAIR) // usdc is token0
if (usdcPair !== null) {
return usdcPair.token1Price
return usdcPair.token0Price
} else {
return ZERO_BD
}
}

// token where amounts should contribute to tracked volume and liquidity
let WHITELIST: string[] = [
'0x82af49447d8a07e3bd95bd0d56f35241523fbab1', // WETH
'0xaf88d065e77c8cc2239327c5edb3a432268e5831', // USDC
]

const STABLECOINS: string[] = [
'0xaf88d065e77c8cc2239327c5edb3a432268e5831', // USDC
]
let WHITELIST: string[] = [WETH_ADDRESS, USDC_ADDRESS]

const STABLECOINS: string[] = [USDC_ADDRESS]

// minimum liquidity required to count towards tracked volume for pairs with small # of Lps
let MINIMUM_USD_THRESHOLD_NEW_PAIRS = BigDecimal.fromString('10000')
Expand Down
8 changes: 4 additions & 4 deletions subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ schema:
dataSources:
- kind: ethereum/contract
name: Factory
network: arbitrum-one
network: optimism
source:
address: '0xf1D7CC64Fb4452F05c498126312eBE29f30Fbcf9'
address: '0x0c3c1c532F1e39EdF36BE9Fe0bE1410313E074Bf'
abi: Factory
startBlock: 150442611
startBlock: 112197986
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -34,7 +34,7 @@ dataSources:
templates:
- kind: ethereum/contract
name: Pair
network: arbitrum-one
network: optimism
source:
abi: Pair
mapping:
Expand Down

0 comments on commit 5ea5da6

Please sign in to comment.