# Hedging example with Morpho protocol

[Morpho](https://www.morpho.xyz) is a lending protocol that allows borrowers and lenders to optimize their rates on AAVE and Compound. In other words, when matched, borrowers and lenders can meet halfway between the borrow and lend rates on the base protocol and match at a de-facto mid-market rate. Therefore IPOR Interest Rate Swaps, will tend to be a close hedge when using Morpho to deposit or borrow money from either AAVE or Compound.\
\
For this example we will use a borrow on Morpho, and a Pay Fixed swap on IPOR. The effective result will be a borrow rate which is fixed (or stable). In the case that the rate rises on Morpho, and therefore the cost, the derivative will be profitable and the winnings from the derivative would be able to pay the extra cost of credit. In the case the rate falls, the debt cost would be less but the derivative would be losing. In the end by using this strategy a user would be able to maintain an approximation of a fixed rate borrow with minimal basis risk.&#x20;

In order to borrow stablecoins from AAVE or Compound via Morpho and hedge the interest rate with IPOR effectively fixing the rate, you would need to:&#x20;

### On Morpho

1. Go to Morpho's app and select the platform from which you want to borrow
   1. Morpho-compound <https://compound.morpho.xyz/?network=mainnet>
   2. Morpho-aave <https://aave.morpho.xyz/?network=mainnet>
2. Provide collateral (you will be able to borrow against it)

   1. select supported collateral&#x20;
   2. make a transfer via Morpho&#x20;

   <figure><img src="/files/YCQDqWZrtEiMlV51KMLI" alt=""><figcaption></figcaption></figure>
3. Head to "Borrow market" and borrow one of the supported IPOR stablecoins: USDT, USDC, or DAI. The amount you have borrowed should match "**notional**" amount on IPOR.&#x20;

<figure><img src="/files/Ldqngeb9YjmegRpuQf0Q" alt=""><figcaption></figcaption></figure>

### On IPOR

1. Head to IPOR swaps and select the same stable coin you have borrowed on Morpho
2. Click on "Open swap" for currency you have borrowed&#x20;
3. Choose Pay Fixed - Receive Floating (this type of swap is used to hedge borrow positions)
4. Set your preferred leverage&#x20;
5. Set **notional** to be the same as the amount you have borrowed&#x20;
6. Open swap. Remember that the Maturity of a swap is 28 days. Your hedge is good for this long. If you close your borrow position before the 28 days maturity of your swap, you can also close the swap on the IPOR Protocol.

<figure><img src="/files/AFfq8DgIQ4bhbNPUOQw1" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ipor.io/ipor-derivatives/automated-market-maker/ipor-swaps/hedging-example-with-morpho-protocol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
