Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Liquidity entity in subgraph and takerTokenFeeFilledAmount field #823

Merged
merged 33 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5d1f1ba
add Liquidity entity in subgraphs
Walodja1987 Apr 21, 2024
433a7d4
Add `takerTokenFeeFilledAmount` field in NativeOrderFill entity
Walodja1987 Apr 24, 2024
31e4498
typo fixed
Walodja1987 Apr 24, 2024
5456391
several fixes
Walodja1987 Apr 29, 2024
a4f0d38
react-error-overlay version bumped due to github actions issue
Walodja1987 Apr 29, 2024
14636eb
removed yarn.lock and updated .gitignore
Walodja1987 Apr 29, 2024
471f097
test
Walodja1987 Apr 29, 2024
ae6682c
minor fixes
Walodja1987 Apr 30, 2024
e15d75e
Delete package-lock.json
Walodja1987 Apr 30, 2024
dc55214
concat-stream issue resolved an .nvmrc file added
Walodja1987 May 1, 2024
fadd744
update Polygon subgraph API and some other stuff
Walodja1987 May 3, 2024
d52ca1b
Node version updated in github workflow
Walodja1987 May 3, 2024
5fe22e1
Update pull-request-checks.yml
Walodja1987 May 3, 2024
ef6803e
Update github workflow files to update node version and add caching
Walodja1987 May 3, 2024
447893f
Update node version and add cache in remaining github workflow files
Walodja1987 May 3, 2024
ee8dac2
updated .gitignore to uploaded yarn.lock to enable caching during git…
Walodja1987 May 3, 2024
7eae2e9
package.json updated
Walodja1987 May 3, 2024
476976f
divaSubgraph url updated
Walodja1987 May 4, 2024
6af80c9
Liquidity subgraph updated
Walodja1987 May 5, 2024
7652a1e
Claim entity in diva subgraph added
Walodja1987 May 7, 2024
4995a4d
fix Create issues
Walodja1987 May 31, 2024
8fffa90
removed graph:auth command
Walodja1987 May 31, 2024
08f1419
fix provider issue on trade page
Walodja1987 Jun 1, 2024
87ac3a9
improve efficiency of id search in CoinGecko coinlist
Walodja1987 Jun 1, 2024
f57b17e
whitelistSubgraph url on Polygon updated
Walodja1987 Jun 1, 2024
9d12c7b
Add native USDC on Polygon and add new admin
Walodja1987 Jun 4, 2024
1ff37e0
Fix provider issue in BuyOrder.tsx and SellOrder.tsx
Walodja1987 Jun 4, 2024
626f3ff
fix undefined config issue in `AddLiquidity.tsx`
Walodja1987 Jun 8, 2024
598320e
fix
Walodja1987 Jun 8, 2024
077026f
remove console.log
Walodja1987 Jul 1, 2024
22819b1
nit
Walodja1987 Jul 1, 2024
b475b2a
test commit
Walodja1987 Jul 3, 2024
af9c0c1
Merge branch 'add-liquidity-entity-in-subgraph' of https://github.com…
Walodja1987 Jul 3, 2024
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: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ assignees: ""
3. App crashes (see screenshot)
-->

## Screenshots / Sreen recording
## Screenshots / Screen recording

