Oracle and derivative recipes are special contracts in which anyone can describe the logic of a derivative or oracle. This logic is stored in the recipe, and the Opium core has access to it when it wants to run the logic when needed, for example at the execution of positions. The Opium core checks the formulas in derivative or oracle recipes and uses the result for getting the price from the real world and redistribution of the margin.
Derivative recipes can be constructed for any derivative as the high-level logic is the same: payouts of margin inputs are calculated in some way (derivative recipe) according to certain price or event data (oracle recipe). Derivatives in the Opium Network can be cash-settled or physically delivered (in case of cryptocurrency or tokenized asset). Derivative recipes describe how margin inputs are paid out at execution, and oracle recipes describe the way of data fetching, which exact data is fetched and how this data is processed.