Skip to content
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

diff: audit #194

Closed
wants to merge 100 commits into from
Closed

diff: audit #194

wants to merge 100 commits into from

Conversation

zhongeric
Copy link
Collaborator

since 050c204

ConjunctiveNormalForm and others added 30 commits June 14, 2023 17:48
This commit moves orderInfo to a subfield of the Dutch quote response to
avoid continuously overloading it as a union type as we require more
items in the response.

It also adds the slippage tolerance field to the response :)

BREAKING CHANGE: response shape
* use same nonce for synthetic

* add tests

* pull out util

* nonce on failure of get nonce
for Dutch it is always defined because we override it with default, this
commit types it this way so we dont have to do null checks in other
places
This commit uses an enum for error codes. It also adds
a NoQuotesAvailable custom error
* feat: cleanup slippage tolerance

for Dutch it is always defined because we override it with default, this
commit types it this way so we dont have to do null checks in other
places

* feat: make slippage tolerance a percent string

This unifies it with the classic inputs

* fix: remove only
This commit cleans up a few things about permitData response handling:

Permits should be returned quote-level, not top-level as they apply to
each quote. It's not clear from the current framing which quote the data
refers to.

The function for fetching permits should not be on the quote interface.
Different quote types will fetch permits in different ways and require
different inputs. This is already clear from the current implementation
where the fn had a weird parameter that was only used by classic and
completely ignored in dutch. This commit removes the field and allows
each quote type to handle it however they please

Move existing allowance fetch to context level. Again this is something
specific to AllowanceTransfer quote types, so should be handled under the classic
context rather than in the global handler

Smaller changes:
- remove _.isEqual in tests as it creates very unreadable logs
- rename permit to permit2 where relevant
* fix: integ test

the order info is now inside quote.orderInfo

* remove improvement

---------

Co-authored-by: ConjunctiveNormalForm <zhiyuan.zach.yang@gmail.com>
so rfq can test

TODO: revert later
This commit adds requestId to the response field

Closes #148
so rfq can test

TODO: revert later

Co-authored-by: marktoda <toda.mark@gmail.com>
This commit adds a one-block buffer to the deadline to ensure there is
always one block where the order resolves to endAmount

It also returns this buffer so any consumers doing reparameterization
can consume it
This commit lowers synthetic quotes so we can test fill rate in
isolation of parameterization
* feat: use gas adjustment for synthetic end amounts

* fix: clean up adjustment applications

Each adjustment should be applied on given values, not assuming as much
about relation to the quote values
* feat: update UR-sdk

This uses the latest UR address so integ tests should pass again :)

* update UR addr

* use addr defined in UR-SDK

---------

Co-authored-by: ConjunctiveNormalForm <zhiyuan.zach.yang@gmail.com>
* add trade type and permitNonce on response

* update ur sdk

* slippage in classic response

* exact in and out change

* remove permit nonce as not needed

* update consts to string

* update lock file

* permit first to used
* feat: properly handle pre-swap fixed costs

Costs such as the user wrapping ETH into WETH before a gouda swap should
not be handled like other gas adjustments since they are _required_ to
be paid by the user up-front. They should be factored into the
startAmount and used in the decision making process between gouda and
classic

* fix: add tests

* fix: tests

* fix: dont double count routing gas
This commit updates to gouda-sdk 1.0.0-alpha.4 and updates the code
accordingly. Mostly naming changes
To allow for easier testing of ETH input
TODO: REVERT!
zhongeric and others added 29 commits August 4, 2023 12:18
* feat: bump default token list

* reduce calls to resolveToken
* bump universal router sdk

* bump sor
* feat: add timings

* fix: promises

* fix: add chainId

* feat: add internal handler latency
* feat: changes for ETH output

* remove synthetic token list check
This commit lowers the uniswapx gas threshold so we dont send orders
where gas makes up over 10% of the trade size
* fix: surface routing api 5xx and 429
Co-authored-by: Siyu Jiang <siyu.jiang@CORN-Siyu-217.local>
* fix: stop filtering out RFQ eth out quotes
* fix: skip flaky test

* chore: use internalApiKey for integ tests
Basically to account for the UX cost of wrapping weth
* feat: fetch synthetic status from UPA

This commit adds a dynamic switch-on for synthetic UniswapX quotes using
the UPA enabled endpoint. It will automatically consider or reject
synthetic quotes depending on the response from this endpoint

* feat: add tests

* feat: update api key

* feat: return false default on error
* bump provisioned concurrency to 500 to match routing-api

* reduce prov conc due to recent routing api change

* remove old lambda env vars
@zhongeric zhongeric closed this Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants