Imagine we have several different tokens, and we want to know which one is most valuable. Tokens are contracts with methods to satisfy the Token API.
If you have a decentralized exchange, you can put in a "buy" order at price X for a token, and if nobody is prepared to fill that order over a sufficient period of time anybody watching can conclude that the token is worth at least X. (You can manipulate this if you're prepared to spend enough buying your own token, but given enough liquidity making your token appear the most valuable should cost the market cap of the token that's really the most valuable.)
Is there a way to do this securely with arbitrary tokens (ie any code that satisfies the semantics of the Token API), or will that be impossible to secure? The kind of thing that occurs to me is that if the attacker can make the token contract themselves, they can prevent it from funding the exchange, so nobody is able to fill their offer. So I'm wondering if it's an inherently unsolvable problem, or if it's just that my decentralized exchange design is too dumb.