Dexie Incentives Program and the Case of the Auto-Canceling Offer File

This article was adapted with permission from a Twitter thread by @endertown. See the original thread for further discussions.

The Dexie Incentive Program is a fantastic way to make your coins work for you. By simply posting offers within 5% of market price, you will earn DBX over time while that offer sits unfilled. It currently only applies to SBX and DBX but I’m sure there are plans to extend it to other popular pairs as well.

With that being said, how can we break it, exploit it or otherwise maximize our rewards?

First, let’s think through the strategy. Let’s say you own 1 million SBX and you’d like to offer it up for sale on Dexie to capture some of those sweet incentives! How would you offer it? Would you just put the entire 1M in a single offer file at the lowest price?

That will certainly max your incentives, but OOPS now someone else can take it and put it right back up for a bit higher price. Now you’ve made minimal profit and lost all your fuel for the incentive engine – the worst of both worlds.

Currently incentivized pairs in the Dexie Incentive Program

Ideally you will split it up into several offers, each one a little more expensive than the last. If you can keep them all under 5% of market price, you will still earn incentives (albeit not as much as if you had put it all at lowest price).

This still doesn’t protect you from the “moon scenario” in which the coin you are offering suddenly moons. Now all your lowish incentivized offers are gonna get snapped up before you wake up next morning. Again, you earned incentives, but you missed the advantage of the moon because you sold too low.

Here’s what we really want: ideally, we’d be able to post what I call a “canary” offer, named after the famous canaries in coal mines who would warn the miners of danger. A canary offer is one that would act as a signal flare to your other offers, telling them to quickly cancel themselves.

You could split that 1M SBX into 2 coins: maybe a 10,000 SBX coin and the reminder in a second coin. You’d set the smaller offer to be a tiny bit cheaper than the larger offer so that it would show up on the list first. Ideally, a buyer will accept that smaller canary offer first, which would auto-cancel our other large offer. Now you can put up the larger amount in another higher offer later once you (or your bot) have reassessed the market.

This gives you the best of both worlds: you can offer up a large amount of SBX at a low price to collect maximum incentives, but you aren’t actually in much danger of selling that large amount at that price because your smaller “canary” offer protects you. But how would we create these “canary” offers?

What is an Offer File, really?

Let’s first discuss the offer file itself. An offer file simply contains a list of coins that will be spent when the offer is accepted and a list of coins that it expects to be spent by the acceptor. The list of coins that we are offering as the offeror are known; they are real coins in our wallet right now. The exact list of coins that we are expecting to get back from the acceptor are NOT yet known, because we don’t know who will accept the offer yet, but we at least know the list of coins that we expect to get back (even if we don’t know their exact unique coin id yet).

It is important to note that nothing has actually been spent on the blockchain at this point. We have simply created a list of our coins that we are willing to trade for a list of other coins.

When the offer is accepted, the acceptor must fill in the missing list of coin ids from their wallet to complete the trade. Once they do that, the whole offer is now ready to be recorded on chain. The original offered list of coins go to the acceptor’s wallet and the requested list of coins go to the offerer’s wallet, all in the same block.

What does it mean to cancel an Offer?

When you cancel an offer, you are given a choice: do you want to cancel it on-chain? What does this mean?

Recall that an offer file is just a list of coins that you have approved to be spent as long as a list of other coins get spent back to you. If you haven’t actually shared that offer file anywhere yet, then it is probably safe to cancel it “off-chain.” This just deletes it from your list. Theoretically it could still be accepted if someone was able to fish it out of your recycle bin, for example. But if you know that it has never been made public, it is safe to cancel it “off-chain.”

However, if your offer has already been made public, you definitely want to cancel it “on-chain.” All that really happens behind the scenes is that your wallet sends one of those coins listed in the offer back to yourself! It will now have a new unique coin id and so anybody who loads up that offer file will see that one of the coins has already been spent on the blockchain. They will be unable to accept the offer if even one coin in it has already been spent, therefore it is now considered “canceled.”

Now we can talk about Canary Offers

Now that we understand the mechanism behind offer files, let’s get back to our original goal. What if we split up our SBX into THREE coins instead of two? Both our smaller canary offer and our larger main offer will share one of these coins. Our smaller offer will be slightly cheaper, so our hope is that our buyer will accept that one first. And since the shared coin is now spent, the second larger offer is automatically canceled, all in the same block!

WOOHOO we’ve done it!

Hah! Nope. You don’t think the dexie coders already thought of that? Of course they did! Their incentive program searches offer files for duplicate coin id’s and will only pay incentives on the cheapest offer file that contains duplicate coins!

You can still create these canary offer files and they will still work as described, but you won’t be getting incentives for it, so it isn’t really worth it.

Then why did you waste my time reading all this?!?

Because I found a loophole. 👀

You know that you can add a fee when you create an offer file, right?

So what if…

You just used the same fee coin across multiple offers? Would the Incentive program check for duplicate fee coins as well? This would have the same effect: when the smaller offer is accepted with the duplicate fee coin, the larger offer would then be considered canceled!

Anyway, it worked. I was able to temporarily game the incentives program to pay me incentives on offers that would *poof* vanish as soon as someone accepted the smaller canary offer. I reported it to dexie and they have already fixed it.

WHAT?!? So you did waste my time…

I dunno, I mean we all learned something, and I got to brag a little about how smart I am, so I feel like we are all winners here. Special thanks to dexie for a prompt response, fix and bug bounty distribution!

Wait, canary offers still sound useful for something.

Why yes, you are correct! SoonTM

Original Thread

Share the alpha
Avatar photo
Josh Painter
Articles: 2

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *