Alice and Bob are two counterparties with different views on the price of gold.
Some users of derivatives speculate on price movements, and others hedge their risks. Alice thinks the price of Gold will go up. Bob thinks the price will go down. They both place a margin of 20% in a contract.
In this example, the contract will expire in 5 months.
By that time the price will have gone up or down. Derivative contracts on Opium Protocol can only be executed at maturity, but positions can be traded on secondary markets or transferred to other wallets.
At maturity (in 5 months) the price of gold went down 15% relative to the price of the futures contract.
If Alice had a long position and Bob had a short position, Bob would receive both his full 20% margin as well as 15% of Alice’s margin. Alice will only receive back 5% and lose 15% to Bob since her view on the market was wrong.