So, first I want to preface this by saying my experience with DeFi in general is pretty limited. I haven’t used any of the major platforms like Uniswap or Sushiswap or any of these liquidity pool / token etc systems. And I don’t really have any desire to, mostly out of a lack of trust. Without the ability to thoroughly audit these platforms it is impossible to know whether they are properly hardened to avoid getting completely hosed. And that’s because they aren’t really decentralized, they are simply distributed. Each swap provider is its own central point of failure. That brings me to DeFi on Chia.
Chia Network is taking a bit of a different approach to enabling a DeFi ecosystem. Instead of requiring institutions to hold liquidity to enable swaps, Chia has written a smart contract platform called Offers which enables true peer to peer asset exchanges between asset types. For example, on the Ethereum blockchain if you wanted to exchange your Ether for USDT you would need to use a professional fee-based service that holds both and and sells one for the other. This service can be a smart contract instead of a web service, which is I think why they call it DeFI, but its still a centralized mechanism of exchange, architecturally speaking. Offers allows any two users on the Chia blockchain to directly exchange one asset type for another without sending funds to a centralized service or smart contract.
This doesn’t prevent centralized services from leveraging this technology stack to do business, but it does mean that Chia blockchain users can sidestep them entirely. In fact, I think for most of the trading that is traditionally done on DeFi, trading one volatile asset for another, a centralized service keeping track of spot pricing and protecting its users from massive price swings will probably be worth a small fee.
An offer file is the output of creating a partial filled transaction using the Chia blockchain. Creating an offer does not actually transact on the blockchain itself, but basically uses the wallet keys to sign a commitment to fulfill a transaction. Because this doesn’t exist directly on the blockchain it does not take a transaction fee to create. It also cannot be filled by someone just watching the blockchain, so you can use them for private transactions without exposure to someone you hadn’t planned on filling the order before your intended recipient. As long as you are careful with the offer itself.
Inside the offer is just a string of text starting with “offer1” and a couple kilobytes of encrypted text. It looks a little bit like a traditional certificate file, because it kind of is, or is at least similar. It describes the offer, and is encrypted with the keys from the wallet creating the offer. When you create one, it locks up the coins used to generate that offer, but this is a client side restriction done to make your life easier and not a hard requirement. An offer can be created and a spend forced against the same coins using 3rd party software, or a wallet that doesn’t see the offer creation. This will just create a situation where the offer file fails when the other party tries to complete it, even if you still have enough balance in your wallet. An offer is not generated against a wallet but against a specific coin in that wallet, so be aware. This also means that you can lock up significantly more than you intend. The code block below is an example of a real offer file.
That offer, loaded into a light wallet, will enable someone to spend 100 000 XCH and buy The Chia Plot Master token. This is an example of a straightforward transaction of 1 CAT for a set amount of XCH, but you can create them as complex as you would like with a large set of CATs and XCH for another set of CATs and/or XCH. Sky is the limit from what I can tell (although there are also probably some limits).
Right now the decentralized exchanges that launched with Chia have done so as simple marketplaces for offer files. You can add offers to OfferBin and Hashgreen directly from the Chia light wallet client and the experience is pretty good. Anyone can browse those marketplaces, download an offer file and complete the transaction without communication with the original offer creator.
In a sense, this isn’t really decentralized because it involves websites that are central points to aggregate offers. But the underlying technology does not require this, and there are a nearly infinite number of platforms or mechanisms two people can use to complete an offer. I can open one up on my computer, phone someone, read them the very long string of text while they type that into a text file on their end and then complete the transaction without a file passing between us. You can post them to a discord channel, or a keybase channel – which Chia has created, and is also seeing a lot of use. You can post your offer on twitter and have people grab them and complete them.
As this is my first real experience delving into DeFi I am not sure what I expected. I see a ton of potential here for using offer files as payment options for assets that are represented by a CAT on the Chia blockchain. It is very easy and cheap to mint a set of tokens, and once you have a token it is very easy to sell that token using offer files. What is difficult is dealing with rapidly changing pricing, that is going to require centralized services to act as counterparties to trades so that offers do not sit so outside market rates that they don’t get filled constantly. Right now to create an offer for coins with volatile pricing, like SpaceBucks, you have really pay attention to the market and basically guess at what price to set your offer at and hope it gets picked up right away. Services are certain to spring up around this problem, but likely at the cost of decentralization and the peer to peer experience.
These are early days for DeFi on Chia. It is unlikely that what we are looking at now will be the state of the art for long. Based on the rapid development on all the marketplaces I have looked at (Offerbin, Hashgreen, and Tsunami) I think that in a month or two a lot of the rough edges will have been sanded down and the experience will be a lot more polished. If you want to see a really cool social experiment with Chia DeFi and CATs check out Freddie’s new blog 1mojo.trade. It is a fascinating journey and is likely to be cutting edge on Chia DeFi as long as it is going on.