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

Feat/simplified distribution script #123

Draft
wants to merge 29 commits into
base: feat/dune
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
42d7ecc
simplified distribution process (feed from file)
alexshchur Oct 6, 2024
7270a7b
force epoch 52
alexshchur Oct 6, 2024
7ea7ad9
add 52 epoch distr src and computed data
alexshchur Oct 6, 2024
c25aa5e
hardcode new distr script to store extended data from dune into exten…
alexshchur Oct 6, 2024
979e4ee
Merge branch 'master' of https://github.com/paraswap/paraswap-volume-…
alexshchur Oct 7, 2024
6ff6330
artefacts and remaining detals for generating 021-52 epoch data
alexshchur Oct 7, 2024
6400a52
remove temporary override to avoid adding sePSP1 transfer to optimism…
alexshchur Oct 11, 2024
81a5527
polish script for generating distribution from file
alexshchur Oct 30, 2024
0f128b1
epoch 53
alexshchur Oct 30, 2024
cb715ad
Merge branch 'master' of https://github.com/paraswap/paraswap-volume-…
alexshchur Oct 30, 2024
6416994
fix: don't cleanup redundantly
alexshchur Oct 30, 2024
a0768ae
fix: epoch 53
alexshchur Oct 30, 2024
bc9f8d9
fix: epoch 53 sorted with scores
alexshchur Oct 30, 2024
d7e67d6
fix: epoch 53 distr command
alexshchur Oct 30, 2024
df187e7
chore: ignore .vscode
alexshchur Oct 30, 2024
705deff
feat: shell script for fetching data from dune
alexshchur Oct 30, 2024
548d6fa
add epoch 53 paths
alexshchur Nov 4, 2024
adf1442
Merge pull request #125 from paraswap/epoch-53
alexshchur Nov 4, 2024
4676b05
build: generate token instead of ssh
ovceev Nov 22, 2024
1ac8dfe
fix typo
ovceev Nov 22, 2024
805459b
Merge branch 'master' of https://github.com/paraswap/paraswap-volume-…
alexshchur Nov 28, 2024
7428d84
54 epoch data
alexshchur Nov 28, 2024
dbd2e52
fix: after PIP-53 don't take into account claimable sepsp1
alexshchur Nov 29, 2024
bf2f3b2
epoch 54 aura rewards
alexshchur Nov 29, 2024
c0ae269
fix: don't add sePSP1 claimable to score (in CSV)
alexshchur Nov 29, 2024
3dc65a5
Merge pull request #126 from paraswap/feat/DVOPS-211
ovceev Dec 2, 2024
eaf9219
add epoch 54 paths to config
alexshchur Dec 24, 2024
c50eb34
Merge branch 'master' of https://github.com/paraswap/paraswap-volume-…
alexshchur Dec 24, 2024
5e4cd37
epoch 024-55 distribution
alexshchur Dec 25, 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
18 changes: 13 additions & 5 deletions .github/workflows/build-and-deploy-grp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,41 @@ on:
options:
- staging
- orders
- referrals

concurrency:
group: ${{ github.event_name }}-${{ github.event.inputs.target_env }}
cancel-in-progress: true

env:
service_name: gas-refund-program
SERVICE_NAME: gas-refund-program
GITHUB_CICD_APP_APP_ID: 1061706

jobs:
build-and-deploy-grp:
name: Build and deploy gas refund program
runs-on: ubuntu-latest

steps:
- name: Generate GitHub App Installation Token
id: installation-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ env.GITHUB_CICD_APP_APP_ID }}
private-key: ${{ secrets.CICD_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Checkout Composite Actions Repository
uses: actions/checkout@v2
with:
repository: paraswap/paraswap-github-actions
ref: master
token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }}
token: ${{ steps.installation-token.outputs.token }}
path: .github/paraswap-github-actions

- name: Build and deploy service using composite action
uses: ./.github/paraswap-github-actions/build-and-deploy-service
with:
service_name: ${{ env.service_name }}
service_name: ${{ env.SERVICE_NAME }}
deploy_service: false
repository_sha: ${{ github.sha}}
event_name: ${{ github.event_name }}
Expand All @@ -57,5 +65,5 @@ jobs:
with:
repository: paraswap/paraswap-github-actions
ref: master
token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }}
token: ${{ steps.installation-token.outputs.token }}
path: .github/paraswap-github-actions
18 changes: 13 additions & 5 deletions .github/workflows/build-and-deploy-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,42 @@ on:
required: false
options:
- staging
- referrals
- orders

concurrency:
group: ${{ github.event_name }}-${{ github.event.inputs.target_env }}-service
cancel-in-progress: true

env:
service_name: volume-tracker
SERVICE_NAME: volume-tracker
GITHUB_CICD_APP_APP_ID: 1061706

jobs:
build-and-deploy-service:
name: Build and deploy service
runs-on: ubuntu-latest

steps:
- name: Generate GitHub App Installation Token
id: installation-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ env.GITHUB_CICD_APP_APP_ID }}
private-key: ${{ secrets.CICD_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Checkout Composite Actions Repository
uses: actions/checkout@v2
with:
repository: paraswap/paraswap-github-actions
ref: master
token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }}
token: ${{ steps.installation-token.outputs.token }}
path: .github/paraswap-github-actions

