AugurProject / augur

Augur v2 - Prediction Market Protocol and Client
MIT License
462 stars 143 forks source link

Trading: Gas price modal #3825

Closed pgebheim closed 5 years ago

pgebheim commented 5 years ago

Redesign this modal to simplify, change copy too

design is inconsistent: use / Trade, we'll need to get the amount of gas needed to make a trade. for now.

Calculate display value for $AMOUNT / Trade

gasPrice (user inputted or selected gas price in gwei)
amount of gas per trade = NEW_ORDER_GAS_ESTIMATE (from constants.ts, we'll get a better value later)

ETH_TRADE_COST = formatGasCostToEther(NEW_ORDER_GAS_ESTIMATE, null, gasPrice) from format-number to get the gasCost in ETH.

We'll need to multiply that times the ETH/DAI exchange rate. I suggested a value of 0.00001 ETH to 1 DAI. something like that. EXCHANGE_RATE = 1000 (DAI / ETH) we'll get the real value from the UNISWAP price feed (hasn't been created yet).

AMOUNT = ETH_TRADE_COST * EXCHANGE_RATE

example: fast gasPrice might be 10 gwei Trade gas might be 700000

ETH_TRADE_COST = 7000000 AMOUNT = 7000000 * 0.00001 = $70.00 of course the value is way way too big, but we can tell that in the UI.

example: slow gasPrice might be 1 gwei Trade gas might be 700000

ETH_TRADE_COST = 700000 AMOUNT = 700000 * 0.00001 = $7.00 of course the value is still too big, but we can tell that in the UI.

updated after figured out I had the conversion from ETH to DAI backwards (fixed above)

formatEtherEstimate(
      formatGasCostToEther(
        NEW_ORDER_GAS_ESTIMATE,
        { decimalsRounded: 4 },
        createBigNumber(amount).times(GWEI_CONVERSION)
      )
    )
matt-bullock commented 5 years ago

Desktop Prototype: https://www.figma.com/proto/RMXc7jUWiC6amxz9Q2JK5L/Onboarding-and-Wallet-UX?node-id=1232%3A144049&viewport=16235%2C-12796%2C0.7076077461242676&scaling=min-zoom

Design File: https://www.figma.com/file/RMXc7jUWiC6amxz9Q2JK5L/Onboarding-and-Wallet-UX?node-id=1232%3A144048

User edits transaction fee from their account dropdown image.png image.png

If one of the basic settings is chosen they will see the change in their account dropdown showing either Slow, Recommended or Fast. image.png

These basic settings should always be representative of the Slow, Recommended or Fast settings shown in ETH gas station or the equivalent and constantly update the users choice. So if the user chose FAST at $0.33/trade and an hour later Fast on ETH gas station is $0.35/trade, this should update in the users setting.

When the user edits the gas price in the advanced settings, this price should be locked in until they change it again.

image.png

When gas is set using advanced settings they will see CUSTOM in their account dropdown: image.png