diff --git a/.dockerignore b/.dockerignore
index 0916c8ecc..6ba1a3dc0 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -3,3 +3,7 @@ apps/**/node_modules/*
tmp/*
.dockerignore
dockerfiles
+node_modules
+.git
+.github
+.vscode
diff --git a/.github/ISSUE_TEMPLATE/release b/.github/ISSUE_TEMPLATE/release
new file mode 100644
index 000000000..336052ddd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/release
@@ -0,0 +1,22 @@
+---
+name: Release
+about:
+ A template to outline the steps needed to for a successful release of our frontend apps
+title: 'Release [add dapp version]-core-[add core version]'
+labels:
+assignees: ''
+---
+
+### Tasks
+
+- [ ] Review [link to core release](xxx)
+- [ ] Tag frontend-monorepo
+- [ ] Create release and generate release notes
+- [ ] Run `@smoke` tests
+- [ ] Run `@regression` tests
+- [ ] Run `@slow` tests
+- [ ] Explorative testing of key flows
+- [ ] Set `release/[network]` to tagged commit
+- [ ] Verify builds (on Netlify and Fleek) are successful
+- [ ] Verify build has been deployed
+- [ ] Smoke testing on deployed app
diff --git a/.github/workflows/cypress-run.yml b/.github/workflows/cypress-run.yml
index 4c5481b76..15f1f896e 100644
--- a/.github/workflows/cypress-run.yml
+++ b/.github/workflows/cypress-run.yml
@@ -1,3 +1,4 @@
+name: Cypress Run
on:
workflow_call:
inputs:
@@ -17,6 +18,7 @@ jobs:
fail-fast: false
matrix:
project: ${{ fromJSON(inputs.projects) }}
+ name: ${{ matrix.project }}
runs-on: self-hosted-runner
timeout-minutes: 30
steps:
diff --git a/.github/workflows/cypress-pr.yml b/.github/workflows/pr-trigger.yml
similarity index 51%
rename from .github/workflows/cypress-pr.yml
rename to .github/workflows/pr-trigger.yml
index dc37d3e3a..b31bd618d 100644
--- a/.github/workflows/cypress-pr.yml
+++ b/.github/workflows/pr-trigger.yml
@@ -1,4 +1,4 @@
-name: Cypress tests - PR
+name: PR Validations
on:
push:
@@ -20,14 +20,16 @@ jobs:
with:
fetch-depth: 0
+ - name: Check node version
+ id: node-version
+ run: |
+ npmVersion=$(cat .nvmrc | head -n 1)
+ echo ::set-output name=npmVersion::${npmVersion}
+
- name: Setup node
uses: actions/setup-node@v3
-
- - name: Remove package.json & yarn.lock to avoid installing everything
- run: rm package.json yarn.lock
-
- - name: Install nx
- run: yarn add nx
+ with:
+ node-version: ${{ steps.node-version.outputs.npmVersion }}
# Check SHAs
- name: Derive appropriate SHAs for base and head for `nx affected` commands
@@ -39,38 +41,51 @@ jobs:
# See affected apps
- name: See affected apps
run: |
+ nx_version=$(cat package.json | grep '"nx"' | cut -d ':' -f 2 | tr -d '",[:space:]')
+ rm package.json yarn.lock
+ yarn add nx@$nx_version
affected=$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)
echo -n "Affected projects: $affected"
- projects=""
- if [[ $affected == *"governance"* ]]; then projects+='"governance-e2e" '; fi
- if [[ $affected == *"trading"* ]]; then projects+='"trading-e2e" '; fi
- if [[ $affected == *"explorer"* ]]; then projects+='"explorer-e2e" '; fi
- if [[ -z "$projects" ]]; then projects+='"governance-e2e" "trading-e2e" "explorer-e2e" '; fi
- projects=${projects%?}
- projects=[${projects// /,}]
- echo PROJECTS=$projects >> $GITHUB_ENV
+ projects_e2e=""
+ if [[ $affected == *"governance"* ]]; then projects_e2e+='"governance-e2e" '; fi
+ if [[ $affected == *"trading"* ]]; then projects_e2e+='"trading-e2e" '; fi
+ if [[ $affected == *"explorer"* ]]; then projects_e2e+='"explorer-e2e" '; fi
+ if [[ -z "$projects_e2e" ]]; then projects_e2e+='"governance-e2e" "trading-e2e" "explorer-e2e" '; fi
+ projects_e2e=${projects_e2e%?}
+ projects_e2e=[${projects_e2e// /,}]
+ echo PROJECTS_E2E=$projects_e2e >> $GITHUB_ENV
+ echo PROJECTS=$(echo $projects_e2e | sed 's|-e2e||g') >> $GITHUB_ENV
outputs:
projects: ${{ env.PROJECTS }}
+ projects-e2e: ${{ env.PROJECTS_E2E }}
- run:
+ run-cypress:
needs: pr
if: ${{ needs.pr.outputs.projects != '[]' }}
uses: ./.github/workflows/cypress-run.yml
secrets: inherit
with:
- projects: ${{ needs.pr.outputs.projects }}
+ projects: ${{ needs.pr.outputs.projects-e2e }}
tags: '@smoke @regression'
+ run-docker-build:
+ needs: pr
+ if: ${{ needs.pr.outputs.projects != '[]' }}
+ uses: ./.github/workflows/publish-docker-containers.yml
+ secrets: inherit
+ with:
+ projects: ${{ needs.pr.outputs.projects }}
+
# Report single result at the end, to avoid mess with required checks in PR
result:
if: ${{ always() }}
- needs: run
+ needs: run-cypress
runs-on: ubuntu-latest
name: Cypress result
steps:
- run: |
- result="${{ needs.run.result }}"
+ result="${{ needs.run-cypress.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
diff --git a/.github/workflows/publish-docker-containers.yml b/.github/workflows/publish-docker-containers.yml
index d1bed4b58..3797feaf6 100644
--- a/.github/workflows/publish-docker-containers.yml
+++ b/.github/workflows/publish-docker-containers.yml
@@ -1,16 +1,19 @@
-name: Publish docker containers
+name: Docker build
-'on':
- pull_request:
+on:
+ workflow_call:
+ inputs:
+ projects:
+ required: true
+ type: string
jobs:
master:
strategy:
fail-fast: false
- # to be replaced by nix: https://github.com/vegaprotocol/frontend-monorepo/blob/develop/tools/ipfs-deploy.js#L106-L108
matrix:
- app: ${{ fromJson('["explorer"]') }}
- name: Build the ${{ matrix.app }} image
+ app: ${{ fromJSON(inputs.projects) }}
+ name: ${{ matrix.app }}
runs-on: ubuntu-latest
steps:
- name: Check out code
@@ -45,13 +48,10 @@ jobs:
- name: Build and export to local Docker
uses: docker/build-push-action@v3
with:
- context: .
- push: false
- file: dockerfiles/Dockerfile
+ load: true
build-args: |
APP=${{ matrix.app }}
NODE_VERSION=${{ steps.tags.outputs.npmVersion }}
- load: true
tags: |
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
@@ -75,9 +75,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v3
with:
- context: .
push: true
- file: dockerfiles/Dockerfile
build-args: |
APP=${{ matrix.app }}
NODE_VERSION=${{ steps.tags.outputs.npmVersion }}
@@ -85,5 +83,12 @@ jobs:
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:latest
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:${{ steps.tags.outputs.version }}
+ - name: Add preview label
+ uses: actions-ecosystem/action-add-labels@v1
+ if: ${{ github.event_name == 'pull_request' }}
+ with:
+ labels: ${{ matrix.app }}-preview
+ number: ${{ github.event.number }}
+
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
diff --git a/dockerfiles/Dockerfile b/Dockerfile
similarity index 83%
rename from dockerfiles/Dockerfile
rename to Dockerfile
index 68be661e6..326e7958d 100644
--- a/dockerfiles/Dockerfile
+++ b/Dockerfile
@@ -4,13 +4,15 @@ FROM --platform=amd64 node:${NODE_VERSION}-alpine3.16 as build
WORKDIR /app
# Argument to allow building of different apps
ARG APP
-ENV PATH /app/node_modules/.bin:$PATH
-COPY package.json ./
-COPY yarn.lock ./
+RUN apk add --update --no-cache \
+ python3 \
+ make \
+ gcc \
+ g++
COPY . ./
-RUN apk add python3 make gcc g++
RUN yarn --network-timeout 100000 --pure-lockfile
-RUN yarn nx build ${APP} --network-timeout 100000 --pure-lockfile
+# work around for different build process in trading
+RUN sh ./docker-build.sh
# Server environment
# if this fails you need to docker pull nginx:1.23-alpine and pin new SHA
@@ -25,7 +27,7 @@ CMD ["/entrypoint.sh"]
# Copy dist
WORKDIR /usr/share/nginx/html
-COPY --from=build /app/dist/apps/${APP} /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
+COPY --from=build /app/dist/apps/${APP} /usr/share/nginx/html
COPY ./apps/${APP}/.env .env
RUN ipfs init && echo "$(ipfs add -rQ .)" > ipfs-hash
diff --git a/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts b/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts
index 1fdee286a..2f9df3041 100644
--- a/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts
+++ b/apps/governance-e2e/src/integration/flow/proposal-forms.cy.ts
@@ -341,7 +341,7 @@ context(
'Currently expected to pass'
);
getProposalInformationFromTable('Expected to pass')
- .contains('đ by Token vote')
+ .contains('đ by token vote')
.should('be.visible');
});
diff --git a/apps/governance/src/i18n/translations/dev.json b/apps/governance/src/i18n/translations/dev.json
index 997a23218..239b02022 100644
--- a/apps/governance/src/i18n/translations/dev.json
+++ b/apps/governance/src/i18n/translations/dev.json
@@ -221,8 +221,9 @@
"votePending": "Casting vote",
"voteError": "Something went wrong, and your vote was not seen by the network",
"back": "back",
- "byTokenVote": "by Token vote",
- "byLiquidityVote": "by Liquidity vote",
+ "byTokenVote": "by token vote",
+ "byLiquidityVote": "by liquidity vote",
+ "byLPVote": "by LP vote",
"youDidNotVote": "Voting has ended. You did not vote",
"voteState_Yes": "For",
"voteState_No": "Against",
diff --git a/apps/governance/src/routes/proposals/components/proposal-votes-table/proposal-votes-table.spec.tsx b/apps/governance/src/routes/proposals/components/proposal-votes-table/proposal-votes-table.spec.tsx
index 0286d3e94..2ee8764df 100644
--- a/apps/governance/src/routes/proposals/components/proposal-votes-table/proposal-votes-table.spec.tsx
+++ b/apps/governance/src/routes/proposals/components/proposal-votes-table/proposal-votes-table.spec.tsx
@@ -86,7 +86,7 @@ describe('Proposal Votes Table', () => {
it('displays if an update market proposal will pass by token vote', () => {
renderComponent(updateMarketProposal, updateMarketProposalType);
- expect(screen.getByText('đ by Token vote')).toBeInTheDocument();
+ expect(screen.getByText('đ by token vote')).toBeInTheDocument();
});
it('displays if an update market proposal will pass by LP vote', () => {
@@ -110,6 +110,6 @@ describe('Proposal Votes Table', () => {
}),
updateMarketProposalType
);
- expect(screen.getByText('đ by Liquidity vote')).toBeInTheDocument();
+ expect(screen.getByText('đ by liquidity vote')).toBeInTheDocument();
});
});
diff --git a/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.spec.tsx b/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.spec.tsx
index 81d353ca8..7bbdbe608 100644
--- a/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.spec.tsx
+++ b/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.spec.tsx
@@ -136,6 +136,82 @@ describe('Proposals list item details', () => {
);
});
+ it('Renders proposal state: Update market proposal - set to pass by LP vote', () => {
+ renderComponent(
+ generateProposal({
+ state: ProposalState.STATE_OPEN,
+ terms: {
+ change: {
+ __typename: 'UpdateMarket',
+ },
+ },
+ votes: {
+ yes: {
+ ...generateYesVotes(0),
+ totalEquityLikeShareWeight: '1000',
+ },
+ no: {
+ ...generateNoVotes(0),
+ totalEquityLikeShareWeight: '0',
+ },
+ },
+ })
+ );
+ expect(screen.getByTestId('vote-status')).toHaveTextContent(
+ 'Set to pass by LP vote'
+ );
+ });
+
+ it('Renders proposal state: Update market proposal - set to pass by token vote', () => {
+ renderComponent(
+ generateProposal({
+ state: ProposalState.STATE_OPEN,
+ terms: {
+ change: {
+ __typename: 'UpdateMarket',
+ },
+ },
+ votes: {
+ yes: {
+ ...generateYesVotes(1000, 1000),
+ totalEquityLikeShareWeight: '0',
+ },
+ no: {
+ ...generateNoVotes(0),
+ totalEquityLikeShareWeight: '0',
+ },
+ },
+ })
+ );
+ expect(screen.getByTestId('vote-status')).toHaveTextContent(
+ 'Set to pass by token vote'
+ );
+ });
+
+ it('Renders proposal state: Update market proposal - set to fail', () => {
+ renderComponent(
+ generateProposal({
+ state: ProposalState.STATE_OPEN,
+ terms: {
+ change: {
+ __typename: 'UpdateMarket',
+ },
+ },
+ votes: {
+ yes: {
+ ...generateYesVotes(0),
+ totalEquityLikeShareWeight: '0',
+ },
+ no: {
+ ...generateNoVotes(0),
+ totalEquityLikeShareWeight: '0',
+ },
+ },
+ })
+ );
+ expect(screen.getByTestId('vote-status')).toHaveTextContent('Set to fail');
+ });
+
it('Renders proposal state: Open - 5 minutes left to vote', () => {
renderComponent(
generateProposal({
diff --git a/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.tsx b/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.tsx
index 0c17acd97..181d58efd 100644
--- a/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.tsx
+++ b/apps/governance/src/routes/proposals/components/proposals-list-item/proposals-list-item-details.tsx
@@ -41,12 +41,22 @@ export const ProposalsListItemDetails = ({
proposal: ProposalFieldsFragment | ProposalQuery['proposal'];
}) => {
const state = proposal?.state;
- const { willPassByTokenVote, majorityMet, participationMet } =
- useVoteInformation({
- proposal,
- });
+ const {
+ willPassByTokenVote,
+ willPassByLPVote,
+ majorityMet,
+ participationMet,
+ } = useVoteInformation({
+ proposal,
+ });
const { t } = useTranslation();
const { voteState } = useUserVote(proposal?.id);
+ const isUpdateMarket = proposal?.terms.change.__typename === 'UpdateMarket';
+ const updateMarketWillPass = willPassByTokenVote || willPassByLPVote;
+ const updateMarketVotePassMethod = willPassByTokenVote
+ ? t('byTokenVote')
+ : t('byLPVote');
+
let proposalStatus: ReactNode;
let voteDetails: ReactNode;
let voteStatus: ReactNode;
@@ -128,6 +138,19 @@ export const ProposalsListItemDetails = ({
>
);
voteStatus =
+ (isUpdateMarket &&
+ (updateMarketWillPass ? (
+ <>
+ {t('Set to')}{' '}
+
+ {t('pass')} {updateMarketVotePassMethod}
+
+ >
+ ) : (
+ <>
+ {t('Set to')} {t('fail')}
+ >
+ ))) ||
(!participationMet && ) ||
(!majorityMet && ) ||
(willPassByTokenVote ? (
diff --git a/apps/governance/src/routes/proposals/components/vote-details/vote-details.tsx b/apps/governance/src/routes/proposals/components/vote-details/vote-details.tsx
index 9a96f3c9e..db91ea186 100644
--- a/apps/governance/src/routes/proposals/components/vote-details/vote-details.tsx
+++ b/apps/governance/src/routes/proposals/components/vote-details/vote-details.tsx
@@ -32,6 +32,7 @@ export const VoteDetails = ({
totalTokensPercentage,
participationMet,
totalTokensVoted,
+ totalLPTokensPercentage,
noPercentage,
noLPPercentage,
yesPercentage,
@@ -41,6 +42,8 @@ export const VoteDetails = ({
requiredMajorityPercentage,
requiredMajorityLPPercentage,
requiredParticipation,
+ requiredParticipationLP,
+ participationLPMet,
} = useVoteInformation({ proposal });
const { t } = useTranslation();
@@ -101,6 +104,25 @@ export const VoteDetails = ({
+
+
+ {t('participation')}
+ {': '}
+ {participationLPMet ? (
+ {t('met')}
+ ) : (
+ {t('notMet')}
+ )}{' '}
+ {formatNumber(totalLPTokensPercentage, defaultDecimals)}%
+
+ {requiredParticipationLP && (
+ <>
+ ({formatNumber(requiredParticipationLP, defaultDecimals)}%{' '}
+ {t('governanceRequired')})
+ >
+ )}
+
+
)}
diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json
index 06695bab6..bf7ae9aaa 100644
--- a/apps/static/src/assets/mainnet-tranches.json
+++ b/apps/static/src/assets/mainnet-tranches.json
@@ -3,21 +3,58 @@
"tranche_id": 55,
"tranche_start": "2023-09-01T00:00:00.000Z",
"tranche_end": "2024-03-01T00:00:00.000Z",
- "total_added": "0",
+ "total_added": "5000",
"total_removed": "0",
- "locked_amount": "0",
- "deposits": [],
+ "locked_amount": "5000",
+ "deposits": [
+ {
+ "amount": "5000",
+ "user": "0xbCDBCC3Ff54D659f2CC737bEf49B10D92dF3FDbf",
+ "tx": "0x6efa10fb97388526382cf9e557833a63c6ce0bcabc4934afc4d1b2d6a12c6659"
+ }
+ ],
"withdrawals": [],
- "users": []
+ "users": [
+ {
+ "address": "0xbCDBCC3Ff54D659f2CC737bEf49B10D92dF3FDbf",
+ "deposits": [
+ {
+ "amount": "5000",
+ "user": "0xbCDBCC3Ff54D659f2CC737bEf49B10D92dF3FDbf",
+ "tranche_id": 55,
+ "tx": "0x6efa10fb97388526382cf9e557833a63c6ce0bcabc4934afc4d1b2d6a12c6659"
+ }
+ ],
+ "withdrawals": [],
+ "total_tokens": "5000",
+ "withdrawn_tokens": "0",
+ "remaining_tokens": "5000"
+ }
+ ]
},
{
"tranche_id": 54,
"tranche_start": "2023-04-06T00:00:00.000Z",
"tranche_end": "2023-05-06T00:00:00.000Z",
- "total_added": "2589",
+ "total_added": "2970",
"total_removed": "0",
- "locked_amount": "2589",
+ "locked_amount": "2970",
"deposits": [
+ {
+ "amount": "33",
+ "user": "0xb5e340788922791727C240c33D27060157845291",
+ "tx": "0xcfe671a77edfb88442fa10e0da70625e2dee1c36815c0f82671219e2ff8d6bde"
+ },
+ {
+ "amount": "60",
+ "user": "0x4081455DB9Ec3B9b66f370Fa12161E6763c40779",
+ "tx": "0xdddd6b792f32b56f79670e6aa195907eca065edd21ab4d4d9f8cb065f54577cd"
+ },
+ {
+ "amount": "288",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tx": "0x09d3e968eb8dbd6851f47b36f7bb9e7d25a078c5c1b23ce5341a66ce19578e65"
+ },
{
"amount": "111",
"user": "0x268070d5EEd5b24E34a5F4C17B5482178b18089D",
@@ -101,6 +138,51 @@
],
"withdrawals": [],
"users": [
+ {
+ "address": "0xb5e340788922791727C240c33D27060157845291",
+ "deposits": [
+ {
+ "amount": "33",
+ "user": "0xb5e340788922791727C240c33D27060157845291",
+ "tranche_id": 54,
+ "tx": "0xcfe671a77edfb88442fa10e0da70625e2dee1c36815c0f82671219e2ff8d6bde"
+ }
+ ],
+ "withdrawals": [],
+ "total_tokens": "33",
+ "withdrawn_tokens": "0",
+ "remaining_tokens": "33"
+ },
+ {
+ "address": "0x4081455DB9Ec3B9b66f370Fa12161E6763c40779",
+ "deposits": [
+ {
+ "amount": "60",
+ "user": "0x4081455DB9Ec3B9b66f370Fa12161E6763c40779",
+ "tranche_id": 54,
+ "tx": "0xdddd6b792f32b56f79670e6aa195907eca065edd21ab4d4d9f8cb065f54577cd"
+ }
+ ],
+ "withdrawals": [],
+ "total_tokens": "60",
+ "withdrawn_tokens": "0",
+ "remaining_tokens": "60"
+ },
+ {
+ "address": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "deposits": [
+ {
+ "amount": "288",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 54,
+ "tx": "0x09d3e968eb8dbd6851f47b36f7bb9e7d25a078c5c1b23ce5341a66ce19578e65"
+ }
+ ],
+ "withdrawals": [],
+ "total_tokens": "288",
+ "withdrawn_tokens": "0",
+ "remaining_tokens": "288"
+ },
{
"address": "0x268070d5EEd5b24E34a5F4C17B5482178b18089D",
"deposits": [
@@ -447,8 +529,8 @@
"tranche_start": "2023-03-06T00:00:00.000Z",
"tranche_end": "2023-04-06T00:00:00.000Z",
"total_added": "14099",
- "total_removed": "123.82076687438",
- "locked_amount": "5795.7870627986847584",
+ "total_removed": "143.78419653368",
+ "locked_amount": "4317.28708968040564483",
"deposits": [
{
"amount": "30",
@@ -1212,6 +1294,11 @@
}
],
"withdrawals": [
+ {
+ "amount": "19.9634296593",
+ "user": "0x47e6217C1667e2B1fD177Ab8fD89037bCEC7dc6C",
+ "tx": "0xc68a9a71f6a8a296e8c90bc748307ce197c444e3ca18129a189b7b462a60eceb"
+ },
{
"amount": "14.85013776876",
"user": "0x6F32AA5A6198329c16e438512F992a0548C856f9",
@@ -2764,10 +2851,17 @@
"tx": "0x819f57b15fef080ab898405133d798a683e5fd805682901e160f5c0187c5fb16"
}
],
- "withdrawals": [],
+ "withdrawals": [
+ {
+ "amount": "19.9634296593",
+ "user": "0x47e6217C1667e2B1fD177Ab8fD89037bCEC7dc6C",
+ "tranche_id": 53,
+ "tx": "0xc68a9a71f6a8a296e8c90bc748307ce197c444e3ca18129a189b7b462a60eceb"
+ }
+ ],
"total_tokens": "30",
- "withdrawn_tokens": "0",
- "remaining_tokens": "30"
+ "withdrawn_tokens": "19.9634296593",
+ "remaining_tokens": "10.0365703407"
},
{
"address": "0xA7f89FF809549F4577993de3d1B3017241a53F40",
@@ -3212,7 +3306,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "86666.297",
"total_removed": "0",
- "locked_amount": "60724.2046685250778505185",
+ "locked_amount": "59952.3205941027057561402",
"deposits": [
{
"amount": "86666.297",
@@ -3278,7 +3372,7 @@
"tranche_end": "2023-06-01T00:00:00.000Z",
"total_added": "2500",
"total_removed": "0",
- "locked_amount": "944.27766966829475",
+ "locked_amount": "899.62336563899075",
"deposits": [
{
"amount": "2500",
@@ -3399,7 +3493,7 @@
"tranche_end": "2023-09-01T00:00:00.000Z",
"total_added": "17500",
"total_removed": "0",
- "locked_amount": "15288.09647368156125",
+ "locked_amount": "14978.9139555656195",
"deposits": [
{
"amount": "12500",
@@ -3665,8 +3759,8 @@
"tranche_start": "2023-02-01T00:00:00.000Z",
"tranche_end": "2023-08-01T00:00:00.000Z",
"total_added": "37500",
- "total_removed": "4333.837380825",
- "locked_amount": "26880.54164748312",
+ "total_removed": "4492.78075095",
+ "locked_amount": "26207.02645411294875",
"deposits": [
{
"amount": "7500",
@@ -3680,6 +3774,11 @@
}
],
"withdrawals": [
+ {
+ "amount": "158.943370125",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tx": "0x9b76b93c59157b6740b91496e48037b239a6ca6db5758804aba9894e02a7eb69"
+ },
{
"amount": "92.587476975",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -3788,6 +3887,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "158.943370125",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tranche_id": 34,
+ "tx": "0x9b76b93c59157b6740b91496e48037b239a6ca6db5758804aba9894e02a7eb69"
+ },
{
"amount": "92.587476975",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -3898,8 +4003,8 @@
}
],
"total_tokens": "7500",
- "withdrawn_tokens": "2058.724198125",
- "remaining_tokens": "5441.275801875"
+ "withdrawn_tokens": "2217.66756825",
+ "remaining_tokens": "5282.33243175"
},
{
"address": "0x0B4e6fcE839B01ef43DA6F890FAC7B1Afb004600",
@@ -3931,7 +4036,7 @@
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "129999.45",
"total_removed": "0",
- "locked_amount": "60668.801472377465776395",
+ "locked_amount": "59897.62164505080734094",
"deposits": [
{
"amount": "129999.45",
@@ -3997,7 +4102,7 @@
"tranche_end": "2023-09-03T00:00:00.000Z",
"total_added": "62600",
"total_removed": "0",
- "locked_amount": "27911.61024226281404",
+ "locked_amount": "27354.070059614405762",
"deposits": [
{
"amount": "10000",
@@ -4190,7 +4295,7 @@
"tranche_end": "2023-09-17T00:00:00.000Z",
"total_added": "5000",
"total_removed": "0",
- "locked_amount": "2421.142662354135",
+ "locked_amount": "2376.6106988838155",
"deposits": [
{
"amount": "5000",
@@ -4401,7 +4506,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "97499.58",
"total_removed": "0",
- "locked_amount": "2732.64431281988066826408",
+ "locked_amount": "1976.1887408628310248306",
"deposits": [
{
"amount": "97499.58",
@@ -4434,7 +4539,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "135173.4239508",
"total_removed": "98230.390980249184455396",
- "locked_amount": "3735.0530042653700851292816472",
+ "locked_amount": "2701.108834006406820430108332",
"deposits": [
{
"amount": "135173.4239508",
@@ -4480,7 +4585,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "32499.86",
"total_removed": "0",
- "locked_amount": "1149.57627216016711597184",
+ "locked_amount": "831.348476326834519302",
"deposits": [
{
"amount": "32499.86",
@@ -4513,7 +4618,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "10833.29",
"total_removed": "0",
- "locked_amount": "374.1759213640386884894",
+ "locked_amount": "270.59586182972489332628",
"deposits": [
{
"amount": "10833.29",
@@ -4546,7 +4651,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "22749.93",
"total_removed": "4720.860935375",
- "locked_amount": "1398.7531647414908909613",
+ "locked_amount": "1011.5477680137440929101",
"deposits": [
{
"amount": "6500",
@@ -4697,8 +4802,8 @@
"tranche_start": "2022-11-01T00:00:00.000Z",
"tranche_end": "2023-05-01T00:00:00.000Z",
"total_added": "22500",
- "total_removed": "5870.8788942",
- "locked_amount": "4691.860900092081",
+ "total_removed": "6029.8222644",
+ "locked_amount": "4287.751784069981625",
"deposits": [
{
"amount": "7500",
@@ -4712,6 +4817,11 @@
}
],
"withdrawals": [
+ {
+ "amount": "158.9433702",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tx": "0x4fa181368c0dc03d6e81dfb94e9b00edc7a4b5b44ea1354dcd03db1e58a060a6"
+ },
{
"amount": "92.593232025",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -4875,6 +4985,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "158.9433702",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tranche_id": 33,
+ "tx": "0x4fa181368c0dc03d6e81dfb94e9b00edc7a4b5b44ea1354dcd03db1e58a060a6"
+ },
{
"amount": "92.593232025",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -5057,8 +5173,8 @@
}
],
"total_tokens": "7500",
- "withdrawn_tokens": "5870.8788942",
- "remaining_tokens": "1629.1211058"
+ "withdrawn_tokens": "6029.8222644",
+ "remaining_tokens": "1470.1777356"
},
{
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
@@ -5083,7 +5199,7 @@
"tranche_end": "2023-06-02T00:00:00.000Z",
"total_added": "1939928.38",
"total_removed": "928642.9598472029154",
- "locked_amount": "370677.339230840227894438",
+ "locked_amount": "353399.575280201010750956",
"deposits": [
{
"amount": "1852091.69",
@@ -6394,7 +6510,7 @@
"tranche_start": "2021-09-05T00:00:00.000Z",
"tranche_end": "2022-09-30T00:00:00.000Z",
"total_added": "60916.66666633337",
- "total_removed": "39354.939349357864974364",
+ "total_removed": "41621.606016024534974364",
"locked_amount": "0",
"deposits": [
{
@@ -6499,6 +6615,11 @@
"user": "0x832cfD8fD4a1791b5eF5BD18a677beb7731Aa18E",
"tx": "0x98f1e1e3dd3a0ef2fe25ccb9e7222b29c1a5136b52255a1b492b330adbfc6b66"
},
+ {
+ "amount": "2266.66666666667",
+ "user": "0xb14025f7eB7717cFF43e7a33b66d86eaBd6bC7d7",
+ "tx": "0xef8ce06531f6f6e7013f0da7a7810fbb9f43f36a9718a144003290dce2461a74"
+ },
{
"amount": "3395.631843574",
"user": "0xa0fF757077B5D796259582b2b9Db99c906277007",
@@ -7172,10 +7293,17 @@
"tx": "0x9cb4b7fe8f0e02758942b72d9e27fc372dc96d7777484af884af1bfec0beaa9c"
}
],
- "withdrawals": [],
+ "withdrawals": [
+ {
+ "amount": "2266.66666666667",
+ "user": "0xb14025f7eB7717cFF43e7a33b66d86eaBd6bC7d7",
+ "tranche_id": 13,
+ "tx": "0xef8ce06531f6f6e7013f0da7a7810fbb9f43f36a9718a144003290dce2461a74"
+ }
+ ],
"total_tokens": "2266.66666666667",
- "withdrawn_tokens": "0",
- "remaining_tokens": "2266.66666666667"
+ "withdrawn_tokens": "2266.66666666667",
+ "remaining_tokens": "0"
},
{
"address": "0xa787A56c43847A3B5a0110d0B5E004E47F57B22e",
@@ -7495,7 +7623,7 @@
"tranche_start": "2021-09-05T00:00:00.000Z",
"tranche_end": "2021-09-05T00:00:00.000Z",
"total_added": "10750",
- "total_removed": "8650",
+ "total_removed": "9050",
"locked_amount": "0",
"deposits": [
{
@@ -7595,6 +7723,11 @@
}
],
"withdrawals": [
+ {
+ "amount": "400",
+ "user": "0xb14025f7eB7717cFF43e7a33b66d86eaBd6bC7d7",
+ "tx": "0x4556da7162d753457aa752421dedd3bd322c51a55c4b6a25e44f6f3d68271bee"
+ },
{
"amount": "2500",
"user": "0xDFaF6D0a0102ea5e4688F95Eb22Dc353751a7563",
@@ -7902,10 +8035,17 @@
"tx": "0xba1f27b434cae9a43f7040ed184b85944b995cf034e2c58542fb4d10c3d8c2a8"
}
],
- "withdrawals": [],
+ "withdrawals": [
+ {
+ "amount": "400",
+ "user": "0xb14025f7eB7717cFF43e7a33b66d86eaBd6bC7d7",
+ "tranche_id": 14,
+ "tx": "0x4556da7162d753457aa752421dedd3bd322c51a55c4b6a25e44f6f3d68271bee"
+ }
+ ],
"total_tokens": "400",
- "withdrawn_tokens": "0",
- "remaining_tokens": "400"
+ "withdrawn_tokens": "400",
+ "remaining_tokens": "0"
},
{
"address": "0xa787A56c43847A3B5a0110d0B5E004E47F57B22e",
@@ -10525,10 +10665,25 @@
"tranche_id": 11,
"tranche_start": "2021-09-03T00:00:00.000Z",
"tranche_end": "2022-09-03T00:00:00.000Z",
- "total_added": "57058.000000000000000003",
+ "total_added": "57188.000000000000000003",
"total_removed": "48157.21518131551",
"locked_amount": "0",
"deposits": [
+ {
+ "amount": "35",
+ "user": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
+ "tx": "0x9ab57768a7d30d87e35284719202ce92878929d34e12c307010406874a7692ea"
+ },
+ {
+ "amount": "20",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tx": "0xf6c1bfbe1cef84d279f408a3f90f5e684308f7ccd0b9c1401aa16295f0838ae7"
+ },
+ {
+ "amount": "75",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tx": "0x971e9bcaace01278dc20ecd83d5de588d15be22c1797f4934cfd2ffb357a95ef"
+ },
{
"amount": "150",
"user": "0xEb01fF124D71b6C7E6613fd6E0A86c28C733F008",
@@ -22173,6 +22328,150 @@
}
],
"users": [
+ {
+ "address": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
+ "deposits": [
+ {
+ "amount": "35",
+ "user": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
+ "tranche_id": 11,
+ "tx": "0x9ab57768a7d30d87e35284719202ce92878929d34e12c307010406874a7692ea"
+ },
+ {
+ "amount": "20",
+ "user": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
+ "tranche_id": 11,
+ "tx": "0x94ed5d3d59ce96109b2ab2616e4871c17772a8fd8fb634d97f0dd6bdef6e12e8"
+ },
+ {
+ "amount": "20",
+ "user": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
+ "tranche_id": 11,
+ "tx": "0x2d658ba8dc7bccaef7e341be32f899f4e25b3cfc29a8732e652346f76a53f137"
+ }
+ ],
+ "withdrawals": [],
+ "total_tokens": "75",
+ "withdrawn_tokens": "0",
+ "remaining_tokens": "75"
+ },
+ {
+ "address": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "deposits": [
+ {
+ "amount": "20",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0xf6c1bfbe1cef84d279f408a3f90f5e684308f7ccd0b9c1401aa16295f0838ae7"
+ },
+ {
+ "amount": "75",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x971e9bcaace01278dc20ecd83d5de588d15be22c1797f4934cfd2ffb357a95ef"
+ },
+ {
+ "amount": "10",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0xa925b6e68d020e0229435b0315d1600a7f1a0979047a8fdd5ce68be4e3133bff"
+ },
+ {
+ "amount": "20",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0xd7900f21b16a662d7b52528abfcfd530fa2a36837ba03aa4508f0d7470d41851"
+ },
+ {
+ "amount": "20",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x2535a7ad6185978f693d9836c4fdf02e9f67b622142ae6e218e512e0410e20c8"
+ },
+ {
+ "amount": "15",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x54683260e4cfefbbd4b19a8e973cb8e0bfca6a87455d5eafc10e61a1cf89705b"
+ },
+ {
+ "amount": "35",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0xa648509884bf256ec83b34ab58cbea958da2bf0e70d69e2cf059f9e924c35cf1"
+ },
+ {
+ "amount": "25",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x5007620d4335f224e07ebabc48404e47fb8951053c9f4512544cc1b4ac33655c"
+ },
+ {
+ "amount": "70",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x2d3199ebbb0ae7103561e872185835d65cd07fe9ca3bce74e04427730cc4cbc7"
+ },
+ {
+ "amount": "20",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x5d82589c472077619ddf78fda7159380ab6aa1a55e970240e4fc98a604a787a9"
+ },
+ {
+ "amount": "40",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x3f246c6fd3c2d384af26f7cf79fe4fac06dcf302437497e1811bf1bdacc3be9f"
+ },
+ {
+ "amount": "30",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x60efa9a39a6aaeedeb9f53bbe8ccb3a740f927f49bb4bd5098464ea6871cbb7e"
+ },
+ {
+ "amount": "30",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0xbf9559ff78c35913a0e6cf66c3047e7db10581b9ae053e974e5316511a3597a3"
+ },
+ {
+ "amount": "10",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x2181c9e667a9ced6e635bf55d6baf99c618a074c8396dfa9babc188d117bd52e"
+ },
+ {
+ "amount": "25",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x33adca302b3a2de09970750557f5e8f334c8687aad15a6edeb73c6f87e825666"
+ },
+ {
+ "amount": "5",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x0175bbc619a914aa3fd3a251b94f274e4ea35fb61b3db0b6f692dcc94ecab33d"
+ },
+ {
+ "amount": "10",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0x385a9cdbafcf70b921cdf6d719ec2656e84a3809da3bb92e581599793db196b1"
+ },
+ {
+ "amount": "12",
+ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
+ "tranche_id": 11,
+ "tx": "0xa61e5231fed98c0cd79e7d4b6a5436b4d1e2276c85e73b86ac161b2b07271e2b"
+ }
+ ],
+ "withdrawals": [],
+ "total_tokens": "472",
+ "withdrawn_tokens": "0",
+ "remaining_tokens": "472"
+ },
{
"address": "0xEb01fF124D71b6C7E6613fd6E0A86c28C733F008",
"deposits": [
@@ -24899,27 +25198,6 @@
"withdrawn_tokens": "0",
"remaining_tokens": "25"
},
- {
- "address": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
- "deposits": [
- {
- "amount": "20",
- "user": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
- "tranche_id": 11,
- "tx": "0x94ed5d3d59ce96109b2ab2616e4871c17772a8fd8fb634d97f0dd6bdef6e12e8"
- },
- {
- "amount": "20",
- "user": "0xf9c6C5F942B94Db9dedC550956865cf99D743959",
- "tranche_id": 11,
- "tx": "0x2d658ba8dc7bccaef7e341be32f899f4e25b3cfc29a8732e652346f76a53f137"
- }
- ],
- "withdrawals": [],
- "total_tokens": "40",
- "withdrawn_tokens": "0",
- "remaining_tokens": "40"
- },
{
"address": "0x871203d701855E9cb85183aa426761caD7Dd7b22",
"deposits": [
@@ -26173,111 +26451,6 @@
"withdrawn_tokens": "511",
"remaining_tokens": "0"
},
- {
- "address": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "deposits": [
- {
- "amount": "10",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0xa925b6e68d020e0229435b0315d1600a7f1a0979047a8fdd5ce68be4e3133bff"
- },
- {
- "amount": "20",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0xd7900f21b16a662d7b52528abfcfd530fa2a36837ba03aa4508f0d7470d41851"
- },
- {
- "amount": "20",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x2535a7ad6185978f693d9836c4fdf02e9f67b622142ae6e218e512e0410e20c8"
- },
- {
- "amount": "15",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x54683260e4cfefbbd4b19a8e973cb8e0bfca6a87455d5eafc10e61a1cf89705b"
- },
- {
- "amount": "35",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0xa648509884bf256ec83b34ab58cbea958da2bf0e70d69e2cf059f9e924c35cf1"
- },
- {
- "amount": "25",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x5007620d4335f224e07ebabc48404e47fb8951053c9f4512544cc1b4ac33655c"
- },
- {
- "amount": "70",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x2d3199ebbb0ae7103561e872185835d65cd07fe9ca3bce74e04427730cc4cbc7"
- },
- {
- "amount": "20",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x5d82589c472077619ddf78fda7159380ab6aa1a55e970240e4fc98a604a787a9"
- },
- {
- "amount": "40",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x3f246c6fd3c2d384af26f7cf79fe4fac06dcf302437497e1811bf1bdacc3be9f"
- },
- {
- "amount": "30",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x60efa9a39a6aaeedeb9f53bbe8ccb3a740f927f49bb4bd5098464ea6871cbb7e"
- },
- {
- "amount": "30",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0xbf9559ff78c35913a0e6cf66c3047e7db10581b9ae053e974e5316511a3597a3"
- },
- {
- "amount": "10",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x2181c9e667a9ced6e635bf55d6baf99c618a074c8396dfa9babc188d117bd52e"
- },
- {
- "amount": "25",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x33adca302b3a2de09970750557f5e8f334c8687aad15a6edeb73c6f87e825666"
- },
- {
- "amount": "5",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x0175bbc619a914aa3fd3a251b94f274e4ea35fb61b3db0b6f692dcc94ecab33d"
- },
- {
- "amount": "10",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0x385a9cdbafcf70b921cdf6d719ec2656e84a3809da3bb92e581599793db196b1"
- },
- {
- "amount": "12",
- "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C",
- "tranche_id": 11,
- "tx": "0xa61e5231fed98c0cd79e7d4b6a5436b4d1e2276c85e73b86ac161b2b07271e2b"
- }
- ],
- "withdrawals": [],
- "total_tokens": "377",
- "withdrawn_tokens": "0",
- "remaining_tokens": "377"
- },
{
"address": "0x0436E2E4EA467f9958403dc56635404EE1bb1E94",
"deposits": [
@@ -38717,7 +38890,7 @@
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "3732368.4671",
"total_removed": "700133.348465855088393",
- "locked_amount": "594103.338984773529531250813",
+ "locked_amount": "567553.33674442327201243239",
"deposits": [
{
"amount": "1998.95815",
@@ -40098,8 +40271,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-12-05T00:00:00.000Z",
"total_added": "15870102.715470999700000001",
- "total_removed": "809371.09849506346247952",
- "locked_amount": "7406339.8806006379597424087390267326858611",
+ "total_removed": "811190.94573738377022952",
+ "locked_amount": "7312195.27732943035628880483248801894971615",
"deposits": [
{
"amount": "16249.93",
@@ -40603,6 +40776,11 @@
}
],
"withdrawals": [
+ {
+ "amount": "998.454771147362375",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tx": "0x58aa740f4eaf17c0c60c22587b34db0dfd670c968d3affb614fee9b917f0b53c"
+ },
{
"amount": "545.4204142199725",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -40673,6 +40851,11 @@
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
"tx": "0x3f6601148f443f36af0053f3de6db76410e94a4597e4ef2d315ff13f02d600ed"
},
+ {
+ "amount": "821.392471172945375",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tx": "0xb99c431c031e6842ae2b4c1c9de525db71584c587af717a2c9785a10aaf0876a"
+ },
{
"amount": "827.191309560501875",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -42586,6 +42769,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "998.454771147362375",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tranche_id": 2,
+ "tx": "0x58aa740f4eaf17c0c60c22587b34db0dfd670c968d3affb614fee9b917f0b53c"
+ },
{
"amount": "545.4204142199725",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -42640,6 +42829,12 @@
"tranche_id": 2,
"tx": "0x3f6601148f443f36af0053f3de6db76410e94a4597e4ef2d315ff13f02d600ed"
},
+ {
+ "amount": "821.392471172945375",
+ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
+ "tranche_id": 2,
+ "tx": "0xb99c431c031e6842ae2b4c1c9de525db71584c587af717a2c9785a10aaf0876a"
+ },
{
"amount": "827.191309560501875",
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
@@ -43956,8 +44151,8 @@
}
],
"total_tokens": "259998.8875",
- "withdrawn_tokens": "137915.118093302356125",
- "remaining_tokens": "122083.769406697643875"
+ "withdrawn_tokens": "139734.965335622663875",
+ "remaining_tokens": "120263.922164377336125"
},
{
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
@@ -46302,8 +46497,8 @@
"tranche_start": "2021-11-05T00:00:00.000Z",
"tranche_end": "2023-05-05T00:00:00.000Z",
"total_added": "14597706.0446472999",
- "total_removed": "5741287.052339708549890506",
- "locked_amount": "1116040.46155356151405766963859435",
+ "total_removed": "5781272.031584311406488996",
+ "locked_amount": "1029126.764932550789662065977913855",
"deposits": [
{
"amount": "129284.449",
@@ -46512,6 +46707,16 @@
}
],
"withdrawals": [
+ {
+ "amount": "37462.74710421168752574",
+ "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
+ "tx": "0x4eb2ed2540197b432b08d7ed69ab17a69909e2055f645ce8a0922c1a29ffeec8"
+ },
+ {
+ "amount": "1383.345213676043696",
+ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
+ "tx": "0xab861da5aece3737a3d6b9d8ac61fd11f864aefa410287e00357497f1c859081"
+ },
{
"amount": "755.482067130393772",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -46557,6 +46762,11 @@
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
"tx": "0x36626f456dde1810dbd9499b2ec50666d2ea0fee2870eb7d6aee3a34a6ca17d8"
},
+ {
+ "amount": "1138.88692671512537675",
+ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
+ "tx": "0x65c9680ce66174f33508046f521d97e062dc8271e6147afc600aab7cd3752fbe"
+ },
{
"amount": "1147.2913244855584015",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -49637,6 +49847,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "1383.345213676043696",
+ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
+ "tranche_id": 3,
+ "tx": "0xab861da5aece3737a3d6b9d8ac61fd11f864aefa410287e00357497f1c859081"
+ },
{
"amount": "755.482067130393772",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -49691,6 +49907,12 @@
"tranche_id": 3,
"tx": "0x36626f456dde1810dbd9499b2ec50666d2ea0fee2870eb7d6aee3a34a6ca17d8"
},
+ {
+ "amount": "1138.88692671512537675",
+ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
+ "tranche_id": 3,
+ "tx": "0x65c9680ce66174f33508046f521d97e062dc8271e6147afc600aab7cd3752fbe"
+ },
{
"amount": "1147.2913244855584015",
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
@@ -52309,8 +52531,8 @@
}
],
"total_tokens": "359123.469575",
- "withdrawn_tokens": "330632.652903643461293",
- "remaining_tokens": "28490.816671356538707"
+ "withdrawn_tokens": "333154.88504403463036575",
+ "remaining_tokens": "25968.58453096536963425"
},
{
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
@@ -52540,6 +52762,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "37462.74710421168752574",
+ "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
+ "tranche_id": 3,
+ "tx": "0x4eb2ed2540197b432b08d7ed69ab17a69909e2055f645ce8a0922c1a29ffeec8"
+ },
{
"amount": "80421.5336580481619385",
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
@@ -52872,8 +53100,8 @@
}
],
"total_tokens": "1266324.603486",
- "withdrawn_tokens": "1135136.99412579103610352",
- "remaining_tokens": "131187.60936020896389648"
+ "withdrawn_tokens": "1172599.74123000272362926",
+ "remaining_tokens": "93724.86225599727637074"
},
{
"address": "0xC5d9221EB9c28A69859264c0A2Fe0d3272228296",
@@ -53702,7 +53930,7 @@
"tranche_end": "2023-04-05T00:00:00.000Z",
"total_added": "5778205.3912159303",
"total_removed": "3381706.364737906998719578",
- "locked_amount": "124050.932576147867629933320815002",
+ "locked_amount": "89710.8053915257113869983245366295",
"deposits": [
{
"amount": "552496.6455",
@@ -55829,8 +56057,8 @@
"tranche_start": "2022-06-05T00:00:00.000Z",
"tranche_end": "2023-06-05T00:00:00.000Z",
"total_added": "472355.6199999996",
- "total_removed": "38626.7020917017949",
- "locked_amount": "94139.070101605092207961151395212",
+ "total_removed": "38818.1373783577949",
+ "locked_amount": "89932.07048033860228826051293758",
"deposits": [
{
"amount": "3000",
@@ -62449,6 +62677,16 @@
}
],
"withdrawals": [
+ {
+ "amount": "19.918569252",
+ "user": "0xcB555C5602cC0b2434A27d277e14Cb5C7bF4Ead1",
+ "tx": "0x9d4c99fdeee2d95caee8d6725f6796f8e02f8a9fd2d911a8e151b2665e192ebc"
+ },
+ {
+ "amount": "150.571816336",
+ "user": "0xF5037DDA4A660d67560200f45380FF8364e35540",
+ "tx": "0xffc827a0984694ac0243552d0fa4267513471426f6ec34596fd57cfd9d9390e7"
+ },
{
"amount": "154.812094114",
"user": "0x27e2254A2A8c9c9D1321E5Fe64cAD88e7A4f0ba7",
@@ -62539,6 +62777,11 @@
"user": "0xdF99e2a50f8a5568Ff66ce4639810d346C29f6be",
"tx": "0x9f3057fbc86a61fcb4211ca7a2062673f759fb529a30e545c8d8404cd57afa9e"
},
+ {
+ "amount": "20.944901068",
+ "user": "0x7C8D2D8BcFffcD48dBcb65C5Bb7588B66dcD22bb",
+ "tx": "0x31aa4c19d0ccd6e4584678574dc74419a619970449ec65d15f232dcd880d1f5e"
+ },
{
"amount": "129.867928716",
"user": "0x09996E1a67c371400bD5f52DF841f77B1741eB9d",
@@ -76840,6 +77083,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "20.944901068",
+ "user": "0x7C8D2D8BcFffcD48dBcb65C5Bb7588B66dcD22bb",
+ "tranche_id": 5,
+ "tx": "0x31aa4c19d0ccd6e4584678574dc74419a619970449ec65d15f232dcd880d1f5e"
+ },
{
"amount": "34.404414004",
"user": "0x7C8D2D8BcFffcD48dBcb65C5Bb7588B66dcD22bb",
@@ -76884,8 +77133,8 @@
}
],
"total_tokens": "400",
- "withdrawn_tokens": "299.949606796",
- "remaining_tokens": "100.050393204"
+ "withdrawn_tokens": "320.894507864",
+ "remaining_tokens": "79.105492136"
},
{
"address": "0xc56F9f1d5f124655FA9CB8f85C7701E13a2fBF4D",
@@ -81047,6 +81296,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "19.918569252",
+ "user": "0xcB555C5602cC0b2434A27d277e14Cb5C7bF4Ead1",
+ "tranche_id": 5,
+ "tx": "0x9d4c99fdeee2d95caee8d6725f6796f8e02f8a9fd2d911a8e151b2665e192ebc"
+ },
{
"amount": "19.74474886",
"user": "0xcB555C5602cC0b2434A27d277e14Cb5C7bF4Ead1",
@@ -81079,8 +81334,8 @@
}
],
"total_tokens": "400",
- "withdrawn_tokens": "302.857825976",
- "remaining_tokens": "97.142174024"
+ "withdrawn_tokens": "322.776395228",
+ "remaining_tokens": "77.223604772"
},
{
"address": "0x3738bec36216eA2F11B954891C65AAd1Bc852156",
@@ -84632,6 +84887,12 @@
}
],
"withdrawals": [
+ {
+ "amount": "150.571816336",
+ "user": "0xF5037DDA4A660d67560200f45380FF8364e35540",
+ "tranche_id": 5,
+ "tx": "0xffc827a0984694ac0243552d0fa4267513471426f6ec34596fd57cfd9d9390e7"
+ },
{
"amount": "11.163032724",
"user": "0xF5037DDA4A660d67560200f45380FF8364e35540",
@@ -84640,8 +84901,8 @@
}
],
"total_tokens": "200",
- "withdrawn_tokens": "11.163032724",
- "remaining_tokens": "188.836967276"
+ "withdrawn_tokens": "161.73484906",
+ "remaining_tokens": "38.26515094"
},
{
"address": "0x2843a3A61C7a129e432455c02101Cec3fA428E60",
diff --git a/apps/trading-e2e/src/integration/capsule.cy.ts b/apps/trading-e2e/src/integration/capsule.cy.ts
index e537cacac..bc92fc6c9 100644
--- a/apps/trading-e2e/src/integration/capsule.cy.ts
+++ b/apps/trading-e2e/src/integration/capsule.cy.ts
@@ -135,7 +135,7 @@ describe('capsule - without MultiSign', { tags: '@slow' }, () => {
cy.getByTestId(transferForm).find(submitTransferBtn).click();
cy.getByTestId(toastContent).should(
'contain.text',
- 'Transfer completeYour transaction has been confirmed TransferTo 7f9cf0âŚc255351.00 tBTC'
+ 'Transfer completeYour transaction has been confirmed View in block explorerTransferTo 7f9cf0âŚc255351.00 tBTC'
);
cy.getByTestId(toastCloseBtn).click();
});
@@ -283,7 +283,7 @@ describe('capsule', { tags: '@slow' }, () => {
});
});
// comment because of bug #2695
- it.skip('can edit order', function () {
+ it('can edit order', function () {
cy.getByTestId(ordersTab).click();
cy.getByTestId('edit').first().should('be.visible').click();
cy.getByTestId('dialog-title').should('contain.text', 'Edit order');
@@ -422,7 +422,11 @@ describe('capsule', { tags: '@slow' }, () => {
cy.getByTestId(depositSubmit).click();
cy.getByTestId('input-error-text').should(
'contain.text',
- 'Amount is above approved amount.Update approve amount'
+ 'Amount is above approved amount'
+ );
+ cy.getByTestId('reapprove-default').should(
+ 'contain.text',
+ 'Approve again to deposit more than'
);
});
@@ -437,9 +441,11 @@ describe('capsule', { tags: '@slow' }, () => {
cy.getByTestId('deposit-button').click();
connectEthereumWallet('Unknown');
cy.get(assetSelectField, txTimeout).select(vegaName, { force: true });
- cy.getByTestId('deposit-submit').click();
- cy.getByTestId('dialog-title').should('contain.text', 'Approve complete');
- cy.get('[data-testid="Return to deposit"]').click();
+ cy.getByTestId('approve-submit').click();
+ cy.getByTestId('approve-confirmed').should(
+ 'contain.text',
+ 'You can now make deposits in VEGA, up to a maximum of'
+ );
cy.get(amountField).clear().type('10000');
cy.getByTestId('deposit-submit').click();
cy.getByTestId(toastContent, txTimeout).should(
@@ -447,7 +453,7 @@ describe('capsule', { tags: '@slow' }, () => {
`Your transaction has been confirmed.`,
{ matchCase: false }
);
- cy.getByTestId(toastCloseBtn).click();
+ cy.getByTestId(toastCloseBtn).click({ multiple: true });
cy.getByTestId('Collateral').click();
cy.highlight('deposit verification');
diff --git a/apps/trading/components/welcome-dialog/welcome-landing-dialog.tsx b/apps/trading/components/welcome-dialog/welcome-landing-dialog.tsx
index b65f0cbe3..32e93258b 100644
--- a/apps/trading/components/welcome-dialog/welcome-landing-dialog.tsx
+++ b/apps/trading/components/welcome-dialog/welcome-landing-dialog.tsx
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
import { useMarketList } from '@vegaprotocol/market-list';
import { t } from '@vegaprotocol/i18n';
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
-import { Link as UILink } from '@vegaprotocol/ui-toolkit';
+import { Link as UILink, TinyScroll } from '@vegaprotocol/ui-toolkit';
import type { OnCellClickHandler } from '../select-market';
import type { MarketMaybeWithDataAndCandles } from '@vegaprotocol/market-list';
import {
@@ -55,8 +55,8 @@ export const SelectMarketLandingTable = ({
const showProposed = (markets?.length || 0) <= 5;
return (
<>
-
@@ -78,7 +78,7 @@ export const SelectMarketLandingTable = ({
))}
-
+
{
<>
{t('Awaiting confirmation')}
{t('Please wait for your transaction to be confirmed.')}
- {tx.txHash &&
}
+ {tx.txHash && (
+
{t('View on Etherscan')}
+ )}
>
);
@@ -131,7 +133,9 @@ const EthTxConfirmedToastContent = ({ tx }: EthTxToastContentProps) => {
<>
{t('Transaction confirmed')}
{t('Your transaction has been confirmed.')}
- {tx.txHash &&
}
+ {tx.txHash && (
+
{t('View on Etherscan')}
+ )}
>
);
@@ -148,7 +152,9 @@ const EthTxCompletedToastContent = ({ tx }: EthTxToastContentProps) => {
{t('Your transaction has been completed.')}{' '}
{isDeposit && t('Waiting for deposit confirmation.')}
- {tx.txHash &&
}
+ {tx.txHash && (
+
{t('View on Etherscan')}
+ )}
>
);
diff --git a/docker-build.sh b/docker-build.sh
new file mode 100755
index 000000000..2a4772948
--- /dev/null
+++ b/docker-build.sh
@@ -0,0 +1,10 @@
+#!/bin/sh -eux
+export PATH="/app/node_modules/.bin:$PATH"
+if [ "${APP}" = "trading" ]; then
+ yarn nx export ${APP} --network-timeout 100000 --pure-lockfile
+ mv /app/dist/apps/trading/exported/ /app/tmp
+ rm -rf /app/dist/apps/trading
+ mv /app/tmp /app/dist/apps/trading
+else
+ yarn nx build ${APP} --network-timeout 100000 --pure-lockfile
+fi
diff --git a/entrypoint.sh b/entrypoint.sh
index c6b1bd5b1..5360cbd08 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -7,6 +7,10 @@ mkdir -p $(dirname $env_file)
rm -rf $env_file || echo "no file to delete"
touch $env_file
+env_vars_file=/usr/share/nginx/html/.env
+sed -i '/^#/d' $env_vars_file # remove comment lines
+sed -i '/^$/d' $env_vars_file # remove empty lines
+
# Add assignment
echo "window._env_ = {" >> $env_file
@@ -29,7 +33,9 @@ do
if [ ! -z "$varname" ]; then
echo " $varname: \"$value\"," >> $env_file
fi
-done < /usr/share/nginx/html/.env
+done < $env_vars_file
+
+rm $env_vars_file
echo "}" >> $env_file
diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx
index d5f0c060a..3873bfde3 100644
--- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx
+++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket.tsx
@@ -20,6 +20,7 @@ import {
InputError,
Intent,
Notification,
+ TinyScroll,
} from '@vegaprotocol/ui-toolkit';
import {
@@ -160,136 +161,140 @@ export const DealTicket = ({
if (!order || !normalizedOrder) return null;
return (
-
+
+
+
);
};
diff --git a/libs/deposits/src/lib/approve-notification.tsx b/libs/deposits/src/lib/approve-notification.tsx
index a3141f5a9..afe713d2a 100644
--- a/libs/deposits/src/lib/approve-notification.tsx
+++ b/libs/deposits/src/lib/approve-notification.tsx
@@ -16,6 +16,7 @@ interface ApproveNotificationProps {
balances: DepositBalances | null;
amount: string;
approveTxId: number | null;
+ intent?: Intent;
}
export const ApproveNotification = ({
@@ -26,6 +27,7 @@ export const ApproveNotification = ({
balances,
approved,
approveTxId,
+ intent = Intent.Warning,
}: ApproveNotificationProps) => {
const tx = useEthTransactionStore((state) => {
return state.transactions.find((t) => t?.id === approveTxId);
@@ -46,7 +48,7 @@ export const ApproveNotification = ({
const approvePrompt = (
store.open);
const { isActive, account } = useWeb3React();
const { pubKey, pubKeys: _pubKeys } = useVegaWallet();
+ const [approveNotificationIntent, setApproveNotificationIntent] =
+ useState(Intent.Warning);
const {
register,
handleSubmit,
@@ -103,8 +105,10 @@ export const DepositForm = ({
if (!selectedAsset || selectedAsset.source.__typename !== 'ERC20') {
throw new Error('Invalid asset');
}
- if (!approved) throw new Error('Deposits not approved');
-
+ if (!approved) {
+ setApproveNotificationIntent(Intent.Danger);
+ return;
+ }
submitDeposit({
assetSource: selectedAsset.source.contractAddress,
amount: fields.amount,
@@ -219,7 +223,7 @@ export const DepositForm = ({
{errors.asset.message}
)}
- {isFaucetable && selectedAsset && (
+ {isActive && isFaucetable && selectedAsset && (
{t(`Get ${selectedAsset.symbol}`)}
@@ -355,9 +359,13 @@ export const DepositForm = ({
isActive={isActive}
approveTxId={approveTxId}
selectedAsset={selectedAsset}
- onApprove={submitApprove}
+ onApprove={() => {
+ submitApprove();
+ setApproveNotificationIntent(Intent.Warning);
+ }}
balances={balances}
approved={approved}
+ intent={approveNotificationIntent}
amount={amount}
/>
diff --git a/libs/market-depth/src/lib/orderbook.tsx b/libs/market-depth/src/lib/orderbook.tsx
index 40d01cfa2..2f677a234 100644
--- a/libs/market-depth/src/lib/orderbook.tsx
+++ b/libs/market-depth/src/lib/orderbook.tsx
@@ -1,4 +1,3 @@
-import styles from './orderbook.module.scss';
import colors from 'tailwindcss/colors';
import { useEffect, useRef, useState, useCallback, Fragment } from 'react';
import classNames from 'classnames';
@@ -14,7 +13,7 @@ import {
import * as Schema from '@vegaprotocol/types';
import { OrderbookRow } from './orderbook-row';
import { createRow } from './orderbook-data';
-import { Checkbox, Icon, Splash } from '@vegaprotocol/ui-toolkit';
+import { Checkbox, Icon, Splash, TinyScroll } from '@vegaprotocol/ui-toolkit';
import type { OrderbookData, OrderbookRowData } from './orderbook-data';
interface OrderbookProps extends OrderbookData {
@@ -547,8 +546,8 @@ export const Orderbook = ({
{t('Cumulative vol')}
-
)}
-
+
{data ? (
-
onSelect?.(id)} />
+
+ onSelect?.(id)} />
+
) : (
{t('Could not load market')}
diff --git a/libs/positions/src/lib/positions-manager.tsx b/libs/positions/src/lib/positions-manager.tsx
index fcc47be52..e07dccf1c 100644
--- a/libs/positions/src/lib/positions-manager.tsx
+++ b/libs/positions/src/lib/positions-manager.tsx
@@ -24,11 +24,7 @@ export const PositionsManager = ({
}: PositionsManagerProps) => {
const gridRef = useRef(null);
const [dataCount, setDataCount] = useState(0);
- const { data, error, loading, reload } = usePositionsData(
- partyId,
- gridRef,
- true
- );
+ const { data, error, loading, reload } = usePositionsData(partyId, gridRef);
const create = useVegaTransactionStore((store) => store.create);
const onClose = ({
marketId,
@@ -73,7 +69,7 @@ export const PositionsManager = ({
});
useEffect(() => {
setDataCount(gridRef.current?.api?.getModel().getRowCount() ?? 0);
- }, [data?.length]);
+ }, [data]);
const onFilterChanged = useCallback((event: FilterChangedEvent) => {
setDataCount(gridRef.current?.api?.getModel().getRowCount() ?? 0);
}, []);
diff --git a/libs/positions/src/lib/use-positions-data.tsx b/libs/positions/src/lib/use-positions-data.tsx
index ebf640d1d..6759639ef 100644
--- a/libs/positions/src/lib/use-positions-data.tsx
+++ b/libs/positions/src/lib/use-positions-data.tsx
@@ -6,13 +6,13 @@ import { positionsMetricsProvider } from './positions-data-providers';
import type { PositionsQueryVariables } from './__generated__/Positions';
import { useDataProvider, updateGridData } from '@vegaprotocol/react-helpers';
import type { GetRowsParams } from '@vegaprotocol/datagrid';
+import isEqual from 'lodash/isEqual';
export const getRowId = ({ data }: { data: Position }) => data.marketId;
export const usePositionsData = (
partyId: string,
- gridRef: RefObject,
- clientSideModel?: boolean
+ gridRef: RefObject
) => {
const variables = useMemo(
() => ({ partyId }),
@@ -21,9 +21,30 @@ export const usePositionsData = (
const dataRef = useRef(null);
const update = useCallback(
({ data }: { data: Position[] | null }) => {
- return clientSideModel ? false : updateGridData(dataRef, data, gridRef);
+ if (gridRef.current?.api?.getModel().getType() === 'infinite') {
+ return updateGridData(dataRef, data, gridRef);
+ }
+
+ const update: Position[] = [];
+ const add: Position[] = [];
+ data?.forEach((d) => {
+ const rowNode = gridRef.current?.api?.getRowNode(d.marketId);
+ if (rowNode) {
+ if (!isEqual(rowNode.data, d)) {
+ update.push(d);
+ }
+ } else {
+ add.push(d);
+ }
+ });
+ gridRef.current?.api?.applyTransaction({
+ update,
+ add,
+ addIndex: 0,
+ });
+ return true;
},
- [gridRef, clientSideModel]
+ [gridRef]
);
const { data, error, loading, reload } = useDataProvider({
dataProvider: positionsMetricsProvider,
diff --git a/libs/ui-toolkit/src/components/index.ts b/libs/ui-toolkit/src/components/index.ts
index 95fddfd41..897d3ee59 100644
--- a/libs/ui-toolkit/src/components/index.ts
+++ b/libs/ui-toolkit/src/components/index.ts
@@ -40,6 +40,7 @@ export * from './tabs';
export * from './text-area';
export * from './theme-switcher';
export * from './thumbs';
+export * from './tiny-scroll';
export * from './toast';
export * from './toggle';
export * from './tooltip';
diff --git a/libs/ui-toolkit/src/components/tiny-scroll/index.tsx b/libs/ui-toolkit/src/components/tiny-scroll/index.tsx
new file mode 100644
index 000000000..06e4bbd13
--- /dev/null
+++ b/libs/ui-toolkit/src/components/tiny-scroll/index.tsx
@@ -0,0 +1 @@
+export * from './tiny-scroll';
diff --git a/libs/market-depth/src/lib/orderbook.module.scss b/libs/ui-toolkit/src/components/tiny-scroll/tiny-scroll.module.scss
similarity index 100%
rename from libs/market-depth/src/lib/orderbook.module.scss
rename to libs/ui-toolkit/src/components/tiny-scroll/tiny-scroll.module.scss
diff --git a/libs/ui-toolkit/src/components/tiny-scroll/tiny-scroll.tsx b/libs/ui-toolkit/src/components/tiny-scroll/tiny-scroll.tsx
new file mode 100644
index 000000000..a03600164
--- /dev/null
+++ b/libs/ui-toolkit/src/components/tiny-scroll/tiny-scroll.tsx
@@ -0,0 +1,20 @@
+import styles from './tiny-scroll.module.scss';
+import { forwardRef } from 'react';
+import classNames from 'classnames';
+import type { HTMLAttributes, ReactNode } from 'react';
+
+export interface Props extends HTMLAttributes {
+ children: ReactNode;
+}
+
+export const TinyScroll = forwardRef(
+ ({ children, className, ...props }, ref) => (
+
+ {children}
+
+ )
+);