Skip to content

Commit c007e44

Browse files
committed
refactor v3 subgraph to include token subgraphs
1 parent fb917a6 commit c007e44

File tree

106 files changed

+5735
-6303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+5735
-6303
lines changed

.eslintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint"],
4+
"extends": ["plugin:@typescript-eslint/recommended", "prettier", "prettier/@typescript-eslint"],
5+
"rules": {
6+
"@typescript-eslint/no-non-null-assertion": "off"
7+
}
8+
}

.eslintrc.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/CI.yml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
- name: Set up node
2424
uses: actions/setup-node@v3
2525
with:
26-
node-version: '18.x'
26+
node-version: "18.x"
2727
registry-url: https://registry.npmjs.org
2828

2929
- name: Get yarn cache directory path
3030
id: yarn-cache-dir-path
3131
run: echo "::set-output name=dir::$(yarn cache dir)"
3232

33-
- uses: actions/cache@v2
33+
- uses: actions/cache@v3
3434
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
3535
with:
3636
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -52,42 +52,3 @@ jobs:
5252
if [ -z "$(git diff)" ]; then exit; fi
5353
git commit -a -m "fix(lint): auto-fix [ci]"
5454
git push
55-
56-
build-and-test:
57-
needs: lint
58-
name: build-and-test
59-
runs-on: ubuntu-latest
60-
61-
steps:
62-
- name: Checkout code
63-
uses: actions/checkout@v2
64-
65-
- name: Setup Node
66-
uses: actions/setup-node@v2
67-
with:
68-
node-version: '18.x'
69-
70-
- name: Get yarn cache directory path
71-
id: yarn-cache-dir-path
72-
run: echo "::set-output name=dir::$(yarn cache dir)"
73-
74-
- uses: actions/cache@v2
75-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
76-
with:
77-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
78-
key: yarn-${{ hashFiles('**/yarn.lock') }}
79-
restore-keys: |
80-
yarn-
81-
82-
- name: Install dependencies
83-
run: yarn install
84-
85-
- name: Build project
86-
run: yarn build
87-
88-
- name: Build Docker
89-
run: yarn build:docker
90-
91-
- name: Test
92-
# We need to run test in this mode because github CI is non-interactive
93-
run: yarn test:no-tty

.gitignore

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
build/
21
node_modules/
3-
src/types/
42
.DS_STORE
53
yarn-error.log
6-
tests/.bin/
7-
tests/.docker/
8-
tests/.latest.json
4+
build/
5+
generated/
6+
.vscode
7+
.env
8+
/.subgraph-env
9+
subgraph.yaml
10+
/src/common/chain.ts
11+
/*subgraph.yaml

.prettierrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"semi": false,
33
"singleQuote": true,
4-
"printWidth": 120,
5-
"trailingComma": "all"
4+
"printWidth": 120
65
}

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
1-
# Uniswap V3 Subgraph
1+
# Uniswap V3 and V3-Tokens Subgraph
22

3-
### Subgraph Endpoint
3+
## Development
44

5-
Synced at: https://thegraph.com/hosted-service/subgraph/ianlapham/uniswap-v3-subgraph?selected=playground
5+
1. Install dependencies
6+
`yarn install`
67

7-
Pending Changes at same URL
8+
2. Build a v3 subgraph
9+
`yarn build --network <network> --subgraph-type v3`
810

9-
### Running Unit Tests
11+
3. Deploy a v3 subgraph
12+
`yarn build --network <network> --subgraph-type v3 --deploy`
1013

11-
1. Install [Docker](https://docs.docker.com/get-docker/) if you don't have it already
12-
2. Install postgres: `brew install postgresql`
13-
3. `yarn run build:docker`
14-
4. `yarn run test`
14+
4. Build a v3-tokens subgraph
15+
`yarn build --network <network> --subgraph-type v3-tokens`
1516

16-
### Adding New Chains
17+
5. Deploy a v3-tokens subgraph
18+
`yarn build --network <network> --subgraph-type v3-tokens --deploy`
1719

18-
1. Create a new subgraph config in `src/utils/chains.ts`. This will require adding a new `<NETWORK_NAME>_NETWORK_NAME` const for the corresponding network.
19-
2. Add a new entry in `networks.json` for the new chain. The network name should be derived from the CLI Name in The Graph's [supported networks documenation](https://thegraph.com/docs/en/developing/supported-networks/). The factory address can be derived from Uniswap's [deployments documentation](https://docs.uniswap.org/contracts/v3/reference/deployments/ethereum-deployments).
20-
3. To deploy to Alchemy, run the following command:
20+
Note: Deployments will fail if there are uncommitted changes in the subgraph. Please commit your changes before deploying.
2121

22-
```
23-
yarn run deploy:alchemy --
24-
<SUBGRAPH_NAME>
25-
--version-label <VERSION_LABEL>
26-
--deploy-key <DEPLOYMENT_KEY>
27-
--network <NETWORK_NAME>
28-
```

abis/ERC20.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"outputs": [
8585
{
8686
"name": "",
87-
"type": "uint32"
87+
"type": "uint256"
8888
}
8989
],
9090
"payable": false,

0 commit comments

Comments
 (0)