Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

feat(zrxSwapper): add usd rate #85

Merged
merged 6 commits into from
Sep 30, 2021
Merged

feat(zrxSwapper): add usd rate #85

merged 6 commits into from
Sep 30, 2021

Conversation

toshiSat
Copy link
Contributor

Add getUsdRate to ZrxSwapper

@toshiSat toshiSat requested a review from a team as a code owner September 30, 2021 15:26
@@ -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'
Copy link
Contributor Author

@toshiSat toshiSat Sep 30, 2021

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

Copy link
Collaborator

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.

Copy link
Contributor Author

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

@toshiSat toshiSat changed the title Usd rate feat: Usd rate Sep 30, 2021
@0xdef1cafe 0xdef1cafe linked an issue Sep 30, 2021 that may be closed by this pull request
@toshiSat toshiSat changed the title feat: Usd rate feat(zrxSwapper): add usd rate Sep 30, 2021
@toshiSat toshiSat merged commit 1d5d36e into main Sep 30, 2021
@toshiSat toshiSat deleted the usdRate branch September 30, 2021 20:52
0xdef1cafe pushed a commit that referenced this pull request Oct 7, 2021
# @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))
@0xdef1cafe
Copy link
Collaborator

🎉 This PR is included in version @shapeshiftoss/swapper-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swapper in Lib: implement getUsdRate
3 participants