-
Notifications
You must be signed in to change notification settings - Fork 54
feat(zrxSwapper): add usd rate #85
Conversation
@@ -38,6 +47,24 @@ export class ZrxSwapper implements Swapper { | |||
return getZrxQuote(input) | |||
} | |||
|
|||
async getUsdRate(input: Pick<Asset, 'symbol' | 'tokenId'>): Promise<any> { | |||
const { symbol, tokenId } = input | |||
if (symbol === 'USDC') return '1' |
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'm not sure if we need this? It saves a single call when calling USDC, but it also gives a microscopically slight incorrect value, which may be fine. I think if we do keep something like this, we should think about adding more tried and true stable coins to this field, or just simply remove it
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 don't think this is ok, especially in times of volatility stables do become slightly unpegged.
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'm going to remove it
# @shapeshiftoss/swapper-v1.0.0 (2021-10-07) ### Features * add approval needed to lib ([#95](#95)) ([0b1bae4](0b1bae4)) * add execute quote ([#87](#87)) ([463a06d](463a06d)) * add getdefaultpair to zrxswapper ([#91](#91)) ([d1cf1be](d1cf1be)) * get min max ([#93](#93)) ([26b788d](26b788d)) * **zrxSwapper:** add usd rate ([#85](#85)) ([1d5d36e](1d5d36e)) * bring over buildQuoteTx logic from platform-shared ([#71](#71)) ([4ec3365](4ec3365))
🎉 This PR is included in version @shapeshiftoss/swapper-v1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Add getUsdRate to ZrxSwapper