Chia recently introduced offers, but there’s no good API for getting all the offers currently available.
Centralized offers databases are okay, but in the spirit of defi it feels right to have a decentralized backend of offers that isn’t controlled by a single party. Once the backend is in place folks can get creative with how they present the offers to end users.
It should be possible to build a decentralized pool of offers, similar to a mempool.
The number of offers could be large, but we can ignore that for now and assume it won’t be an issue since storage is cheap.
At the most basic level, the offer pool would need a distributed database. I’ve read about three so far GUN, OrbitDB, and Scuttlebutt.
Let’s pick OrbitDB.
Let’s make it an append only database of offers, that way when someone joins they get the full history. Maybe there will be a way to prune the local database afterwards if they don’t want years worth of invalid offer data.
Let’s push off doing any kind of pruning of offers from the database to a seperate service. We just want to distribute the database of offers for now.
In an ideal world we would validate the offers before adding them into the pool. Orbitdb does allow for validating via a Custom Access Controller but if the format of the offer file changes we would need to update the access controller which I think will change the address, so let’s just not do any validation of the entries at the orbit level and we can deal with that at the application level, and hope that people act in good faith and don’t go out of their way to put junk in the pool, though it will just be ignored by the consumers.
All of this is very alpha, so I’m just going to release it as open source and see if it works.