In my limited understanding of smart contracts, I've read that every node on the Ethereum network must execute a smart contract to come to consensus. I'm guessing that not all these nodes execute the contract at the same time. If this assumption is true, then what happens if a smart contracts depends on data that fluctuates, e.g. the price of a crypto/currency? If those execute the contract at different times and the value of the currency is different at each of those times, how is consensus reached?
In summary, this is a limitation of smart contracts on Ethereum. You can't write a contract that depends on an external input like that.
Everything needs to independently verifiable by every node, now and in the future. No external input meets that criteria.
Of course, it is still useful to have external input, so what is the solution?
A smart contract can verify that an external witness (externally owned account) attested that a given input was a given value at a given point in time. This signed transaction (with data) will become a fact of the blockchain that all nodes will be able to confirm.
Once this "Oracle" pattern is understood, it becomes less of an engineering problem and more of a business process problem. Who or what will function as the Oracle, where will get its authority and why should participants trust its input implicitly?
This may help: How do oracle services work under the hood?
Hope it helps.