> For the complete documentation index, see [llms.txt](https://transmute-protocol.gitbook.io/transmute-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://transmute-protocol.gitbook.io/transmute-protocol/how-it-works.md).

# How It Works

<figure><img src="https://2301750472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUldY2vFO0pWPhUkdmhW9%2Fuploads%2FI397j1RDnRITlr0agi6P%2FFrame%205.png?alt=media&amp;token=9b916bb3-ae03-4998-8b76-c669433ce2d9" alt=""><figcaption><p>Contract mechanics</p></figcaption></figure>

Assume the notional value of oRETRO is $100. This gives the holder the perpetual right to buy RETRO at 30% of the market price using CASH i.e. 70% discount. Transmute protocol performs the following steps to help the user exercise their oRETRO into the desired output token without any upfront capital requirement.

1\. Contract performs a `flash` on the CASH/USDC pool on RETRO and withdraws the required amount of capital to exercise the option

2\. Redeems $100 worth of oRETRO using 30 CASH.

3\. $100 worth of RETRO is immediately sold for CASH or any other desired output token

4\. Flashloan is repaid pool plus 0.01% `flash` fee.

5\. Users wallet receives remaining CASH or output token as profit

### Optimal Path

Certain protocols like retro finance have a pool for their oTOKEN in the form of oRETRO/RETRO (100 BPS) which allow users to directly swap oRETRO for RETRO. The ideal price for an oTOKEN is

$$
oRETRO = RETRO \* (1-discount)
$$

Since the discount could vary after each epoch flip, the price of oRETRO in terms of RETRO is sometimes higher than its actual price thereby making swapping more profitable than exercising oRETRO using a flashloan at the current discount. Transmute always checks the price of oRETRO/RETRO to decide the optimal path, i.e. swapping or transmutation.
