Flip auctions vs Selling collateral on Exchanges such as uniswap

It occurs to me that this business with the the recent flip auctions might have been avoided if the protocol had a more straight forward way of selling the users collateral. Say for instance, just swapping the collateral for DAI using uniswap.

Presumably an alternative system could be conceived where the protocol makes use of the liquidity of these decentralized exchanges until it is exhausted before having to fall back and actually trigger an auction.

Curious if this has been discussed in the past. What are the potential downsides that i am not considering? Would we ever consider making use of the other defi projects in order to improve liquidation efficiency or mitigate liquidation risks? Would also love to hear any alternative liquidation systems that we believe might also be an improvement on what we have today.


I think this is is a great idea!

One downside is that it creates a downward pressure on the price of the collateral asset. For example, ETH is falling, vaults get liquidated, liquidation sells on Uniswap or Kyber pushing the price of the collateral lower. For illiquid collateral this could have a cascading effect. This probably means we just shouldn’t use an illiquid token as collateral though.

How about pricing the asset on a reserve like Uniswap or Kyber, and then using this as the price floor on the auction? If someone can do better than the market they win the auction but the auction defaults to selling on a secondary market.

This adds some price competition, but there are probably still problems, and I think it would be complex to implement :thinking: I’m interested to hear more thoughts on this


There isn’t sufficient liquidity with on-chain DeFi auctions to absorb even a single large vault liquidation.

Is this really a problem if the default is to fall back to flip auctions if there is not sufficient liquidity? For these large CDPs we could just fall-back to the system as currently implemented.

Second thought on this. How big of a problem is this really? There is currently about 1.5MM dai in uniswap. How many CDPs are there out there with a dai debt > 1.5MM? Some probably but is this 10% of the vaults or is this 50% of vaults. Also it seems to me that the larger CDPs are going to be less likely to get liquidated anyway since they stand to have a lot more to lose.

That seems like a great idea to me!

It is superior to allowing the collateral to be sold for 0

After giving this a bit more thought it is a bit unclear to me how you might go about implementing this. One thought i had would be to set up a keeper that could place an initial bid based on the uniswap price. I see 2 problems with this: 1 where will it get the DAI for it’s initial bid? 2 what happens if the uniswap price drops before the auction is over.

Ignoring the problems in #1 you would run the risk of the price dropping below the price floor before the auction is finished. Potentially you might have the the keeper bid something like 1/2 the uniswap price which could probably save you as long as the current volatility wasn’t too high but the risk would still be present.

Again it seems more straight forward and less risky to me for the flip contract to just check the exchange liquidity for DAI / collateral price and immediately liquidate when kick is called by the cat contract. That is supposing that there is sufficient liquidity to cover the tab. If not it would emit the kick event and the auction would begin same as it does today.

Maybe i just have a lack of imagination here on how you might be able to implement this. Any thoughts on how the cat / flipper contracts might be modified to ensure a floor price for the auction?

Perhaps a reserve auction could be implemented by making changes to the deal function of the flipper contract. The flipper could check the exchange price when deal is called and supposing that the exchange price is higher than the winning bid the flipper could chose to sell the collateral at exchange rates and refund the original bidder from using the proceeds of that sale.

No, not really.

Look at the bottom of the OasisDEX bids, and imagine settling ETH at .01 Dai each.

You can’t just dump millions of ETH onto DeFi exchanges and get a result that is even close to OK.

On Uniswap, you can. Your reference to an orderbook implies you do not know much about Uniswap.

There would also be substantial arbitrage as a result. I’m not sure we would need any additional incentive for the liquidator to pay for the gas, and we would have a much stronger floor than 0.

You may also be able to setup some sort of throttling mechanism to mitigate these concerns. The flipper could potentially check the throttle before deciding to offload the collateral onto the exchanges.

Potentially this could be implemented by some token bucket type solution but there might be a better throttling algorithm.

Maybe count on the MKR holders to decide the token bucket parameters like burst size and average rate.

concerning specifically:

Do we know that the current keepers are not already offloading the collateral to exchange immediately? I suspect this may not really be all that different from the system we have today anyway.

I wanted to bump this conversation now that things have slowed down a bit / the flop auctions are well underway. Really hoping to hear any other conceivable system alternatives! Would also love further criticism on the alternative altered in my original post.

here is another crazy idea i had after reading through this medium post. If the ultimate root case of this event boils down to “too much network congestion” for people to be able to practically put in new bids could this problem had been mitigated by tying the bid ttl to the average gas price of a transaction.

source: https://etherscan.io/chart/gasprice

If there was an oracle that published this average gas price it would presumably be feasible for the flipper to set the bid ttl to a larger value in times where the gas price is shooting up as it did on “black thursday.” Presumably this would help keepers place their bids in times when the network becomes stressed.

We need EIP 1559 ASAP

I do not see how this could be automated in a trustless way. Basically keepers are doing what you describe. Buy the collateral and then sell on uniswap/kyber/0x. They probably will buy the collateral if they can make a few %profit this way. The only problem last time was the failure to adjust gas prices so that bids didn’t go through.

Keep in mind that if you make a system where you only need keepers 1% of the time- they may not be there when you really need them. Keepers will buy the collateral if they can flip it on uniswap for a small profit. But you need to keep them interested so that in the major black swans there are enough of them there. The only problem last time was failure to adjust gas prices and not enough of them around. There is not fundamentally a problem with buying collateral that can then easily be sold on uniswap.

It appears that the system would work better with no keepers than with 1 or few keepers during black swan events. The system should be redesigned so that it works fine in such black swan events.

Changing the few parameters and the UI hoping there will be more keepers is not a solution. Nobody will trust that and there will be no new loans.

We should assume that there will be exactly the same black swan event and that despite all measures there will be exactly 1 active keeper offering near-zero bids. The system should be redesigned to handle such situation so that the vaults are never liquidated below the average market price on DEX-es.

I’m sure that if we agree that it should be done - the devs will find smart ways to do it.
If we don’t want to do an alternative selling process, the system could at least detect such condition and take measures (notifications/pause auctions/exec votes…).

1 Like

All solutions break down if you assume there is only one actor, even Dexes and exchanges. We should absolutely be trying to find incentives that encourage keepers to participate and make it easier for them to do so. The black thursday event was really more of a code failure where keeper software didn’t adjust gas prices correctly. Even if there had been 2 or 3 of them bidding, the prices would have gone up close to the market price - this is a much easier goal to achieve than trying to automatically sell collateral on exchanges that can be gamed or manipulated. Agree that some hybrid solution may be possible but we should be finding ways to encourage more keepers not giving up on them .

I think this is a fair criticism, but i think the “hybrid” auction could likely still keep incentives in place. I’ve talked a bit previously about changes that i believe could be made to the deal function . Perhaps the deal function only attempts to offload the collateral to the DeX if the bid is say < 50% of the osm price. This should still leave the keepers plenty of opportunity to buy discounted collateral without allowing them to bid $0 for it.

This is kind of what i am saying about making the bid ttl a dynamic value. If we can detect network congestion then we might be able to use it to raise the auction duration in times of stress. This might give the keepers the ability/time to compensate to extreme conditions without forcing the tau and ttl values to just be set to extremely high levels which is also a concerning state of affairs.

Agree a hybrid solution could work- but I think it would be very difficult to code securely. Transactions to uniswap and dexes can fail and then how many time would you keep retrying?