A decentralized exchange system is a good idea but the hard part is handling funds and verification. Just saying you did a trade isn't enough that it should be treated as real by others. Obviously that would be abused right off.
For local meet up handling funds isn't such an issue, though you would want to know an offer is real before putting much effort into meeting. But for doing non-local trades you need some system for escrow, and/or verification, and reliable feedback. So at the least you need to integrate key signing and some identity verification.
You might be able to model such a network after Bitcoin itself using a blockchain to store offers, trades and feedback. "Miners" on this network could be awarded a fee from trades to pay for auditing and recording the trade info. I haven't thought it through but with such a model you already have the source code and can look at how it might be adapted to record trade messages instead of actual transactions.
So you might generate a key pair and use it to send a ID msg containing geohash and identity info, thus recording yourself in the network. Other msgs could be BID qty@ price, BUY qty@price.
I am thinking what would be the best way to approach this. First, it is important to think that this system would only work in local shops, that would act as exchanges. Secondly, what i think is that, in order to calculate the price, the volume should be an important factor. So if the system counts with the centralized engines to suck their volume and price, the attacker would need a large amount of coins to move the price up or down.
As the system gains traction and users, the network is more protected (because of the same). Transactions -except the ones reported from large exchanges- can be checked in the bitcoin blockchain, so it would cost bitcoins (fees) to move the price.
So first: when your client starts, it asks for the price, so the msg would be something like:
Ok, im here ezjmuqs1pgkd0 give me the price.
¿No response?
Ok, im here ezjmuqs1pgkd give me the price.
¿No reponse?
Ok, im here ezjmuqs1pgk give me the price.
¿No response?
Ok, im here ezjmuqs1pg give me the price.
¿No response?
Ok, im here ezjmuqs1p give me the price.
¿No reponse?
Ok, im here ezjmuqs1 give me the price.
response: Hi there, i'm near you and the price is: 103.7€ N is 1231230123012391291293123
I use geohashes not to flood the network, but everybody should have the same price.
Now your app continues calculating the price with every transaction reported by doing 103.7*1231230123012391291293123 = 1.27679E+26 (lets call this "THE NUMBER")
Every time a price is reported it adds the price*amount of bitcoins to 'the number' and the amount of bitcoins to the N, Then the price is 'the number'/N
Of course this needs to be worked out but it gives you an idea of what i want to do: To keep the track without storing any data.
If everynode disconnects, by the way, the track would be lost. But when the first node connects again, then the system starts with the centralized exchanges price from the beginning.
Why don't i keep the history? Because its intended to work in a mobile phone.
If everybody does the same maths the price should be the same, so if someone reports a diferent price can be marked as an attacker and ignored. By the way, someone can report a different price if the network is splitted and rejoined... and he wouldnt be an attacker.
A solution to this needs to be worked out too, maybe every hour or two the network should resync.