Automated Position Hedger Protocol (APH)

As previously stated, FWX DDEX acts as a dealer within the decentralized derivatives platform and assumes all positions held by its users. However, in order to avoid potential losses, it is essential to implement appropriate risk management measures. Without such measures, FWX DDEX could experience significant losses if all users hold long positions and the price of the underlying asset rises. As a financial platform, FWX strives to maintain neutrality with regard to speculation.

To minimize the risk associated with futures contracts, FWX DDEX utilizes the underlying tokens held in the FWX Lending and Borrowing pools to replicate the futures' payout. For long positions, the platform uses stable tokens to hedge by exchanging them for the underlying tokens. Conversely, for short positions, FWX DDEX borrows the underlying tokens and trades them for stable tokens.

Example of how APH works

To provide an illustrative example, let us suppose that a user takes both a long and short position of 1 BNB with no leverage, assuming that the BNB price at the time of the order is 300 USDT. The user only needs to execute a few clicks on the platform and wait for any changes in the BNB price. If the BNB price moves in the same direction as the user's speculation, a profit will be earned, but if the BNB price goes against the user's view, a loss will be incurred. Prior to trading, the user is required to provide stable tokens as a margin.

Behind the scenes, the platform acts as a counterparty and utilizes the APH protocol to hedge against the risk of the user's view being correct. This means that in the event that the user experiences a loss, the platform is able to mitigate the risk. In this example, we will examine two scenarios where the BNB price increases to 350 USDT and decreases to 250 USDT.

Let's consider an example to better understand the process. Suppose a user takes a long and short position of 1 BNB with no leverage, based on the assumption that the BNB price at the time of the order is 300 USDT. To start trading, the user needs to perform a few clicks on the platform and wait for any changes in the BNB price. If the BNB price moves in the same direction as the user's speculation, a profit will be

Example of a hedging strategy for a long position

Full description of the APH procedure above

A user takes a long position in 1 BNB at 300 USDT with leverage 1. With the process in Table 1, the user needs to have 300 USDT as collateral, and the protocol

  1. does not borrow any USDT from the FWX lending and borrowing pools.

  2. swaps 300 (collateral) + 0 (loan) = 300 USDT for 1 BNB in a decentralized exchange (DEX).

  3. holds 1 BNB until the user closes the position.

If the BNB price increases to 350 USDT, the protocol

  1. swaps 1 BNB back to 350 USDT (the current price of BNB is 350 USDT).

  2. pays 50 USDT to the user as he or she has taken the long position of 1 BNB at the price of 300 and the price increased to 350. The user has 50 USDT in profit.

  3. returns 300 USDT (collateral) back to the user, and 0 USDT (loan) back to the pool.

If the BNB price decreases to 250 USDT, the protocol

  1. swaps 1 BNB back to 250 USDT.

  2. receives 50 USDT from the user. The user experiences a loss of 50 USDT as he or she has taken the long position of 1 BNB at the price of 300.

  3. returns 250 USDT (remaining collateral) back to the user, and 0 USDT (loan) back to the pool.

Example of a hedging strategy for a short position

Full description of the APH procedure above

A user takes a short position in 1 BNB at 300 USDT with leverage 1. With the process in Table 2, the user needs to have 300 USDT as collateral, and the protocol

  1. borrows 1 BNB from the FWX lending and borrowing pools.

  2. swaps 1 BNB (loan) for 300 USDT in a DEX.

  3. holds 300 USDT until the user closes the position.

If the BNB price increases to 350, the protocol

  1. receives 50 USDT from the user. The platform now has 350 USDT (300 USDT from the initial position taking swapped and 50 from the user’s loss)

  2. swaps 350 USDT back to 1 BNB in a DEX.

  3. returns 250 USDT (remaining collateral) back to the user, and 1 BNB (loan) back to the pool.

If the BNB price decreases to 250, the protocol

  1. pays 50 USDT to the user. The platform now has 250 USDT remaining.

  2. swaps 250 USDT back to 1 BNB in a DEX.

  3. returns 300 USDT (collateral) back to the user, and 1 BNB (loan) back to the pool.

Last updated