-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve: more effectively estimate suggested fees quote #887
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Why?
I've further explained in the PR |
ACX-1643 API/SDK: Reports of underpriced deposits
After changes deployed to the API yesterday, community relayers reported a sharp uptick in the number of unprofitable deposits. The RL relayer is filling most of these at (small) loss, per reporting from mydefi. Investigation indicates that the gas cost of the fill is being under-estimated by about 30k gas. Update: resolved - see comments for conclusions. |
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.
OK pending one query on the speed-up 👍
Whoops did not push the latest commit. Good eye. Note: all A/B testing was done with |
We discovered a short circuit in the Vercel API's estimation of fee quotes.
This was causing a quote of roughly 80K gas units to make a fill.
The original recipient address being used on the FE is
0xBb23Cd0210F878Ea4CcA50e9dC307fb0Ed65Cf6B
, which will incur a storage cost during the initial ERC20 transfer of 145,000 gas units. Properly passingrecipientAddress
in the suggested-fees endpoint on prod will incur 120,000 gas units.In either case, we now default our recipient address to incur the storage cost of the ERC20 initializing a user's balance in the token.
Thus, the cost calculation will be preserved regardless of
recipientAddress
being provided and using the Across UI will produce a more accurate gas estimation making it the cheaper alternative over aggregators.Closes: ACX-1643