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

[Tradeshield]: Design the Data Structures #799

Merged
merged 22 commits into from
Sep 17, 2024
Merged

Conversation

amityadav0
Copy link
Contributor

@amityadav0 amityadav0 commented Sep 16, 2024

Description

  • Design the Data Structures
  • Add spot order DS
  • Add pending order DS
  • Add queries for DS
  • Add tests for DS
  • Add sorted pending spot order
  • Add sorted pending perpetual order
  • Add tests for sorted DS
  • Add more coverage for DS

Note: History for spot orders and perpetual orders is not stored in chain to save space, we only store pending orders on chain.

What has Changed?

What specific problem were you aiming to address, and how did you successfully resolve it? If tests were not uploaded for this pull request or if coverage decreased, please provide an explanation for the change.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Deployment Notes

Are there any specific considerations to take into account when deploying these changes? This may include new dependencies, scripts that need to be executed, or any aspects that can only be evaluated in a deployed environment.

Screenshots and Videos

Please provide any relevant before and after screenshots by uploading them here. Additionally, demo videos can be highly beneficial in demonstrating the process.

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 30.05780% with 605 lines in your changes missing coverage. Please review.

Project coverage is 42.72%. Comparing base (28e63c3) to head (8358d33).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
- Coverage   43.30%   42.72%   -0.58%     
==========================================
  Files         652      667      +15     
  Lines       21658    22546     +888     
==========================================
+ Hits         9378     9632     +254     
- Misses      11154    11760     +606     
- Partials     1126     1154      +28     
Components Coverage Δ
leveragelp_transactions 92.63% <ø> (ø)
leveragelp_lifecycle 88.04% <ø> (ø)
leveragelp_keeper 86.58% <ø> (ø)
leveragelp_queries 19.28% <ø> (ø)
accountedpool_transactions 100.00% <ø> (ø)
accountedpool_lifecycle ∅ <ø> (∅)
accountedpool_queries 68.42% <ø> (ø)
amm_transactions 57.93% <ø> (ø)
amm_lifecycle 79.16% <ø> (ø)
amm_keeper 61.13% <ø> (ø)
amm_queries 29.94% <ø> (ø)
assetprofile_transactions 78.82% <ø> (ø)
assetprofile_lifecycle ∅ <ø> (∅)
assetprofile_keeper 83.33% <ø> (ø)
assetprofile_queries 47.41% <ø> (ø)
burner_transactions 0.00% <ø> (ø)
burner_lifecycle ∅ <ø> (∅)
burner_keeper 100.00% <ø> (ø)
burner_queries 63.54% <ø> (ø)
clock_transactions 30.00% <ø> (ø)
clock_lifecycle ∅ <ø> (∅)
clock_keeper 76.92% <ø> (ø)
clock_queries ∅ <ø> (∅)
commitment_transactions 48.83% <ø> (ø)
commitment_lifecycle ∅ <ø> (∅)
commitment_keeper 19.60% <ø> (ø)
commitment_queries 9.33% <ø> (ø)
epochs_transactions ∅ <ø> (∅)
epochs_lifecycle 100.00% <ø> (ø)
epochs_keeper 81.81% <ø> (ø)
epochs_queries 85.71% <ø> (ø)
estaking_transactions 48.64% <ø> (ø)
estaking_lifecycle 73.23% <ø> (ø)
estaking_keeper 63.05% <ø> (ø)
estaking_queries 55.31% <ø> (ø)
incentive_transactions 0.00% <ø> (ø)
incentive_lifecycle ∅ <ø> (∅)
incentive_keeper 0.00% <ø> (ø)
incentive_queries ∅ <ø> (∅)
masterchef_transactions 64.78% <ø> (ø)
masterchef_lifecycle 69.78% <ø> (ø)
masterchef_keeper 89.47% <ø> (ø)
masterchef_queries 45.97% <ø> (ø)
oracle_transactions 31.91% <ø> (ø)
oracle_lifecycle 0.00% <ø> (ø)
oracle_keeper 63.88% <ø> (ø)
oracle_queries 34.90% <ø> (ø)
parameter_transactions 15.11% <ø> (ø)
parameter_lifecycle ∅ <ø> (∅)
parameter_keeper 75.00% <ø> (ø)
parameter_queries 60.00% <ø> (ø)
stablestake_transactions 73.91% <ø> (ø)
stablestake_lifecycle 75.00% <ø> (ø)
stablestake_keeper 71.42% <ø> (ø)
stablestake_queries 13.04% <ø> (ø)
tier_transactions 28.57% <ø> (ø)
tier_lifecycle 100.00% <ø> (ø)
tier_keeper 90.47% <ø> (ø)
tier_queries 20.32% <ø> (ø)
tokenomics_transactions 72.32% <ø> (ø)
tokenomics_lifecycle ∅ <ø> (∅)
tokenomics_keeper 83.33% <ø> (ø)
tokenomics_queries 70.96% <ø> (ø)
transferhook_transactions ∅ <ø> (∅)
transferhook_lifecycle ∅ <ø> (∅)
transferhook_keeper 100.00% <ø> (ø)
transferhook_queries 60.00% <ø> (ø)

@amityadav0
Copy link
Contributor Author

Notes:

  • Quereis and Transactions for setting DS was scaffolded, so I have kept it as and functionality and tests for these will be added in their respective tasks
  • History for spot orders and perpetual orders is not stored in chain to save space, we only store pending orders on chain.

Copy link
Contributor

@cosmic-vagabond cosmic-vagabond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

genesis.PendingSpotOrderList = k.GetAllPendingSpotOrder(ctx)
genesis.PendingSpotOrderCount = k.GetPendingSpotOrderCount(ctx)
genesis.PendingPerpetualOrderList = k.GetAllPendingPerpetualOrder(ctx)
genesis.PendingPerpetualOrderCount = k.GetPendingPerpetualOrderCount(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amityadav0 because the module store was already registered as part of v0.45 we might need a migrator function in order to initiate the module states in Testnet.

@cosmic-vagabond
Copy link
Contributor

@amityadav0 added tradeshield module data to CI pipeline for localnet snapshot flow

@cosmic-vagabond cosmic-vagabond merged commit 8e31bdc into main Sep 17, 2024
39 of 41 checks passed
@cosmic-vagabond cosmic-vagabond deleted the tradeshield-ds branch September 17, 2024 13:46
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.

2 participants