- name: Build and deploy service using composite action
uses: ./.github/paraswap-github-actions/build-and-deploy-service
with:
service_name: ${{ env.service_name }}
service_name: ${{ env.SERVICE_NAME }}
repository_sha: ${{ github.sha}}
event_name: ${{ github.event_name }}
authentication_token: ${{ secrets.AUTHENTICATION_KEY }}
Expand All @@ -55,5 +63,5 @@ jobs:
with:
repository: paraswap/paraswap-github-actions
ref: master
token: ${{ secrets.PARASWAP_GITHUB_ACTIONS_PAT }}
token: ${{ steps.installation-token.outputs.token }}
path: .github/paraswap-github-actions
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
node_modules

yarn-error.log
Expand Down Expand Up @@ -25,4 +26,6 @@ logs.json
states.json


scripts/gas-refund-program/*.csv
scripts/gas-refund-program/*.csv

.ignored
16,291 changes: 16,291 additions & 0 deletions 020-51-sorted-with-scores.csv

Large diffs are not rendered by default.

16,291 changes: 16,291 additions & 0 deletions 020-51-sorted.csv

Large diffs are not rendered by default.

15,419 changes: 15,419 additions & 0 deletions 021-52-sorted-with-scores.csv

Large diffs are not rendered by default.

15,419 changes: 15,419 additions & 0 deletions 021-52-sorted.csv

Large diffs are not rendered by default.

16,157 changes: 16,157 additions & 0 deletions 022-53-sorted-with-scores.csv

Large diffs are not rendered by default.

16,157 changes: 16,157 additions & 0 deletions 022-53-sorted.csv

Large diffs are not rendered by default.

20,122 changes: 20,122 additions & 0 deletions 023-54-sorted-with-scores.csv

Large diffs are not rendered by default.

20,122 changes: 20,122 additions & 0 deletions 023-54-sorted.csv

Large diffs are not rendered by default.

18,294 changes: 18,294 additions & 0 deletions 024-55-sorted-with-scores.csv

Large diffs are not rendered by default.

18,294 changes: 18,294 additions & 0 deletions 024-55-sorted.csv

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions fetch-from-dune.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
source .env

# Set the base URL
# epoch 020 - 51 = 4129987 # CSV=true bash fetch-from-dune.sh > 020-51-sorted.csv
# epoch 021 - 52 = 4132184 # CSV=true bash fetch-from-dune.sh > 021-52-sorted.csv
# epoch 022 - 53 = 4221949 # CSV=true bash fetch-from-dune.sh > 022-53-sorted.csv
# epoch 023 - 54 = 4343822 # CSV=true bash fetch-from-dune.sh > 023-54-sorted.csv
# epoch 024 - 55 = 4476980 # CSV=true bash fetch-from-dune.sh > 024-55-sorted.csv
BASE_URL="https://api.dune.com/api/v1/query/4476980/results"

# Check if CSV is set to true and modify the URL if necessary
if [ "$CSV" = "true" ]; then
BASE_URL="${BASE_URL}/csv"
curl --request GET \
--url "$BASE_URL" \
-H 'content-type: application/json' \
-H "X-Dune-Api-Key: $DUNE_API_KEY"
else
curl --request GET \
--url "$BASE_URL" \
-H 'content-type: application/json' \
-H "X-Dune-Api-Key: $DUNE_API_KEY"
fi
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"gas-refund:computeDistributionDataAndPersistDB": "patch-package && NODE_ENV=development ts-node scripts/gas-refund-program/distribution/computeDistributionDataAndPersistDB",
"gas-refund:computeDistributionDataAndPersistDB-epoch-47": "DISTRIBUTED_EPOCH=47 yarn gas-refund:computeDistributionDataAndPersistDB",
"gas-refund:computeDistributionDataAndPersistDB-epoch-48": "DISTRIBUTED_EPOCH=48 yarn gas-refund:computeDistributionDataAndPersistDB",
"gas-refund:computeDistributionDataAndPersistDB-epoch-53": "DISTRIBUTED_EPOCH=53 yarn gas-refund:computeDistributionDataAndPersistDB",
"gas-refund:computeDistributionDataAndPersistDB-epoch-54": "DISTRIBUTED_EPOCH=54 yarn gas-refund:computeDistributionDataAndPersistDB",
"gas-refund:computeDistributionDataAndPersistDB-epoch-55": "DISTRIBUTED_EPOCH=55 yarn gas-refund:computeDistributionDataAndPersistDB",
"gas-refund:computeDistributionFilesAndPersistIPFS": "patch-package && NODE_ENV=development ts-node scripts/gas-refund-program/distribution/computeDistributionFilesAndPersistIPFS",
"gas-refund:generate-dune-query": "patch-package && NODE_ENV=development ts-node scripts/gas-refund-program/generate-dune-query",
"gas-refund:index-dune-transactions": "patch-package && NODE_ENV=development NODE_OPTIONS='--max-old-space-size=8200' ts-node scripts/gas-refund-program/index-dune-transactions",
Expand Down
Loading