Skip to content

Commit

Permalink
update network to base
Browse files Browse the repository at this point in the history
  • Loading branch information
mzywang committed Dec 2, 2024
1 parent fa2d0c9 commit eb38aca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 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 = '0x5C346464d33F90bABaf70dB6388507CC889C1070'
export const FACTORY_ADDRESS = '0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6'

export let ZERO_BI = BigInt.fromI32(0)
export let ONE_BI = BigInt.fromI32(1)
Expand Down
22 changes: 14 additions & 8 deletions src/mappings/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@ 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 = '0x4300000000000000000000000000000000000004'
const USDB_ADDRESS = '0x4300000000000000000000000000000000000003'
const USDC_WETH_PAIR = '0xad06cd451fe4034a6dd515af08e222a3d95b4a1c'
const WETH_ADDRESS = '0x4200000000000000000000000000000000000006'
const USDC_WETH_PAIR = '0x88a43bbdf9d098eec7bceda4e2494615dfd9bb9c'

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

// token where amounts should contribute to tracked volume and liquidity
let WHITELIST: string[] = [WETH_ADDRESS, USDB_ADDRESS]

const STABLECOINS: string[] = [USDB_ADDRESS]
let WHITELIST: string[] = [
'0x4200000000000000000000000000000000000006', // WETH
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
'0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca', // USDbC
]

const STABLECOINS: string[] = [
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
'0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca', // USDbC
]

// 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: blast-mainnet
network: base
source:
address: '0x5C346464d33F90bABaf70dB6388507CC889C1070'
address: '0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6'
abi: Factory
startBlock: 399405
startBlock: 6601915
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -34,7 +34,7 @@ dataSources:
templates:
- kind: ethereum/contract
name: Pair
network: blast-mainnet
network: base
source:
abi: Pair
mapping:
Expand Down

0 comments on commit eb38aca

Please sign in to comment.