archerdao / archerswap Goto Github PK
View Code? Open in Web Editor NEWPrivate DEX trades w/ zero slippage and no cancellation fee
Private DEX trades w/ zero slippage and no cancellation fee
Users can cancel transactions for free, to try them again.
After press "Cancel" on a transaction, it is possible to make the same trade (accepting any price updates) again easily.
After pressing "Cancel" on a transaction, the selected tokens are reset to defaults (ETH -> select token). It is difficult to continue trading flow.
When a user selects ETH as the input asset, we should automatically adjust the input amount to account for the miner tip.
Selecting "MAX" in this case should result in the max ETH in the user's wallet minus the current miner tip.
Any time that the miner tip is updated (by adjusting the slider, setting the tip manually, or any new estimateGas call - i.e. those triggered on each new block or when the user adjusts any input to the trade), we should check that the input amount of ETH + the miner tip is not more than the user currently has in their wallet and if it is, automatically adjust the input ETH amount to the new max amount.
Pending trades are valid until their deadline, at which they become invalid.
We should show an indication of each trade's deadline in the Pending Transaction modal, with information about how many minutes remain for the trade to be valid.
Once a trade expires, the UI should show that the trade has expired and is no longer considered Pending.
As of now, we use a naive DEFAULT_ETH_TIP value to calculate the miner tip before a successful trade/gas estimation occurs. This is not ideal for a few reasons:
Suggested implementation:
ArcherSwapRouter
contract enable users to pay for tips using tokens. We would like to surface this feature on the application.
Pay with tokens (on/off) - default off
When pay with tokens is enabled, the tip should be paid with the "destination" tokens. The UI should reflect this payment in tokens.
When pay with tokens is disabled, the existing functionality should be used (pay in eth).
The miner tip flickers at various points in the UI.
Simple steps to recreate: set up a trade and watch the miner tip update over a few blocks.
When connected and estimating a swap, the miner tip flickers between the default value and estimated value.
When connected and confirming a swap, the miner tip flickers between the estimated value and newly estimated value.
When connected and signing a swap, the miner tip flickers between the value being signed and newly estimated value.
The miner tip will replace a recent estimate with default value, then a new estimate. For example:
It may be more accurate to avoid the default and use the previous estimate. Even if gas usage changes (due to a user interaction), the tip should be closer to market conditions than the default more often.
The Uni v3 frontend has added basic support for tokens that use permit for approvals, see:
https://github.com/Uniswap/uniswap-interface/blob/main/src/hooks/useERC20Permit.ts
Archerswap router also includes support for 'permit' for each of the swap functions, see:
We should add support for the same permit flow used in the Uniswap V3 interface.
To begin with, we can just support the same PERMITTABLE_TOKENS that Uni V3 is supporting + ARCH (ARCH uses PermitType.AMOUNT).
Current swap application uses a different transaction pattern (tip vs gas). We would like users to get more information about the application and its benefits.
The on-boarding message should display about the swap component, using an existing UI component (as seen on Governance section). Its content should link users to this blog post describing the application.
Note: colors should match application -- not as seen here.
Currently, pending transactions sent through Archer are included in the same area as "Recent Transactions". This is confusing in part because rows with options to manage active tx are included with rows that are known to be read only.
As part of the original change, we changed the logic of how "Clear" works, which should be rolled back for the existing section and included in the new section.
Order | Section | Description |
---|---|---|
1 | Manage Transactions | New section, for managing Archer Trades |
2 | Recent Transactions | Existing section, lists all activity |
If a nonce is used, any trades for that nonce are invalid. They should change to invalid state.
tbd
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.