TP/SL Configuration

Collateral Base & Contract Qty Base

In Chromatic Protocol, there are two ways to predefine TP/SL when opening Long/Short positions.

Contract Qty Base

The contract qty base is an approach that uses the contract quantity (number of settlement tokens) as the primary unit. Takers first determines the contract quantity and then sets take-profit/stop-loss, leverage to set up the position. This process calculates the required collateral (taker margin) and maker margin (the amount utilized from LP) to open the position.

Let's consider a scenario where a long position is opened in a market called A with an index price of $100, using 500 USDC. Takers can set the contract quantity, take-profit/stop-loss, and leverage according to their preference.

  • Contract Qty : 500 USDC

  • Take Profit : 10%

  • Stop Loss : 20%

  • Leverage : 5x

The collateral, which is the taker margin, is calculated as contract qty * stop-loss. Therefore, to open the position, the taker needs to provide a collateral of 100 USDC.

The maker margin is calculated as contract quantity * take profit. Therefore, 50 USDC of the maker's provided liquidity is utilized while the position is open.

The taker only pays trading fees for the utilized 50 USDC, resulting in reduced fees. If the index price rises to 110 USD, the long position with a 10% take-profit is executed by the keeper, confirming a profit of 50 USDC (10% of the contract quantity or 50% of the collateral), and the position is closed. Also If the index price goes down to 80 USD, the long position with a 20% stop-loss is executed by the keeper, confirming a loss of 100 USDC (20% of the contract quantity), and the position is closed.

Collateral Base

A collateral base is an approach that uses the collateral amount as the primary unit. Takers first determine the collateral amount and then set the leverage, and take-profit. Based on these inputs, the contract qty (taker margin) and maker margin (the amount utilized from liquidity) is calculated to open the position. In collateral base, leverage and stop-loss have an inverse relationship and are interconnected.

Let's consider a scenario where a long position is opened in a market called A with an index price of $100. Takers can set the collateral, leverage, and take-profit according to their preference.

  • Collateral: 100 USDC

  • Leverage: 5x

  • Take Profit: 10%

  • Stop Loss: 20% (automatically calculated as collateral * leverage)

The taker margin (collateral) is 100 USDC. With the leverage of 5x, the contract qty is calculated as 500 USDC, and the stop-loss is automatically set to 20%. The maker margin is calculated as collateral * leverage * take profit, and the contract qty is equal to collateral * leverage (500 USDC). While the position is open, the bin has 50 USDC (10% of the contract qty) utilized. Like the scenario above, the taker only pays trading fees for the utilized 50 USDC, resulting in reduced fees.

If the index price rises to 110 USD, the long position with a 10% take-profit is executed by the keeper, confirming a profit of 50 USDC (10% of collateral * leverage or 50% of collateral), and the position is closed. Also If the index price goes down to 80 USD, the long position with a 20% stop-loss is executed by the keeper, confirming a loss of 100 USDC (20% of the contract quantity), and the position is closed.

The figures below summarize the configurable fields for takers to set, and the resulting values for both contract qty base and collateral base approaches (bold indicates configurable fields).

Last updated