How to Participate in RAI Debt Auctions

Part Two for Bidding Auctions Using a UI or a Bot

Stefan Ionescu
Reflexer
5 min readMay 14, 2022

--

In this post, we’ll give an overview of RAI debt auctions and the two main options you can use to bid in them.

What are Debt Auctions?

Debt auctions are used to recapitalize the RAI protocol (bring in new RAI on the protocol’s balance sheet) in exchange for the protocol minting new FLX tokens that are offered to winning bidders. In a debt auction, bidders accept decreasing amounts of FLX in exchange for the same amount of RAI and in the end, the winner sends RAI to the protocol in exchange for newly minted FLX.

How Do Debt Auctions Work?

Before we describe the auction process, let’s go over a couple of important parameters:

  • totalAuctionLength: this is the total auction duration. It’s worth noting that if no one bids in the auction within totalAuctionLength seconds since it starts, the auction can then restart and run for another totalAuctionLength seconds
  • bidDuration: this is the amount of time the auction can still run for after someone submits a bid. If someone submits a bid and no new bid comes in for the next bidDuration seconds, the auction can settle. On the other hand, if someone does submit another bid within bidDuration seconds from the last one, the auction can run for another bidDuration seconds. Note that the auction is still bound to run a maximum of totalAuctionLength seconds
  • bidDecrease: this is the minimum percentage decrease in a new FLX bid compared to the last submitted bid. For example, let’s say the current bid is 1 FLX for 50 RAI and bidDecrease is 5%. This means that the next bid must be at best 0.95 FLX for the same amount of RAI. This parameter minimizes griefing (to a certain extent), meaning that bidders must submit bids that are significantly lower than the previous ones
  • debtAuctionBidSize: this is the amount of RAI that’s requested by the auction. This parameter is fixed throughout the auction duration
  • initialDebtAuctionMintedTokens: this is the maximum amount of FLX that can be minted in a debt auction. Any debt auction bids must be smaller than this value
  • amountSoldMultiplier: this is a multiplier applied to initialDebtAuctionMintedTokens FLX minted by the protocol to the auction winner in exhange for debtAuctionBidSize RAI

In RAI’s case, the parameters are set (and already ungoverned) as follows:

  • totalAuctionLength: 3 days
  • bidDuration: 30 minutes
  • bidDecrease: 3%
  • debtAuctionBidSize: this variable is recalculated periodically by a contract called DebtAuctionInitialParamSetter. At the time of this writing, the variable is set to ~23K RAI
  • initialDebtAuctionMintedTokens: this variable is recalculated periodically by a contract called DebtAuctionInitialParamSetter. At the time of this writing, the variable is set to ~185 FLX
  • amountSoldMultiplier: 1.2x

Now, let’s analyze a scenario to see how debt auctions may play out in the wild.

Let’s assume we have two bidders, Alice and Bob. Let’s say the auction started with debtAuctionBidSize set to 1000 and initialDebtAuctionMintedTokens set to 10. Alice submits the first bid, 9 FLX for 1000 RAI. The 30 minute countdown for the auction starts. Bob waits 20 minutes and decides to bid 8 FLX for 1000 RAI (even though the minimum to bid was 8.73 FLX). The 30 minute countdown restarts and Alice decides to send another bid of 6 FLX. 30 minutes pass and there’s no new bid so Alice becomes the auction winner.

Overview of the Debt Auction Dashboard

The easiest way to bid in a debt auction is with the Reflexer debt auction dashboard.

The dashboard gives you an overview of all active debt auctions and allows anyone to submit FLX bids (and send RAI to the auction). The UI shows the latest bid value for each auction as well as the end date for the auction and the full bidding history.

You can use all this data to decide if you’d like to participate in an auction. In order to bid, choose one auction and click on the Bid-> button.

Once you click on Bid->, you should see a popup where you need to input the amount of FLX you’re willing to accept in exhange for debtAuctionBidSize RAI. Enter the amount of FLX you’re willing to accept and click Review Transaction.

Finally, click on Confirm Transaction and then approve the transaction in your wallet.

You should now see your bid listed under the debt auction.

Overview of Debt Auction Bots

The debt auction bot is a script that can be run continuously to monitor the status of debt auctions in the RAI protocol.

Debt auction bots can:

  1. Prepare Debt for Auction
    When a collateral auction starts in the RAI protocol, the confiscated RAI debt (from the liquidated Safe) is put in a queue. That queue can be freed every couple of days (what is called the popDebtDelay) and the debt auction bot can facilitate that process.
  2. Start Debt Auctions
    If the RAI protocol has enough “bad debt” (and no surplus), anyone can start a debt auction. The amount of debt required by an auction is called debtAuctionBidSize, which at the time of this writing is ~23K RAI. Once an auction starts, anyone is free to bid in it. Multiple debt auctions can run at the same time.
  3. Bid in Debt Auctions
    The bot can automatically bid on debt auctions that are already running. It can also out-bid other bidders on existing auctions, by accepting less FLX (freshly minted by the protocol) for the same amount RAI.
  4. Settle Debt Auctions
    When no new RAI bids have been received for bidDuration (since the last submitted bid), a debt auction can be settled. As of this writing, bidDuration on mainnet is 30 minutes. This completes the auction process and transfers RAI to the winning bider.

Note that if a debt auction doesn’t have any bid for totalAuctionLength seconds (as of this writing, 259,200 seconds), it can restart. When a debt auction restarts, the starting amount of FLX that the protocol can mint in exchange for debtAuctionBidSize RAI is multiplied by 1.2X.

Running the Debt Auction Bot

The debt auction bot can be run from a Docker container or directly on a Linux host. Docker is the preferred method in order to avoid dependency issues.

Detailed instructions used to run a debt auction bot can be found here.

What Now?

This guide should have covered what debt auctions are, how they work and how you can take part in them. To learn more about auctions and about RAI in general, check out the following resources:

--

--