-
Notifications
You must be signed in to change notification settings - Fork 23
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
Oracle Adapter #545
base: main
Are you sure you want to change the base?
Oracle Adapter #545
Conversation
Deploying abstract-docs with Cloudflare Pages
|
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.
The PR specifies that the implementation was performed with the API specified in the Oracle adapter design.
However, it seems that asset registration and value queries were not implemented. Are those supposed to be implemented on this adapter or elsewhere?
|
||
let current_price = price_feed | ||
.get_price_no_older_than(env.block.time.seconds() as i64, no_older_than) | ||
.ok_or_else(|| StdError::not_found("Current price is not available"))?; |
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.
Does this mean that the price must be available within the current block as of querying?
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.
The price must be not older than no_older_than
from the current block time.
Co-authored-by: Interchain Adair <32375605+adairrr@users.noreply.github.com>
Co-authored-by: Interchain Adair <32375605+adairrr@users.noreply.github.com>
To me, asset registration and value queries should not be placed inside the oracle adapter which is there to query prices from price sources using keys (for the moment). |
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.
Amazing implementation! Great decision to keep it without state and execute methods, it would be make more sense to keep at module that adapts this adapter. Left few small nits.
Another point that oracle part of the account previously was able to return value of the account(list of assets) in "base asset" - it was evaluating assets/lp tokens, we don't need it anymore? I think it should be possible to get price of list assets/lp-tokens if every asset involved would be tagged by "price_source_key". Not sure that we need to calculate value in "base asset", IMO oracle price is enough, I imagine it would be quite challenging to create and use API that includes both "base asset" and oracle prices
…e-adapter-implementation
Co-authored-by: Mykhailo Donchenko <91957742+Buckram123@users.noreply.github.com>
Co-authored-by: Mykhailo Donchenko <91957742+Buckram123@users.noreply.github.com>
…b.com:AbstractSDK/abstract into nicolas/abs-589-oracle-adapter-implementation
Adding the Oracle Adapter to abstract supported adapters
Added Pyth implementation and tests
Based on https://www.notion.so/abstract-money/Price-Oracle-24cb3a64c535427d9a38b0312235f889
Checklist