-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: consume dia fair price feed #515
Conversation
Signed-off-by: Gregory Hill <[email protected]>
Signed-off-by: Gregory Hill <[email protected]>
cf9d5b6
to
02edc4e
Compare
oracle/examples/kintsugi-config.json
Outdated
[ | ||
{ | ||
"symbol": "BTC", | ||
"alias": "KBTC" |
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 current architecture assumes we use the same price feed for all currency pairs, to avoid overhauling the oracle client I'm assuming it is okay to use the KBTC DIA xLSD price feed for BTC.
value | ||
.as_array()? | ||
.into_iter() | ||
.find(|entry| matches!(entry.get("Token").and_then(|value| value.as_str()), Some(token) if token.to_uppercase() == alias))? |
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.
should we do alias to uppercase as well?
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 oracle config already assumes all token symbols are capitalized, if this is not the case then many parts of the code would not work correctly.
Signed-off-by: Gregory Hill <[email protected]>
Enables the oracle to be configured to fetch prices from the liquid-staking token feed here: https://www.diadata.org/app/liquid-staking/
There is only one breaking change to existing oracle configs, all DIA price feeds are quoted in USD so it may be required to switch the order e.g. from
["USD", "BTC=xxx"]
to["BTC=xxx", "USD"]
.