-
Notifications
You must be signed in to change notification settings - Fork 116
Intercepting price updates #204
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
Intercepting price updates #204
Conversation
. |
fa92df1
to
548f1de
Compare
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.
Let's use rust error handling and better import style.
* changed c return value of update price to indicate aggregation * forgot to add bindings * removed the need for casting * fixed update_no_fail * removed unnecessary docker packages
548f1de
to
d65be07
Compare
match unsafe { c_entrypoint(input) } { | ||
0 => Ok(0), // Success | ||
SUCCESSFULLY_UPDATED_AGGREGATE => Ok(SUCCESSFULLY_UPDATED_AGGREGATE), | ||
2 => Err(ProgramError::InvalidArgument), //2 is ERROR_INVALID_ARGUMENT in solana_sdk.h |
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.
Can you use the version from the bindings instead of the magic number 2?
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.
No, unless I make bindings of solana_sdk
* Make c robust to price account size (#201) * make pythd robust * made the oracle accept new size * left space for extra publishers * Make c robust to price account size (#207) * make pythd robust * made the oracle accept new size * left space for extra publishers * Intercepting price updates (#204) * changed c return value of update price to indicate aggregation (#190) * changed c return value of update price to indicate aggregation * forgot to add bindings * removed the need for casting * fixed update_no_fail * removed unnecessary docker packages * timeless coments * a convinient way to derive traits * changed importing style * added register_traits method * fixed formatting * add a new insctruction and interecepted update price calls * fixed formatting * more helpful error message for incorrect c account size * fixed merging errors * addressed some warning * updated comment * merging formatting issues * memory borrowing issues after rebasing * updated import * more import style changes * removed panics * bug introduced by merge * moved dispatching to processor * better formatting * cleaner error handling * error handling wrapper for c_entrypoint * removed unwrap * more comments * removed unused imports + changed import style Co-authored-by: majabbour <59592028+majabbour@users.noreply.github.com>
Our design involves rersizing price accounts, as well as intercepting calls to instructions that update_the price in order to do the SMA tracking.
In this PR:
The purpose of this is to get feedback on the structure of the program.
It also addressed two other issues: