This commit has several todos that can be improved. We will do these
later so that the route is available as quickly as possible so we stop
blocking the frontend.
Related to #1404 .
I introduced a new trait EthPricing which has the get_eth_price method that used to be in PriceEstimating. This is cleaner because EconomicViability only needs this one method and makes it easier to create EconomicViability with the price source we have in PriceEstimator instead of using PriceOracle.
The todos that we can do after this PR:
Avoid code duplication for economic viability related arguments in driver and price estimator.
Avoid code duplication for creation of economic viability from arguments in driver and price estimator.
Introduce a network_id argument to price estimator which is needed for the gas price estimation to not be hardcoded to mainnet.
Create a better version of this route that works per token and returns the amount in that token instead of in owl.
Add openapi docs for the route.
Test Plan
Run price estimator with --economic-viability-subsidy-factor 5.
curl -i "http://localhost:8080/api/v1/minimum-order-size-owl" returns 1838937853604742400000
which is 1839 owl and fits with the min avg fee we pass to the solver.
To check the solver look at https://dashboard-projects.gnosisdev.com/d/BOeaAdNGk/solver-metrics?orgId=1 . Note that the open solver is currently using subsidy factor 5 while the others are using 10.
We want to use this for the frontend.
This commit has several todos that can be improved. We will do these later so that the route is available as quickly as possible so we stop blocking the frontend.
Related to #1404 .
I introduced a new trait
EthPricing
which has theget_eth_price
method that used to be inPriceEstimating
. This is cleaner because EconomicViability only needs this one method and makes it easier to create EconomicViability with the price source we have in PriceEstimator instead of using PriceOracle.The todos that we can do after this PR:
Test Plan
Run price estimator with
--economic-viability-subsidy-factor 5
.curl -i "http://localhost:8080/api/v1/minimum-order-size-owl"
returns1838937853604742400000
which is 1839 owl and fits with the min avg fee we pass to the solver. To check the solver look at https://dashboard-projects.gnosisdev.com/d/BOeaAdNGk/solver-metrics?orgId=1 . Note that the open solver is currently using subsidy factor 5 while the others are using 10.