Currently building a stock exchange on Ethereum. Based on the current design, I have users creating individual buy orders as separate contracts tied to a central stock counter contract in the form of a list or mapping.
As certain operations on the exchange require the finding of the highest priced offer I was just wondering if it's possible for me to search through the list and sort the buy orders locally instead of running a function on the Ethereum blockchain which could possible cost alot of gas.
Any help provided would be much appreciated.