# Derivative contracts

To understand DIVA Protocol, it is essential to first understand what a derivative contract is. A derivative contract is an agreement between two parties that specifies under which conditions payments shall occur. To participate, each party must deposit a specific amount of money. The payout is *derived* (hence the term "derivative") from the outcome of a pre-agreed future event based on a pre-defined payoff function.

The key elements of a derivative contract are illustrated below:

<figure><img src="https://1305042189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHZJ0AbZj1fc1i5a58eEE%2Fuploads%2FITmMMb2yckvdBlQkdJix%2Fimage.png?alt=media&#x26;token=b76136d7-ced2-447c-8809-c827c47548cf" alt=""><figcaption><p>Key elements of a derivative contract</p></figcaption></figure>

Derivatives are widely used for speculation and hedging purposes.

### **Examples**

* **Bet/prediction:** The most basic example of a derivative contract is a bet/prediction. Alice and Bob each contribute $100 to a pool and agree that the total amount of $200 will be distributed based on the outcome of a tennis match between player A and player B. If player A wins, Alice will claim the entire pool while Bob receives nothing. Conversely, if player B wins, Bob will claim the entire pool, while Alice receives nothing.&#x20;
* **Insurance:** Another example of a derivative contract is an insurance agreement. Bob pays $100 in order to receive a payout of $1000 in the event that his house burns down. That is, the insurance company is effectively contributing $900 to the pool. If no fire occurs, the insurance company keeps the full $1000, and Bob does not receive any payout.

Many other financial instruments, including options, swaps, and futures, operate based on the same fundamental principle.

### Derivative positions

Each party's position in a derivative contract is referred to as a derivative position or simply derivative. Each derivative position is associated with a payoff function which assigns a specific value to each possible outcome of the future event. The two payoff functions associated with a derivative contract follow a zero-sum principle, meaning that one party's gain is the other party's loss.

The position that is benefiting from an <mark style="color:green;">**increase in the underlying**</mark> is referred to as the <mark style="color:green;">**long position**</mark>. The position that is benefiting from a <mark style="color:red;">**decrease in the underlying**</mark> is referred to as the <mark style="color:red;">**short position**</mark>.

### Payoff functions

The payoff function can take any form or shape. In our previous example, the payoffs for Alice and Bob can be depicted as two directionally reversed binary functions, where a reported outcome of 1 or higher corresponds to a win for player A and a value less than 1 indicates a win for player B:

<figure><img src="https://1305042189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHZJ0AbZj1fc1i5a58eEE%2Fuploads%2FBBaSb8NIoSLG7fBW5HKH%2Fimage.png?alt=media&#x26;token=6181c85d-59bf-462c-b36a-7eab0244c380" alt=""><figcaption><p>Payoff profiles associated with Alice's and Bob's derivative positions</p></figcaption></figure>

Another example could include using a linear function within a predefined range for non-binary underlyings such as the price of Bitcoin, as depicted below:

<figure><img src="https://1305042189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHZJ0AbZj1fc1i5a58eEE%2Fuploads%2F1TXIcGnJaK1S8BpnuzjW%2Fimage.png?alt=media&#x26;token=e44381dd-803b-4ad2-ad70-e1b587f414b0" alt=""><figcaption><p>Linear payoff example</p></figcaption></figure>

Note that the two payoff functions are typically capped as the amount deposited into the derivative contract is capped.

One of the DIVA Protocol's distinctive features is its ability to tailor a derivative contract's underlying payoff profile, accommodating various slopes, barriers, and ranges.
