> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pacificalens.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Size positions precisely with the Pacifica Risk Manager

> Calculate contracts, required margin, liquidation price, R:R levels, and funding cost — then execute the trade directly on Pacifica DEX.

The Risk Manager is a professional position sizing calculator designed for disciplined perpetuals trading on Pacifica. Enter your account size, risk percentage, entry price, and stop loss, and the calculator instantly returns the exact number of contracts to trade so that a stop-loss hit costs you precisely your chosen risk amount — no more. It also projects the required margin, estimated liquidation price, take-profit levels at multiple risk:reward ratios, Expected Value, and the daily and weekly cost of holding the position through funding payments. When you are ready, you can execute the calculated trade directly on Pacifica DEX with a single click.

## Calculator inputs

The calculator panel sits in the center of the Risk Manager layout. All fields update results in real time with a 350-millisecond debounce, so you do not need to press a calculate button.

**Direction**

A Long / Short toggle at the top sets the trade direction. The toggle controls which side of the stop loss is valid and how liquidation price is computed.

**Account size**

Your total account equity in USDC. When your wallet is connected, this field auto-fills from your live account equity. You can override it manually at any time.

**Risk % per trade**

A slider from 0.5% to 10% that sets how much of your account you are willing to lose if the stop loss is hit. The dollar equivalent updates next to the slider as you drag. A color indicator shows safe (green ≤ 2%), moderate (amber ≤ 5%), and high (red > 5%) risk levels.

**Entry price**

The price at which you plan to enter the trade. Auto-fills from the current mark price of the selected market when you switch symbols. Click **Mark** to reset to the live price at any time.

**Stop loss**

Your stop loss price. Use the quick-set buttons to place the stop at a fixed percentage below (long) or above (short) the entry price:

| Button | Stop distance |
| ------ | ------------- |
| -1%    | 1% from entry |
| -2%    | 2% from entry |
| -3%    | 3% from entry |
| -5%    | 5% from entry |

You can also type an exact price directly into the stop loss field.

**Take profit**

Switch between R:R mode and Manual mode using the toggle above the field.

* **R:R mode** — a slider from 1:1 to 1:10 automatically calculates the take profit price that achieves the selected risk:reward ratio. Quick buttons let you jump to 1:1, 1:2, 1:3, 1:5, and 1:10.
* **Manual mode** — type an exact take profit price.

**Leverage**

A slider from 1x to the market maximum. The selected leverage affects the required margin and the estimated liquidation price. A warning banner appears when leverage exceeds 70% of the market maximum.

## Calculator outputs

Results appear in the panel to the right of the calculator once entry price and stop loss are filled in.

**Risk:Reward and Expected Value card**

Shows the R:R ratio as a visual bar (red for risk, green for reward) alongside the Expected Value in dollars. EV is computed as `(win rate × reward) − (loss rate × risk)`. You can adjust the assumed win rate using a percentage input field; the EV updates immediately.

**Position size**

| Output          | Description                                                                        |
| --------------- | ---------------------------------------------------------------------------------- |
| Contracts       | The exact number of contracts to trade so a stop-loss hit equals your risk amount. |
| Position value  | Contract count × entry price, in USD.                                              |
| Required margin | Collateral the exchange locks: position value ÷ leverage.                          |
| Margin usage    | Required margin as a percentage of account equity. Flags red above 50%.            |
| Leverage        | The leverage setting currently applied.                                            |

**Risk / Reward levels**

| Output            | Description                                                                   |
| ----------------- | ----------------------------------------------------------------------------- |
| Max risk          | Dollar amount lost if the stop is hit (= account size × risk %).              |
| Stop loss         | The stop loss price you entered.                                              |
| SL distance       | Stop loss distance as a percentage of entry price.                            |
| Liquidation price | Estimated price at which margin is exhausted: entry ± (entry ÷ leverage).     |
| Break-even price  | Price needed to cover entry and exit fees before realizing any profit.        |
| TP @ 1:R          | Take profit price at your chosen R:R ratio.                                   |
| TP @ 1:2          | Take profit price at a 1:2 ratio (shown when your selected ratio is below 2). |
| TP @ 1:3          | Take profit price at a 1:3 ratio (shown when your selected ratio is below 3). |

**Price level diagram**

A visual bar maps all four key prices — liquidation, stop loss, entry, and take profit — on a single axis so you can see their relative spacing at a glance. The danger zone (entry to stop) is shaded red; the profit zone (entry to take profit) is shaded green.

**Funding cost**

| Output        | Description                                                                            |
| ------------- | -------------------------------------------------------------------------------------- |
| Daily cost    | Estimated funding fee paid per day (3 funding periods × 8-hour rate × position value). |
| Weekly cost   | Daily cost × 7.                                                                        |
| Weekly / risk | Weekly funding as a percentage of your risk amount. Flags red if it exceeds 20%.       |

The funding rate used is the live rate for the selected market, sourced directly from the Pacifica API.

## Executing from the calculator

Once the calculator shows valid results, you can open a real position on Pacifica DEX without leaving the Risk Manager.

<Steps>
  <Step title="Select a market">
    Choose a perpetual from the market list on the left. The entry price field fills automatically with the current mark price.
  </Step>

  <Step title="Set your parameters">
    Adjust account size, risk %, stop loss, take profit, and leverage until the results match your trading plan.
  </Step>

  <Step title="Review results">
    Confirm the position size, required margin, liquidation distance, and funding cost in the results panel. Check that the R:R ratio and Expected Value meet your criteria.
  </Step>

  <Step title="Place the trade">
    Click **Place LONG** or **Place SHORT** in the results panel. The order is submitted to Pacifica DEX via your connected wallet using the exact contract size and leverage from the calculator.
  </Step>
</Steps>

## Portfolio risk tab

The Portfolio tab is available when your wallet is connected and shows a live aggregate view of all your open positions.

**Summary cards**

| Card           | Description                                                                                                     |
| -------------- | --------------------------------------------------------------------------------------------------------------- |
| Portfolio risk | Total margin used as a percentage of account equity, color-coded: green below 10%, amber 10–25%, red above 25%. |
| Unrealized PnL | Combined mark-to-market PnL across all open positions, including total funding paid.                            |
| Net exposure   | Difference between total long notional and total short notional in USD.                                         |
| Positions      | Count of open positions with a long/short breakdown.                                                            |

**Risk exposure bar**

A gradient bar (green to red) with a marker showing your current portfolio risk percentage. Reference lines mark the safe (\< 10%), moderate (10–25%), and high (> 25%) thresholds.

**Position heat map**

Each open position is rendered as a bubble. Bubble size is proportional to the position's USD value; bubble color reflects unrealized PnL (green for profit, red for loss, with intensity scaling with magnitude). Click any bubble to open a detail modal that shows mark price, entry price, liquidation price, distance to liquidation, leverage, and funding paid for that position.

**Long / short breakdown**

A split bar showing the proportion of total notional value in long positions versus short positions, with the dollar amounts for each side and the net directional exposure below.

**Correlation warnings**

The portfolio tab detects when you hold two or more positions in correlated asset groups (BTC, ETH, altcoins, meme coins, and others). A warning banner appears for each group with same-direction positions, highlighting the concentration risk of effectively running a larger single-asset bet.

<Note>
  The calculator, price level diagram, and all output metrics are fully available without a wallet. Live position data in the Portfolio tab, the account equity auto-fill, and trade execution all require a connected Solana wallet.
</Note>
