-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(); uniswap-forks; add uniswap forks swap subgraphs on base (#2325)
Co-authored-by: Dhruv Chauhan <dhruv@Dhruvs-MacBook-Pro.local> Co-authored-by: Chris Steege <56660047+steegecs@users.noreply.github.com>
- Loading branch information
1 parent
f9e936b
commit 7fd4e20
Showing
26 changed files
with
1,890 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
subgraphs/uniswap-forks-swap/protocols/baseswap-swap/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Baseswap - Swap Subgraph | ||
|
||
> Note: This subgraph only tracks the `Swap` events.<br/> | ||
> All the other events have been ignored. If you wish to see other entities and metrics for uniswap-forks, you may check the [uniswap-forks subgraphs here](https://github.com/messari/subgraphs/tree/master/subgraphs/uniswap-forks). | ||
## Networks | ||
|
||
- Base |
11 changes: 11 additions & 0 deletions
11
...ks-swap/protocols/baseswap-swap/config/deployments/baseswap-swap-base/configurations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"deployment": "BASESWAP_BASE", | ||
"network": "base", | ||
"factory": { | ||
"address": "0xFDa619b6d20975be80A10332cD39b9a4b0FAa8BB", | ||
"startBlock": 2059124 | ||
}, | ||
"graftEnabled": false, | ||
"subgraphId": "", | ||
"graftStartBlock": 0 | ||
} |
38 changes: 38 additions & 0 deletions
38
...orks-swap/protocols/baseswap-swap/config/deployments/baseswap-swap-base/configurations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
Network, | ||
PROTOCOL_SCHEMA_VERSION, | ||
} from "../../../../../src/common/constants"; | ||
import { Configurations } from "../../../../../configurations/configurations/interface"; | ||
import { | ||
PROTOCOL_SUBGRAPH_VERSION, | ||
PROTOCOL_METHODOLOGY_VERSION, | ||
PROTOCOL_NAME, | ||
PROTOCOL_SLUG, | ||
} from "../../../src/common/constants"; | ||
|
||
export class BaseswapBaseConfigurations implements Configurations { | ||
getNetwork(): string { | ||
return Network.BASE; | ||
} | ||
getSchemaVersion(): string { | ||
return PROTOCOL_SCHEMA_VERSION; | ||
} | ||
getSubgraphVersion(): string { | ||
return PROTOCOL_SUBGRAPH_VERSION; | ||
} | ||
getMethodologyVersion(): string { | ||
return PROTOCOL_METHODOLOGY_VERSION; | ||
} | ||
getProtocolName(): string { | ||
return PROTOCOL_NAME; | ||
} | ||
getProtocolSlug(): string { | ||
return PROTOCOL_SLUG; | ||
} | ||
getFactoryAddress(): string { | ||
return "0xfda619b6d20975be80a10332cd39b9a4b0faa8bb"; | ||
} | ||
getBrokenERC20Tokens(): string[] { | ||
return []; | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
...s/uniswap-forks-swap/protocols/baseswap-swap/config/templates/baseswap.swap.template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
specVersion: 0.0.2 | ||
repository: https://github.com/messari/subgraphs | ||
schema: | ||
file: ./schema.graphql | ||
{{#graftEnabled}} | ||
description: ... | ||
graft: | ||
base: {{subgraphId}} # Subgraph ID of base subgraph | ||
block: {{graftStartBlock}} # Block number | ||
features: | ||
- grafting | ||
{{/graftEnabled}} | ||
dataSources: | ||
- kind: ethereum/contract | ||
name: Factory | ||
network: {{network}} | ||
source: | ||
address: "{{factory.address}}" | ||
abi: Factory | ||
startBlock: {{factory.startBlock}} | ||
mapping: | ||
kind: ethereum/events | ||
apiVersion: 0.0.6 | ||
language: wasm/assemblyscript | ||
file: ./src/mappings/factory.ts | ||
entities: | ||
- Token | ||
- DexAmmProtocol | ||
- LiquidityPool | ||
- LiquidityPoolFee | ||
- Protocol | ||
abis: | ||
- name: Factory | ||
file: ./abis/uniswap-v2/Factory.json | ||
- name: TokenABI | ||
file: ./abis/uniswap-v2/ERC20.json | ||
eventHandlers: | ||
- event: PairCreated(indexed address,indexed address,address,uint256) | ||
handler: handlePairCreated | ||
templates: | ||
- kind: ethereum/contract | ||
name: Pair | ||
network: {{network}} | ||
source: | ||
abi: Pair | ||
mapping: | ||
kind: ethereum/events | ||
apiVersion: 0.0.6 | ||
language: wasm/assemblyscript | ||
file: ./src/mappings/pool.ts | ||
entities: | ||
- LiqudityPool | ||
- Token | ||
- Deposit | ||
- Withdraw | ||
- Swap | ||
- LiquidityPool | ||
- LiquidityPoolFee | ||
- DexAmmProtocol | ||
- Token | ||
- _Transaction | ||
- _Mint | ||
- _Burn | ||
- _PricesUSD | ||
- UsageMetricsDailySnapshot | ||
- FinancialsDailySnapshot | ||
- _Account | ||
- _DailyActiveAccount | ||
- PoolDailySnapshot | ||
- _TokenTracker | ||
abis: | ||
- name: Pair | ||
file: ./abis/uniswap-v2/Pair.json | ||
- name: Factory | ||
file: ./abis/uniswap-v2/Factory.json | ||
- name: TokenABI | ||
file: ./abis/uniswap-v2/ERC20.json | ||
eventHandlers: | ||
- event: Swap(indexed address,uint256,uint256,uint256,uint256,indexed address) | ||
handler: handleSwap | ||
|
9 changes: 9 additions & 0 deletions
9
subgraphs/uniswap-forks-swap/protocols/baseswap-swap/src/common/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//////////////////// | ||
//////Versions///// | ||
//////////////////// | ||
import { Versions } from "../../../../src/versions"; | ||
|
||
export const PROTOCOL_SUBGRAPH_VERSION = Versions.getSubgraphVersion(); | ||
export const PROTOCOL_METHODOLOGY_VERSION = Versions.getMethodologyVersion(); | ||
export const PROTOCOL_NAME = "Baseswap - Swap"; | ||
export const PROTOCOL_SLUG = "baseswap-swap"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ enum Network { | |
ARWEAVE_MAINNET | ||
AURORA | ||
AVALANCHE | ||
BASE | ||
BOBA | ||
BSC # aka BNB Chain | ||
CELO | ||
|
Oops, something went wrong.