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

DEV > MAIN #322

Merged
merged 38 commits into from
Jun 3, 2024
Merged

DEV > MAIN #322

merged 38 commits into from
Jun 3, 2024

Conversation

piotrwitek
Copy link
Collaborator

No description provided.

jakubswierczek and others added 30 commits May 22, 2024 09:31
Story details: https://app.shortcut.com/oazo-apps/story/15610

---------

Co-authored-by: Halaprix <panicz.klos@gmail.com>
Added read and write connection strings for the RAYS database to GitHub
deployment workflows. This includes both production and staging
environments, enhancing the configuration details needed for deploying
the application.
Added protocol plugins reexports
- handle swaps from closed positions ( where `net value == 0`)
- to get closed position swaps - we get all swaps fro muser entity and filter out swaps that exists in `user.positions` ( we fetch positions with `net value > 0` hence all swaps in `user.positions` are swaps in open positions )
- improved npm packages build scripts
- updated viem dependencies to locked version to be the same across the
sdk
- added new re-exports
- publish sdk npm packages
- added missing exports in the sdk common package
This Pull Request introduces an enhancement to the way we handle user
points in our system. Previously, we processed user points individually,
which was not efficient when dealing with large volumes of data.

In this PR, we have implemented a new approach where we first group the
points by user. This ensures that all points for a specific user are
processed together, improving the coherence of our data handling.

Furthermore, we have introduced a chunking mechanism. The chunking
mechanism divides the grouped points into chunks of 30 or more. The key
aspect of this chunking mechanism is that it ensures all points for a
user are in the same chunk. This means that the chunk size doesn't have
to be strictly 30 but the first possible size above 30 that can
accommodate all points for the last processed user.

This new approach not only improves the efficiency of our data
processing but also ensures that all points for a specific user are
handled together, thereby maintaining user-specific context.

Changes include:
- Grouping points by user before processing
- Dividing grouped points into chunks of size 30 or more
- Ensuring all points for a user are in the same chunk
- Adjusting chunk size to accommodate all points for the last processed
user

This PR is expected to significantly improve the efficiency and
reliability of our user points handling process.
…ly (#293)

This Pull Request introduces an enhancement to the SummerPointsService
by implementing atomic transactions using the Kysely library. This
ensures that all database operations within a single transaction are
treated as a single unit of work, thereby improving data consistency and
reliability.

The PR includes the use of Kysely's .transaction() method to start a new
transaction. Within this transaction, all operations are performed, and
if any operation fails, the entire transaction is rolled back, ensuring
that the database remains in a consistent state.

Changes include:

Implementation of atomic transactions using Kysely's .transaction()
method
Ensuring all database operations within a transaction are treated as a
single unit of work
Rollback of entire transaction if any operation fails
This PR is expected to enhance the reliability and consistency of data
operations within the `SummerPointsService`.
Added new SDK stack deployment:
- new stack definition that is run with "sst:deploy:sdk:staging" or
"sst:deploy:sdk:prod"
- new github actions that is run only manually from the selected branch
- sdk will not deploy automatically from now on, only manually
This pull request adds the missing package scripts to the project. The
scripts "sst:dev", "sst:build", "sst:deploy:dev", "sst:dev:sdk",
"sst:build:sdk", "sst:deploy:sdk:staging", and "sst:deploy:sdk:prod"
have been added to the package.json file. This will allow for easier
development, building, and deployment of the project and its SDK.
- add `leaderboard`  view to rays db
- add pagination enabled leaderboard endpoint to fetch users with number
of total accrued points
update to :

```
Epoch timestamp: 1716768000
Timestamp in milliseconds: 1716768000000
Date and time (GMT): Monday, 27 May 2024 00:00:00
```
- the default `10` seconds is not enough to process all the points and
insert them to the database
- add user multipliers one before processing positions ( to avoid adding
duplicates)
- change names
- avoid skipping processing multiple users in the eligibility check (
change `return` to `continue` )
Update Spark Payback action and action wrapper
piotrwitek and others added 8 commits May 29, 2024 11:21
- add new package with borrow-db type
- add handling for referred users
- get all users from snapshot and users that referred them - and add to
db before processing points
- if a user is referred - the referring user gets 5% of their points
This pull request includes the following changes:

- Release new SDK private packages to the npm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants