Origin: Add approximate price in USD (or EUR)

Created on 7 Jan 2018  Â·  22Comments  Â·  Source: OriginProtocol/origin

feature good first issue uux

Most helpful comment

@wanderingstan I'll take this.

All 22 comments

@wanderingstan I'll take this.

Would Origin emphasize cryptocurrency or real world currency more to customers at launch? The emphasized currency might be displayed in a more pronounced way, IE:

screenshot 2018-04-16 18 24 25

vs.

screenshot 2018-04-16 18 24 51

(@inkredabull)

Great question. Showing prices in fiat seems way more friendly to me. A few things we need to keep in mind though:

  1. Our community is global, so we need to support a lot more fiat currencies than just USD
  2. We'll need to find free and reliable API's for doing the ETH/Fiat conversion (with a fallback plan if that data is not available for any reason)
  3. Users should be able to set their preferred currency in the DApp. It would be nice to make an intelligent guess from their location & or have whatever currency they choose be cached and remembered in localStorage.

We should always have an ETH price. A fiat equivalent may or may not be available depending on whether we know the users location and the local conversion rate.

Ideally we'd use an on chain oracle to pull the exchange rates. It gives the user more privacy, since they aren't sending requests to a random API owned by someone else.

One example of such an onchain oracle is this one, from the Dai Stablecoin, that averages 13 other ETH/USD oracles

https://makerdao.com/feeds/#0x729d19f657bd0614b4985cf1d82531c67569197b

Agree in principle, although not sure how performant that is going to be.

I could see this ending up as yet another function of your trusted bridge server.

Agree with Josh. For now bridge server seems like the easiest solution.

On Tue, Apr 17, 2018 at 8:48 AM Josh Fraser notifications@github.com
wrote:

Agree in principle, although not sure how performant that is going to be.

I could see this ending up as yet another function of your trusted bridge
server.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/OriginProtocol/demo-dapp/issues/36#issuecomment-382042914,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEuxN2ynL_YFrBfKs37iiMfdAb_1oVJtks5tpg7NgaJpZM4RVhXS
.

>

Cofounder of Origin http://www.originprotocol.com

Join our Telegram http://t.me/originprotocol.com

It should be very performant - we just check the value once every fifteen minutes or so, and store it locally with an expiration time. It doesn't have to happen on every page load.

I do agree however that this may want to go into the bridge server, since that way if an oracle goes haywire, existing daps aren't stuck with it.

I was imagining far more real-time updates given how volatile crypto can be. Let's plan on 1 minute caching at most.

+1

On Tue, Apr 17, 2018 at 10:17 AM, Josh Fraser notifications@github.com
wrote:

I was imagining far more real-time updates given how volatile crypto can
be. Let's plan on 1 minute caching at most.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/OriginProtocol/demo-dapp/issues/36#issuecomment-382072616,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEuxN1DKyzUUItramCtEzWeXjohZHeqKks5tpiObgaJpZM4RVhXS
.

--
Cofounder of Origin http://www.originprotocol.com

Join our Telegram http://t.me/originprotocol.com

While it would be great to role our own, currency conversion is outside our scope.

There are numerous projects doing this, and Origin Dapp creators are free to use any API/service that they like. Demo-dapp is, after all, just an example.

According to this commit, Metamask is using the Cryptonator API. The commit notes, "Thankfully they don't have limits, so we can ping liberally".

Given that currently most of our users will be finalizing transactions in Metamask, I suggest it makes the most sense for Demo-Dapp to use the same conversion API.

Cryptonator seems like a perfectly reasonable choice for now.

Should users be able to specify prices in either ETH or USD/etc? Having that feature would allow a user to peg their listing (otherwise, if a user had a listing on both Craigslist and Origin for instance, they'd have to adjust the Origin listing to track exchange rates)

@ambertch - For now the listing price will remain constant (in ETH) and we'll just worry about displaying it also in the user's buyer's desired currency.

Giving the seller the option to price a listing in fiat (and have the eth/crypto price dynamically updated) is very cool and something we've discussed, but is not in scope for v1.

Taking a test-first approach but hung up on some local system issues around Watchman/getting tests running. Here is my initial idea: something functional that would take a 3-letter fiat.

Making progress.

Limiting factor in my implementation is currently with nock; see commit msg

Sorry for the hold-up on this; I've attempted to hold myself to a TDD standard but given an infra issue this still is not ready.

I'm going to be fairly preoccupied next week (between work and Google I/O) so I'll look to do a PR with just the code change (and commented-out test) latest in two weeks.

Done via #188 ✅

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davecraige picture davecraige  Â·  6Comments

micahalcorn picture micahalcorn  Â·  5Comments

davecraige picture davecraige  Â·  8Comments

mikeshultz picture mikeshultz  Â·  4Comments

micahalcorn picture micahalcorn  Â·  8Comments