* Introduce NoOpPoolsCache and use it in unsupported chains for BeethovenX
* Use `NoOpPoolsCache` for `CreamPoolsCache` and `BalancerPoolsCache` on unsupported chains
* Make _refreshPoolCacheIfRequiredAsync type-safe and remove Promise.all
* Factor out PoolsCache key logic into a function
* Use Map instead of object in PoolsCache and increase the default timeout
* Clean up PoolsCache and simplify its public interface
* Add a new TokenAdjacencyGraph implementation
* Replace old TokenAdjacencyGraph with new implementation
* Simplify token adjacency graph in constants.ts
* Fix lint error
* Update CHANGELOG.json
* Remove old JS router and add a FillAdjustor
Clean up JS router and unused functions
Remove more unused functions, add adjustment of fills
Comment on why we use fill over sample
update CODEOWNERS
lint
Clean up Fill removing unused properties
Remove CollapsedFills, omit flags bigint
Create GasSchedule vs FeeSchedule, return Fill and gas on OptimizedOrder
Use Fill Adjustment in Phase2 of routing
Fix Limit orders being treated as VIP
* Fix case where dex liquidity is empty
* Use best gas adjusted pricing for fee sources
* CHANGELOG
* Remove Oasis
* Remove CoFix code
* Remove MixinKyber
* Remove Kyber from asset-swapper
* Delete unused imports, interface, and etc.
* Fix the test failure issue when it's run with neon-router
* Update CHANGELOG.json
* feat: integrate Rust router with asset-swapper WIP
* fix: produce outputFees in the format the Rust router expects
* fix: correct output fee calc and only use the rust router for sells
* fix: make sure numbers sent to the rust router are integers
* hack: try to debug why rust router output is being overestimated WIP
* refactor: clean up router debugging code
* fix: don't use negative output fees for sells
* feat: try VIP sources in isolation and compare with routing all sources
* fix: adjust for FQT overhead when choosing between VIP, all sources WIP
* fix: pass gasPrice to path_optimizer for EP overhead calculations
* feat: buy support with the Rust Router WIP
* chore: WIP commit trying to get buys working
* refactor: use samples instead of fills for the Rust router
* feat: add vip handling hack to sample based routing
* fix: revert to 200 samplings for rust router when using pure samples
* refactor: remove old hacky Path based Rust code, add back feature toggle
* fix: scale both fill output and adjustedOutput my same factor as input
* feat: initial plumbing for supporting RFQ/Limit orders
* fix: incorrect bump of input amount by one base unit before routing
* fix: add fake samples for rfq/limit orders to fulfill the 3 sample req
* fix pass rfq orders in the correct format to the rust router
* chore: remove debugging logs and clean up code & comments
* fix: use published version of @0x/neon-router
* hack: scale routed amounts to account for precision loss of number/f64
* refactor: clean up code and address initial review comments
* fix: only remove trailing 0 output samples before passing to the router
* refactor: consolidate eth to output token calc into ethToOutputAmount fn
* fix: interpolate input between samples on output amount instead of price
* fix: return no path when we have no samples, add sanity asserts
* refactor: fix interpolation comment wording
* fix: remove double adjusted source route input amount
* chore: update changelog for asset-swapper
* Refactor integrator ID and add Prometheus metrics
* Update packages/asset-swapper/src/swap_quoter.ts
Co-authored-by: David Walsh <5778036+rhinodavid@users.noreply.github.com>
* Update packages/asset-swapper/src/swap_quoter.ts
Co-authored-by: David Walsh <5778036+rhinodavid@users.noreply.github.com>
* Update packages/asset-swapper/src/swap_quoter.ts
Co-authored-by: David Walsh <5778036+rhinodavid@users.noreply.github.com>
* Added documentation and fixed some minor requests
* Added more metrics
* more docs
* lint fix
* added new Integrator ID addition
* refactor tests
Co-authored-by: David Walsh <5778036+rhinodavid@users.noreply.github.com>
* fix: KyberDmm
* fix: pass buyToken to kyberDmm and require that path ends with buyToken
* Pass BigNumber down to FastABI
* Address Feedback
Co-authored-by: Kim Persson <kimpersson88@gmail.com>
* add balancer v2
* fetch balancer v2 pools from subgraph
* feat: initial stab at a Balancer V2 Sampler WIP
* feat: add sampling for buys and fix build issues WIP [untested]
* fix: BalancerV2Sampler implementation issues, works on Kovan
* chore: BalancerV2 sampling boilerplate
* fix: update Balancer V2 mainnet address
* fix: consolidate differences between the 2 working branches
* fix: use mainnet Balancer V2 subgraph
* fix: stack too deep by minimizing and inline Balancer V2 vault interface
* fix: address review comments and clean up
* fix: sampler vault interface and pools cache assuming a pool has swaps
* address more review comments
* fix: TS type issues and add a comment about deadline argument
* fix: pools_cache_tests incorrect token addresses, prettier incompat
* fix: make ERC20BridgeSampler support BalancerV2 non view sampler fns
* fix: use a struct for passing encoded bridge data for Balancer V2
* chore: add changelog entries
* fix: improve gas accuracy of gas schedule for Balancer V2 & Maker Psm
* fix: don't exclude sources with stale caches & wait for cache refresh
* rebase
* `@0x/asset-swapper`: Fix stack too deep errors in sampler
Co-authored-by: Kim Persson <kimpersson88@gmail.com>
Co-authored-by: Lawrence Forman <me@merklejerk.com>
* Cull paths which cannot improve price
* fixes and rename
* optimizations
* disable ABI optimization for sampler
* fix lint
* use fastabi
* Update to fastabi 0.0.2
* update packages
* Fix NaN case
* update to published packages
* rebased
* Update generated wrappers
* chore: Component.finance, Smoothy.finance (mainnet + BSC), Saddle.finance, Curve open pools, adjusting gas schedule, fixing Shell buys
* chore: adding a Sampler for Smoothy.finance to only use whats in the contracts reserve
* fix: Smoothy sampler, only use approx. for buys, removing y and BUSD curve pools
* add CHANGELOGs
* fix: prettier
* add: FRAX Curve open pool
* fix: prettier
* chore: adjusting gas schedule for BSC Smoothy
* ADDS basic boilerplate for PSM bridge WIP
* ADDS integrate the MakerPSM mixin and fix incorrect naming
* fix: take into account PSM fee when buying USDC from PSM
* feat: intial stab at a PSM sampler WIP
* feat: integrate MakerPsm into AS WIP
* refactor: get VAT contract address from PSM instead of passing it in
* fix: hardcode PSM Gemtoken to USDC
* fix: remove passing in authGem, get from PSM contract instead
* fix: use constant modified to avoid using storage variables
* fix: incorrect num decimals after multiplication in sampler
* fix: PSM buy sampling
* fix: use fillData to estimate gas schedule
* Rebased on latest development
* Guard and use latest Curve LiquidityProvider
* `@0x/contract-addresses`: Redeploy FQT on mainnet and ropsten
Co-authored-by: Jacob Evans <jacob@dekz.net>
Co-authored-by: Lawrence Forman <lawrence@0xproject.com>
* separated comparison price function into a new file, accounted for backup orders
* removed scratch code
* Adjusted documentation, object naming
* Refactored comparisonPrice function to use adjusted rate from optimizer, used native order fee schedule to adjust for order fees
* Small fixes to function, added unit tests
* Adjusted fee calculation for comparisonPrice function
* use available OptimalPathRate object
* fix lint error in test, separate out fee calculation
* Fixed market operation utils test, added additional checks for fee schedule
* removed unused dep, prettier