<!-- Screenshots and/or screen recordings really go a long way to explain
something and help us to tackle the issue. (We use loom for this https://www.loom.com/) -->
43 changes: 22 additions & 21 deletions .github/workflows/deploy-infrastructure-and-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ on:
- 'packages/diva-infrastructure/**'
- '.github/workflows/deploy-infrastructure-and-website.yml'

name: Deploy Infrastructure
name: Deploy Infrastructure and Website

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Configure AW0S credentials
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -23,41 +24,41 @@ jobs:
- name: Checkout current branch
uses: actions/checkout@v3

- uses: actions/setup-node@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: '18'
cache: 'yarn'

- name: Cache Modules
id: cache-modules
- name: Cache Node Modules and Turbo Cache
uses: actions/cache@v2
with:
path: |
**/node_modules
node_modules
key: ${{ hashFiles('**/yarn.lock', '**/package.json', 'yarn.lock') }}

- name: Cache Turbo Cache
id: build-turbo
uses: actions/cache@v2
with:
path: .turbo
key: ${{ hashFiles('packages/**/*') }}
**/.yarn/cache
.turbo
key: ${{ runner.os }}-yarn-turbo-${{ hashFiles('**/yarn.lock', '**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-turbo-

- name: Install dependencies
if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn
run: yarn install --frozen-lockfile

- name: Build
- name: Verify Node.js and Yarn Versions
run: |
node -v
yarn -v

- name: Build Infrastructure and App
run: yarn turbo run build --filter=@diva/infrastructure --filter=@diva/app --cache-dir="./.turbo"
env:
CI: false
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY }}

- name: Deploy Infra
- name: Deploy Infrastructure
run: yarn turbo run deploy --scope="@diva/infrastructure"

- name: sync to s3 and invalidate cache
- name: Sync to S3 and Invalidate CloudFront Cache
run: |
aws s3 sync packages/diva-app/build s3://app.diva.finance
aws cloudfront create-invalidation --distribution-id E2HCWZDF4NN8G6 --paths '/*'

33 changes: 20 additions & 13 deletions .github/workflows/deploy-subgraphs-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,42 @@ on:
- packages/*-subgraph/**/*

name: Deploy production subgraph

jobs:
pr:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/setup-node@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: '18'
cache: 'yarn'

- name: Cache Modules
id: cache-modules
- name: Cache Node Modules and ABIs
uses: actions/cache@v2
with:
path: |
**/node_modules
node_modules
**/.yarn/cache
**/abis
key: ${{ hashFiles('**/yarn.lock', '**/package.json', 'yarn.lock') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn
- name: Authenticate the graph and deploy
run: yarn install --frozen-lockfile

- name: Verify Node.js and Yarn Versions
run: |
node -v
yarn -v

- name: Authenticate with The Graph and Deploy
env:
THEGRAPH_ACCESS_TOKEN: ${{ secrets.THEGRAPH_ACCESS_TOKEN_TEST }}
THEGRAPH_ACCESS_TOKEN: ${{ secrets.THEGRAPH_ACCESS_TOKEN_PROD }}
run: |
yarn graph:auth
yarn turbo run deploy --scope="@diva/*-subgraph"
34 changes: 21 additions & 13 deletions .github/workflows/deploy-subgraphs-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ on:
pull_request:
paths:
- packages/*-subgraph/**/*

name: Deploy Staging subgraph

jobs:
pr:
runs-on: ubuntu-latest
Expand All @@ -12,27 +14,33 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/setup-node@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: '18'
cache: 'yarn'

- name: Cache Modules
id: cache-modules
- name: Cache Node Modules
uses: actions/cache@v2
with:
path: |
**/node_modules
node_modules
key: ${{ hashFiles('**/yarn.lock', '**/package.json', 'yarn.lock') }}
**/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock', '**/package.json', 'yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
if: steps.cache-modules.outputs.cache-hit != 'true'
run: yarn
- name: Authenticate the graph and deploy
env:
run: yarn install --frozen-lockfile

- name: Verify Node.js and Yarn Versions
run: |
node -v
yarn -v

- name: Authenticate with The Graph and Deploy
env:
THEGRAPH_ACCESS_TOKEN: ${{ secrets.THEGRAPH_ACCESS_TOKEN_TEST }}
run: |
yarn graph:auth
# yarn turbo run deploy-staging --scope="@diva/*-subgraph"


yarn turbo run deploy-staging --scope="@diva/*-subgraph"
15 changes: 14 additions & 1 deletion .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 16
node-version: '18'

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Check Node.js and Yarn versions
run: |
node -v
yarn -v

- name: Install dependencies
run: yarn
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.14
18.17.0
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"packageManager": "[email protected]",
"resolutions": {
"//": "See https://github.com/facebook/create-react-app/issues/11773",
"react-error-overlay": "6.0.9"
"**/concat-stream": "^1.6.2",
"react-error-overlay": "^6.0.11"
}
}
1 change: 1 addition & 0 deletions packages/diva-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@mui/material": "^5.1.0",
"@mui/styles": "^5.1.0",
"@mui/x-data-grid": "^5.2.1",
"@mui/x-date-pickers": "^7.3.2",
"@reduxjs/toolkit": "^1.6.1",
"@synthetixio/synpress": "^1.1.1",
"@testing-library/jest-dom": "^5.14.1",
Expand Down
54 changes: 28 additions & 26 deletions packages/diva-app/src/component/ApproveActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export async function _checkConditions(
offerCreateContingentPool,
signature
)

// Confirm that the offer is fillable
// 0: INVALID, 1: CANCELLED, 2: FILLED, 3: EXPIRED, 4: FILLABLE
if (relevantStateParams.offerInfo.status === 0) {
Expand Down Expand Up @@ -180,31 +179,34 @@ export const ApproveActionButtons = ({
}
: null
const [mobile, setMobile] = useState(false)
useEffect(() => {
if (
diva != undefined &&
divaDomain != undefined &&
formik != undefined &&
formik.values != undefined &&
account != null
) {
_checkConditions(
diva,
divaDomain,
formik.values.jsonToExport, // offerCreationStats,
CREATE_POOL_TYPE,
formik.values.signature,
account,
parseUnits(formik.values.yourShare.toString(), decimal)
).then((res) => {
if (!res.success) {
setErrorMessage(res.message)
} else {
setErrorMessage('All good')
}
})
}
}, [formik != undefined && formik.values, account, diva, divaDomain])

// @todo Commented out this useEffect because it was causing problems in Create step 3 for some reason.
// It looked like this function was running although we didn't create an offer and hence formik.values.jsonToExport was undefined
// useEffect(() => {
// if (
// diva != undefined &&
// divaDomain != undefined &&
// formik != undefined &&
// formik.values != undefined &&
// account != null
// ) {
// _checkConditions(
// diva,
// divaDomain,
// formik.values.jsonToExport, // offerCreationStats,
// CREATE_POOL_TYPE,
// formik.values.signature,
// account,
// parseUnits(formik.values.yourShare.toString(), decimal)
// ).then((res) => {
// if (!res.success) {
// setErrorMessage(res.message)
// } else {
// setErrorMessage('All good')
// }
// })
// }
// }, [formik != undefined && formik.values, account, diva, divaDomain])
useEffect(() => {
if (window.innerWidth < 768) {
setMobile(true)
Expand Down
Loading
Loading