Real assets in the energy market are subject to ecological uncertainty due to the penetration of renewables. We illustrate this point by analysing electrolysers, a class of assets which recently became the subject of a large interest, as they lead to the production of the desirable green hydrogen and green ammonia. The latter has the advantage of being easily stored and has huge potential in decarbonising both the fertilizer and shipping industries. We consider the optimization of green ammonia production with different types of electricity procurement in the context of stochastic power and ammonia markets, a necessary assumption to translate the features of renewable, hence intermittent, electricity. We emphasise the importance of using stochastic prices to effectively model the volatile nature of the price dynamics, illustrating the project risks that can be mitigated by hedging activities. This study shows the pivotal role of flexibility when dealing with fluctuating renewable production and volatile electricity prices to maximise profits and better manage risks.