makerdao / market-maker-keeper

Maker Keeper Framework: Market maker keepers for OasisDEX, EtherDelta, 0x (RadarRelay, ERCdEX), Paradex, DDEX, IDEX, Bibox, Ethfinex, GoPax, HitBTC, TheOcean, OKEX and Gate.io.
GNU Affero General Public License v3.0
479 stars 182 forks source link

Dydx fix for negative balances #168

Closed MikeHathaway closed 4 years ago

MikeHathaway commented 4 years ago

If balances aren't lowered when an order is placed, don't orders from other pairs need to be brought into consideration?

For example, assume there are only two keepers, trading WETH-DAI and WBTC-DAI. For sell orders, wouldn't the WETH-DAI keeper need to know about active sell orders for WBTC-DAI, since they share the same quote token?

So we currently trade each pair with a unique keeper so this wouldn't be a concern with our setup. That being said, I added additional logic to check other orders for future proofing sake.