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

[CT-856] Add order replacement to fix vault causing orderbook flickering #1602

Merged
merged 57 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2196eb5
order replacement messages for vault
chenyaoy May 29, 2024
53f021b
fix tests
chenyaoy May 29, 2024
feddcca
fix
chenyaoy May 29, 2024
e087c19
publish protocol image
chenyaoy May 29, 2024
557be43
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 3, 2024
751bae7
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 3, 2024
5f3e64e
clean up test
chenyaoy Jun 3, 2024
b534c21
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 3, 2024
92e19d3
Add new metric
chenyaoy Jun 4, 2024
078b321
Add metric
chenyaoy Jun 4, 2024
83cc892
temp metrics change
chenyaoy Jun 4, 2024
fc81475
Revert "temp metrics change"
chenyaoy Jun 4, 2024
a35fe85
get cancelled order placement to get correct subticks
chenyaoy Jun 5, 2024
ff5df30
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 5, 2024
a114fac
fix
chenyaoy Jun 5, 2024
0ae3f40
Fix order removal reason
chenyaoy Jun 5, 2024
adddd22
change back vault order ID
chenyaoy Jun 6, 2024
be7e698
send replacement order message from vault
chenyaoy Jun 6, 2024
1f18e20
update proto
chenyaoy Jun 6, 2024
31acb76
update proto
chenyaoy Jun 6, 2024
176d37c
ender stateful order replacement handler
chenyaoy Jun 6, 2024
062ff0d
update sql handler
chenyaoy Jun 6, 2024
c43565a
vulcan order replace handler
chenyaoy Jun 6, 2024
4d13eb5
comment
chenyaoy Jun 6, 2024
c1388bb
lint proto
chenyaoy Jun 6, 2024
23f0c10
fix sql script
chenyaoy Jun 6, 2024
6ea9d26
fix test
chenyaoy Jun 6, 2024
6f0ab7d
fix
chenyaoy Jun 6, 2024
66a55c9
clean
chenyaoy Jun 6, 2024
cf1f888
revert
chenyaoy Jun 6, 2024
fe03736
refactor
chenyaoy Jun 6, 2024
7a2afea
remove
chenyaoy Jun 6, 2024
8dee4c9
add tests
chenyaoy Jun 6, 2024
53fe081
fix test
chenyaoy Jun 6, 2024
915e31f
lint
chenyaoy Jun 6, 2024
e4bb2dd
undo
chenyaoy Jun 6, 2024
15061e2
fix
chenyaoy Jun 6, 2024
25a445e
compare subticks instead of price
chenyaoy Jun 6, 2024
1489677
add log
chenyaoy Jun 10, 2024
b332cd9
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 10, 2024
e99086c
fix comparison
chenyaoy Jun 10, 2024
366e7de
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 11, 2024
747ffaa
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 11, 2024
4f0415e
address comments
chenyaoy Jun 11, 2024
a61803a
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 14, 2024
aff6855
ci
chenyaoy Jun 14, 2024
4ca5ed4
fix
chenyaoy Jun 14, 2024
060ba2e
add vulcan test
chenyaoy Jun 14, 2024
27641a4
address comment
chenyaoy Jun 14, 2024
2993902
lint
chenyaoy Jun 14, 2024
e2f6aa1
address comments
chenyaoy Jun 14, 2024
ee19948
fix
chenyaoy Jun 14, 2024
dbb28d8
simplify
chenyaoy Jun 18, 2024
5c6f5ba
Test vault indexer events
chenyaoy Jun 19, 2024
2be3558
lint
chenyaoy Jun 19, 2024
61022c6
Merge branch 'main' into chenyao/order-replacement-messages-for-vault
chenyaoy Jun 19, 2024
4e6c761
pull out indexer changes
chenyaoy Jun 19, 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
1 change: 1 addition & 0 deletions .github/workflows/protocol-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ on: # yamllint disable-line rule:truthy
- main
- 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x
- 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x
- 'chenyao/order-replacement-messages-for-vault'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: remove


jobs:
build-and-push-dev:
2 changes: 0 additions & 2 deletions protocol/x/vault/keeper/orders.go
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ func (k Keeper) RefreshAllVaultOrders(ctx sdk.Context) {
defer totalSharesIterator.Close()
for ; totalSharesIterator.Valid(); totalSharesIterator.Next() {
vaultId, err := types.GetVaultIdFromStateKey(totalSharesIterator.Key())
fmt.Printf("vaultId: %+v\n", vaultId)

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding metrics or more detailed logging for vaults that are skipped.

This could provide better visibility into the operation of this function, especially when diagnosing issues in production environments.

if err != nil {
log.ErrorLogWithError(ctx, "Failed to get vault ID from state key", err)
@@ -36,7 +35,6 @@ func (k Keeper) RefreshAllVaultOrders(ctx sdk.Context) {
var totalShares types.NumShares
k.cdc.MustUnmarshal(totalSharesIterator.Value(), &totalShares)

fmt.Printf("totalShares: %+v\n", totalShares)
// Skip if TotalShares is non-positive.
if totalShares.NumShares.Sign() <= 0 {
continue