-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add Lifi price provider #1453
Add Lifi price provider #1453
Conversation
contractAddress | ||
) | ||
} | ||
}.awaitAll().associate { (contractAddress, priceInUsd) -> |
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.
is it because that lifi only have USD price , thus we use USDT to convert it to local currency?
maybe leave a comment here , so it will be easier for people to understand it in the future
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.
is it because that lifi only have USD price , thus we use USDT to convert it to local currency? maybe leave a comment here , so it will be easier for people to understand it in the future
Exactly
Added comment to make it more clear
//Since Lifi provides prices in USD, we use USDT to convert them into the local currency | ||
contractAddress to mapOf(currency to priceInUsd * tetherPrice) |
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.
@johnnyluo
Here
@Serializable | ||
internal data class LiQuestResponseJson( | ||
@SerialName("priceUSD") | ||
val priceUSD: String, |
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.
val priceUSD: String, | |
val priceUsd: String, |
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.
Fixed
) | ||
} catch (e: Exception) { | ||
BigDecimal.ZERO |
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 do null here, and decide if we want zero in other places
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.
Fixed
Fixes #1136
Lifi returns prices in USD, but we have enhanced it to support conversion into other currencies as well