# Mechanisms

PEN core features are supported by three unique mechanisms:

* [Universal Liquidity](#universal-liquidity)
* [Multi-Asset Pool](#multi-asset-pool)
* [Dark Oracle](#dark-oracle)

<figure><img src="https://3430877445-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXGBCRSAeAqH2s8cUUKJK%2Fuploads%2FrYcTrnmQD2LKHpoABWdR%2Fimage.png?alt=media&#x26;token=8aa0942e-3cd9-4ed9-8704-56c1b921d3fb" alt=""><figcaption></figcaption></figure>

## Universal Liquidity

Liquidity pools on trading protocols are usually fragmented from chain to chain, leading to inconsistent liquidity depths. PEN unifies liquidity across networks by using a broker module, which is a bot that monitors total liquidity and the liquidity reserved for margin trading. After a trader places an order, the broker will calculate the available liquidity across deployed networks and fill the order if it can meet position size. The universal liquidity mechanism offers higher capital efficiency on all deployed networks without moving pooled assets around.

Let’s assume the pools on Avalanche, USDT and Fantom each hold 10 USDT, and 5 USDT are currently reserved for active positions. As the broker observes all deployed networks, it will determine the total universal liquidity as 40 USDT, and the available liquidity as 35 USDT. If a trader places a 20 USDT long order on Binance, the following process will take place:

1. After the order is submitted on the chain, the broker proceeds to deal with it.
2. The broker will check if the universal liquidity meets the order size requirements.
   * Total universal liquidity is 40 USDT (10 + 10 + 10 + 10), and the available universal liquidity is 35 USDT (40 - 5)
   * 35 USDT is greater than the order’s required 20 USDT and as such the broker will proceed to fill the order
3. The broker will fill the order with the USDT price obtained from the [dark oracle](#dark-oracle). Consequently, the trader will hold a 20 USDT long position.

After opening this long position, the 20 USDT will be reserved until the position is closed. On the LP side, after LPs supply USDT on Avalanche, USDT or Fantom, trading activities on Binance can utilize these USDT without actually moving them.

In the rare cases when the pooled liquidity on a chain can’t fully cover traders’ profits, the traders will receive PEN Tokens as profits. After receiving PEN Tokens, users can redeem them into related tokens on other chains. For example, if the pool on Arbitrum only holds 10 USDT while a trader tries to withdraw 20 USDT profits from a related position on this chain, the trader will receive 10 USDT and 10 PEN. Meanwhile, the pool on Avalanche has 50 USDT, so the trader can bridge the 10 PEN to Avalanche, then redeem them into 10 USDT.

PEN protocol deploys the broker on the Multiplexing Layer to enable universal liquidity.

Liquidity-related metrics can be seen on the PEN Statistics page.

## Multi-Asset Pool

The PENLP pool, which is the counterparty of traders, is always fully collateralized with a portfolio of blue-chip assets and stablecoins. When traders open leveraged positions, the pool will reserve required assets until the position is closed; meanwhile, the pool will hold positions against traders in the opposite direction. If a trader's position is in profit, upon closure, the trader can withdraw the collateral and profits from the reserved assets. If the trader's position is at a loss, upon closure, traders will pay for the losses with the collateral.

For risk management, long and short positions under each market will have open interest caps. The caps won't exceed pooled liquidity capacity, so the pool is always capable of paying for the trader's profits; therefore, the traders don't have counterparty risks.

When traders open short positions, the PENLP pool will reserve stablecoins for traders. In this case, the pool is exposed to USD-denominated losses. However, since there are open interest caps under each market, the pool will always manage the capacity at a level where all trader's profits can be fully covered. Also, the market is usually skewed; the total open interest of longs is greater than shorts in most circumstances, so the PENLP pool mostly holds net short positions, which are less than the assets in the pool.

## Dark Oracle

PEN uses a dark oracle that aggregates price feeds from multiple exchange sources, including Binance, to ensure pricing accuracy and stability. A dark oracle is a private price oracle which does not publicly display the prices of assets in the pool, and the primary purpose is to prevent front-running. In addition, the dark oracle eliminates nearly all room for toxic arbitrage, further enabling zero price impact trading. When traders place orders, the PEN broker module will obtain prices from the dark oracle and fill the orders with zero price impact.

PEN protocol deploys the dark oracle on the Multiplexing Layer.
