# How To Manage the Global Position

Canonical page: https://docs.denaria.finance/tutorial/how-manage-global-position

Status: current

On Denaria, each user has **one global position** per market and every new trade is automatically netted against the existing exposure.

This means:

- Long trades **increase** long exposure.
- Short trades **reduce** long exposure.
- If a short trade is larger than the current long, the global position **flips** to short.

Is important to notice that the protocol **does not** track trades separately at the smart contract level. It always tracks the **net exposure** and the **total collateral**.

---

### A practical Example

# ![](https://docs.denaria.finance/img/tutorial/08_howToManageGlobalPosition.png)

Let’s use a practical example to understand how a trader can manage is global position.
The starting point is the following:

- Collateral: **$10**
- Global Exposure: **Long $50**
- Leverage: **5×**

The formula for calculating the leverage for the global position is the following: 

<u>***Global Leverage = Total Collateral / Net Exposure***</u>

From this state, three outcomes are possible.

---

## Scenario 1 — Increase the Long

**New action executed by the trader:**

`+ margin $50 @ 3x → +$150 exposure`

The trader opens another long position.

### What happens

- The new trade adds **$150** of additional long exposure.
- The trader adds **$50** (3x leverage) of new collateral.
- The protocol sums everything.

### Result

- New Global Exposure: **Long $200**
- New Collateral: **$60**
- New Leverage: **3.3×**

### New state of the global position

The position remains **long**, but larger.

Leverage is recalculated using total exposure and total collateral.

---

## Scenario 2 — Reduce the Long

**New action executed by the trader:**

`+ margin $10 @ 2x → −$20 exposure`

The trader opens a short smaller than the current long.

### What happens

- The short introduces **$20** of short exposure (10$ at 2x leverage)
- This partially offsets the existing $50 long.
- The position remains net long.

### Result

- New Global Exposure: **Long $30**
- Collateral: **$10**
- New Leverage: **3×**

### New state of the global position

The short acts like a **partial close** of the long. No new collateral is required.

The trader is still long, but with smaller exposure and smaller leverage.

---

## Scenario 3 — Flip to Short

**New action executed by the trader:**

`+ margin $50 @ 3x → −$150 exposure`

The trader opens a short larger than the existing long.

### What happens

- The $150 short more than offsets the $50 long.
- The net exposure crosses zero.
- The position becomes short.

### Result

- New Global Exposure: **Short $100**
- New Collateral: **$60**
- New Leverage: **1.7×**

### New state of the global position

The original long is fully neutralized.

The excess short becomes the new global position.
