Automatic Loan pay down from Earn balance

pactim had a similar proposal back in 12/21, but had no feedback. I would like re-propose an option implemented in Anchor allowing UST to be automatically moved from the ‘Earn’ balance to pay off your loan balance. The UI would need to have two user inputs. First would be the “LTV %” at which UST would be transferred. The second would be the amount of UST to be used to payoff the loan balance.

For example: LTV %: 90% UST Payoff Amount: $5,000

Those options would trigger when the user’s LTV broke 90%, then $5,000 UST would be transferred from the ‘Earn’ tab to pay off down the loan balance.

I think this would encourage more users to have higher LTV which would increase the income for Anchor on the borrow side…not to mention allow me to sleep a little easier at night.

Wanted to get some feedback on this idea, stupid or not?


There’s no automation in crypto, everything happens because someone somewhere signs and sends a transaction into the blockchain. Liquidations happen because liquidators keep a lookout for loans at default, but why would they do this? Because there’s a reward to anyone that processes that liquidation.

This would require a similar solution but now you have a conflict of interests, why would anyone try and repay your loan (with your money) and simply not wait for you to be liquidated and take the reward? You’d need to pay these liquidators the same as, or more than, the liquidation process yields to make this work.

It’s not core to Anchor’s mission as there’s a clear split between Borrowers and Earners, and those that are both don’t provide as much benefit to the protocol as those that aren’t.


Interesting, I hadn’t though of the automation angle. I thought on the Ethereum side there were already automated payment service for bills. But I guess that is from a user supplied account balance that is off-chain. I was coming at it from the perspective of a degen approach with a safety margin. I tend to have a higher LTV than most and would like to have something in the way of liquidation in the case of a sudden price drop. Thank you for taking the time to reply


Anchor team has been asked to allow other wallets to repay a loan, out of that other protocols could take on this functionality, you deposit with them (albeit at a lower APY probably) and they would take on the role of repaying for you, as a service.

We’re so used to Web2 having so much automation that it’s easy to take it for granted, I’m sure services/protocol will arise to fill the need but we’re not there yet.

This is where flashloans would come in. I have been pushing for this and maybe it will be on the roadmap at some point. We need more people asking for flashloans for liquidation protections. The others ways that have been laid out require someone, most time the time Anchor, to control a user’s wallet to do this. This won’t work in a defi protocol like Anchor.

Flashloans will allow users to write a script that liqudates aUST or whatever other asset they want to slowly pay down the loan to maintain a healthy LTV ratio.

This would also put idle UST to work to generate some yield for the protocol.

I agree that flashloans is a must and a shame we let WhiteWhale get to it faster than us, it’s also a potentially dangerous feature so it’s best not to rush something out. I still believe the issue lies in the “user to write a script”, most users aren’t techie enough and that’s a good thing… if we build into the contract something to allow one wallet to pay down another wallet’s loan, other protocols could take on the automation for the end-user for a fee.

A thought on the automation angle. Outside of damaging users investing in the liquidation system, how would it be different when Anchor takes UST out of your provided Earn balance to pay down your loan, than when Anchor takes bLuna out of your provided collateral balance to pay down your loan?

It’s the same, anything that must happen without you doing anything requires automation.

There are some clever uses of user input as automation, like Nexus, anytime someone deposits or withdraws I believe they use that as an opportunity to check the vault TVL and adjust if needed, but it costs more to do that action for the end-user. Yearn finance on ethereum does the same I believe, that way while dependent on automation, it uses users input to make that automation work.

But there’s a risk, what if nobody interacts for days? Because of this you should still have an automation mechanism or incentivize someone else to do it for you.

1 Like

this was a very solid idea tossed around a few months ago: [Proposal] Anchor Guardians of the Galaxy and Protector of Collateral

i think the described contracts are straightforward to implement, but it is probably hard to get existing liquidators to switch over (would an increase incentive work? who knows).

ideally, as the thread’s author mentioned, the overseer contract itself would have logic to check the pay-down-loan contracts first.

From a quick glance it’s a protocol on it’s own, all those actions would require separate contracts, would need users to deposit the “guardians” so increasing risk for Anchor, that would never be a viable solution and a clear deviation from Anchor’s purpose. Could probably make a killer protocol though…

But yea, you’d need to incentivize people to execute the “saving” and pay them more (or target a different audience) than what they could get by letting liquidations happen, and that’s an hefty price to pay as liquidations can be quite profitable.

1 Like

very good points

you mind if i follow up in a dm?