# Looking for input on collateral/incentives for Anchor integrated Defi app - Advias Protocol

**URL:** https://forum.anchorprotocol.com/t/looking-for-input-on-collateral-incentives-for-anchor-integrated-defi-app-advias-protocol/3272
**Category:** Community Initiatives
**Created:** [March 10, 2022, 9:14am UTC](https://forum.anchorprotocol.com/t/looking-for-input-on-collateral-incentives-for-anchor-integrated-defi-app-advias-protocol/3272 "2022-03-10T09:14:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jordanadvias](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.anchorprotocol.com/jordanadvias/32/443_2.png) [@jordanadvias](https://forum.anchorprotocol.com/u/jordanadvias)
#### Post date: [March 10, 2022, 9:14am UTC](https://forum.anchorprotocol.com/t/looking-for-input-on-collateral-incentives-for-anchor-integrated-defi-app-advias-protocol/3272/1 "2022-03-10T09:14:06Z")

</div>

For anyone unfamiliar with what I’m building, check our post about it here: [Introduction to Anchor Integration Protocol - Advias](http://forum.anchorprotocol.com/t/introduction-to-anchor-integration-protocol-advias/2075)

We have an issue…

There is one exploitative issue we are working on and that is the ability to infinitely loop your assets from collateral to debt → swap to collateral asset → collateral to debt, repeat.

Currently, we have the following measurements in place:

- **Max CTD**

- **Repay debt 100%** or failed transaction

**There are still issues…**

The issue now resides in accounts (this can be a user or a defi protocol) using multiple wallets to bypass the max CTD by doing the following:

The following will assume UST as collateral with USDC as debt at a 90% LTV ratio.

**Here’s what this looks like:**

 ![r](https://us1.discourse-cdn.com/flex016/uploads/anchor/original/1X/cc838d487eb7af691198c9fc3ab472f2e42142c2.jpeg)

As you see, the borrowing account simply takes the collateral earned from the lowest of the loop positions to repay the next highest position. Essentially allowing anyone to turn a dollar into a trillion.

Starting at wallet C, the lowest debt position by value, they repay the debt, release the collateral, and use that released collateral to repay the next highest position, and repeat.

**What they did was:**

- Create a risk free debt position to create a 37.1% APY income strategy.

- As you see, there is zero risk for the user as long as they can pay back the lowest debt position, remove collateral, and repay the next.

- You can even continue the loop one more time to achieve a 55% APY, so on and so forth!

_ **comabatting this took a bit of creativity and we have a few ways to stop this but here’s our best; we think…** _

**Here is one way we are combatting this:**

- **Locking appreciation yield** as `value - (scaled_balance/initial_exchange_rate)`. In short, the `lock_total = value - yield`. The rest, the yield, is then locked in a savings account that receives interest for 3 months (while receiving yield).

**Why 3 months lock?**

- Because the max CTD (`max_ctd = collateral value/debt value`) is aimed to force borrowers to repay their loans per 3 month periods, therefor the yield can only be used to repay the loan on their next borrowing position. Making time the enemy.

**For example, a max CTD** of 1.1382 with collateral appreciating at 20% and debt at 10% would force a borrowing account to repay in about 3 months or face liquidation risk.

**Let’s take a look at the same info graph above but with the lock:**

Here’s a look at what this does:

 ![r2d3](https://us1.discourse-cdn.com/flex016/uploads/anchor/original/1X/b049e3b70ca72b6f770a7b32ed26b50684bd2d61.jpeg)

**What locking did was:**

- Make it so the borrower could not use their collateral as the way to repay the debt on the next position.

- **Now, the user must account for all positions total value** , for example:

Locked away is 54,000 UST in a yielding savings account locked for 3 months. This happens by on the repay, we lock `value - (scaled_balance/initial_index)` (`scaled_balance/initial_index` is the math behind getting a users principal)

Of course, the risk here is that if they cannot repay the first debt down, everything gets liquidated.

Now, the question I have now is, what do you think of this strategy and do you have any ideas?
