-
Couldn't load subscription status.
- Fork 79
GLV updates, JIT #127
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
base: updates
Are you sure you want to change the base?
GLV updates, JIT #127
Conversation
| orderKey | ||
| ); | ||
|
|
||
| glvShiftHandler._executeGlvShift( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess it's better to rename _executeGlvShift or create new function, underscore usually means it's private/internal
contracts/exchange/OrderHandler.sol
Outdated
|
|
||
| // @dev used by other handlers to avoid duplicating the same code on their side | ||
| // this method is similar to `executeOrder` but skips execution gas validation | ||
| function executeOrderForController( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should be named executeOrderFromController, to match e.g. DepositHandler.executeDepositFromController
| DepositStoreUtils.remove(params.dataStore, params.key, deposit.account()); | ||
|
|
||
| if (!skipRemoval) { | ||
| DepositStoreUtils.remove(params.dataStore, params.key, deposit.account()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if there should be a validation here, e.g.
if (dataStore.containsBytes32(Keys.SHIFT_LIST, key)) {
revert Errors.RemovalShouldNotBeSkipped(Keys.SHIFT_LIST, key);
}
just to make it more difficult to incorrectly skip removal when code is updated
Sherlock AI FindingsThe automated tool completed its analysis of the codebase and found no potential security issues. Next Steps: No immediate actions are required. Continue monitoring the codebase with future scans. Full report available at: https://ai.sherlock.xyz/runs/132c13f8-6ac3-44ce-a477-fba4c04403be |
JIT stands for Just-in-time liquidity. This PR adds support for atomic execution of GLV shift and order in the same transaction. from product perspective the idea is to allow creating orders in markets even if there is not enough liquidity. keeper would detect such orders and shift liquidity to the order's market before executing it
Changes:
GlvUtils.getGlvValuefunction. without this executing GLV shift and an order may not be possible due to high gas usagesimulateExecuteLatestJitOrderto ExchangeRouter but had to remove existingsimulateExecute*because of contract's side. for order/deposit/withdrawal creationsimulateExecuteLatest*functions can be used instead (they don't requirekeyargument)keyand can be used instead of the ones removed from ExchangeRouterMigration notes: