# Repay loan with any token or multiple tokens

**URL:** <https://forum.euler.finance/t/repay-loan-with-any-token-or-multiple-tokens/843>\
**Category:** Protocol\
**Created:** [March 1, 2023, 12:32pm UTC](https://forum.euler.finance/t/repay-loan-with-any-token-or-multiple-tokens/843 "2023-03-01T12:32:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![romanm](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@romanm](https://forum.euler.finance/u/romanm)\
**Post date:** [March 1, 2023, 12:32pm UTC](https://forum.euler.finance/t/repay-loan-with-any-token-or-multiple-tokens/843/1 "2023-03-01T12:32:14Z")

</div>

**Title:** [RFC] [Repay loan with any token or multiple tokens]  
**Author(s):** [Wido ([https://www.joinwido.com/](https://www.joinwido.com/))]  
**Submission Date:** 2023-03-01T00:00:00Z

**Simple Summary**  
This proposal outlines a solution to improve the user experience of Euler Finance’s loan repayment process. The proposal suggests building smart contracts and updating the frontend app to enable loan repayment with any token or multiple tokens from the user’s wallet. The proposal includes three milestones: creating a detailed UI mock, launching a testnet version, and launching the final product.

**Motivation / Problem**  
Euler is already ahead of most DeFi protocols in terms of transaction experience. It provides transaction bundling that greatly improves the user experience. However, we believe that it can be even better.

Specifically, users cannot repay their loans with any token or multiple tokens in their wallet. As shown in the screenshot below, the user has `0.003888559288980439 wstETH` tokens as debt but only `0.003885292756693672 wstETH` tokens in their wallet. The user is missing `0.000003266532287 wstETH` to repay their debt, and the debt amount grows with every new block.

 ![euler 01](https://canada1.discourse-cdn.com/flex007/uploads/euler/original/1X/dc2cfee91e3d916379763282169398e167e59b1a.png)

- To repay this debt, the user must swap another token in their wallet for wstETH and then repay. This requires the user to leave Euler’s app and use 3rd party swap provider like Uniswap or 1inch.
- Given the amount of debt balance grows with new blocks, it’s challenging for the user to calculate how much `wstETH` they need to buy to ensure they get enough to repay their loan and are not left with some extra dust.

**Proposed Solution**  
The Wido team proposes to build smart contracts and update Euler’s web app frontend code to enable loan repayment with any token in the user’s wallet or multiple tokens in the user’s wallet. We also propose to let the user deposit any token from their wallet while selecting the “target” collateral inside Euler. The app would take care of swapping the token from the user for the desired collateral.

A detailed explanation of those features follows:

1. Repay the loan with any token — users can select any token from their wallet after clicking repay inside the Quick Actions modal.

 ![euler 2](https://canada1.discourse-cdn.com/flex007/uploads/euler/original/1X/235b9031e616ec623d03c50e891321ab3accc326.png)

1. Repay loan with multiple tokens — users can select multiple tokens from their wallet after clicking repay inside the Quick Actions modal. This is an extension of the previous feature

 ![euler 3](https://canada1.discourse-cdn.com/flex007/uploads/euler/original/1X/4f9f646434325e8f399bc974780f9e766441fb89.png)

We believe those features will improve the UX of using the Euler app increase the conversion of Loan Repayments, contributing to the overall improvement of the Euler platform.

**Proposed Milestones**

We propose splitting the work into three Milestones, each with a budget and clearly defined deliverables. We will complete them serially, beginning with Milestone 1, then Milestone 2, and finally Milestone 3.

We propose upfront funding for each milestone, based on the budgets assigned.

**Milestone 1: Actionable plan, product architecture and UI mock**

- Document the solution’s architecture and a rough outline of the smart contract and frontend updates.
- Create a detailed UI mock showing the proposed updates to the Euler’s app
- Share the above documents with Euler’s core dev team for feedback
- Budget requested: $1,000

**Milestone 2: Testnet launch with a mechanism for soliciting feedback from the Euler community**

- Build the smart contracts and the frontend code that would enable the Proposed Solution explained above
- Deploy the contracts to Goerli network (Ethereum Testnet)
- Launch the features inside the Euler’s Web App
- Write documentation for the smart contracts and the UI
- Build a feedback collection mechanism to learn about users’ experience within the Euler’s App
- Announce the new feature to the Euler’s community (help from the Euler’s marketing team will be highly appreciated)
- Budget requested: $10,000

**Milestone 3: Mainnet or production launch incorporating community feedback**

- Collect all feedback submitted from the Euler’s community
- Prioritise feedback from the community and decide what gets incorporated as part of this work and what doesn’t (help with prioritisation from the Euler team would be highly appreciated)
- Announce the product is Live (help from Euler’s marketing team will be highly appreciated)
- Budget requested: $5,000

**About Wido**  
Wido is building tools to improve the user experience (UX) of DeFi protocols and wallets. We focus on bundling multiple transactions into one, to provide a one-click experience. Our Router smart contract enables deposits with any token into any smart contract across EVM chains. It has been [audited by CertiK and PeckShield](https://github.com/widolabs/wido-contracts/tree/main/audits), and is used by [Pickle.Finance](https://twitter.com/picklefinance/status/1616283440260993024?s=20). [Yearn.Finance](http://yearn.finance/) ([PR](https://github.com/yearn/yearn.fi/pull/80)), [Harvest.Finance](http://harvest.finance/) and other DeFi protocols are currently integrating it into their dApps. We’re also building [single-transaction collateral swaps for Compound](https://new.questbook.app/dashboard/?grantId=0xeb047900b28a9f90f3c0e65768b23e7542a65163&chainId=10&role=community&proposalId=0x1c9&isRenderingProposalBody=true).

Wido is founded and led by [Roman](https://www.linkedin.com/in/mazurroman/) (formerly Argent) and [Kunal](https://www.linkedin.com/in/kunaljain30/) (formerly Google/Facebook).

**Summary**

The Wido team’s proposed solution will significantly improve the user experience for Euler users by enabling them to repay loans with any token or multiple tokens. This solution will keep users on Euler’s website, reducing the need to leave the platform to swap tokens. The three milestones outlined above will ensure steady progress and successful solution implementation.

---

<div class="post-metadata">

**Author:** ![iamzim](https://avatars.discourse-cdn.com/v4/letter/i/d6d6ee/32.png) [@iamzim](https://forum.euler.finance/u/iamzim)\
**Post date:** [March 1, 2023, 1:11pm UTC](https://forum.euler.finance/t/repay-loan-with-any-token-or-multiple-tokens/843/2 "2023-03-01T13:11:16Z")

</div>

This is interesting, although Euler already allows repaying with any token. It’s supported in UI in the repay form by selecting ‘Euler Deposits’ in the ‘From’ dropdown. Users can select any token deposited in their account which will be swapped on 1inch or uniswap and used to repay. If the token is in their wallet, they can add a deposit operation first in the tx builder. The repay form also allows selecting to swap exactly the amount that’s needed to repay full debt.

Would this proposal add extra benefits on top of what’s already available in Euler?

---

<div class="post-metadata">

**Author:** ![romanm](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@romanm](https://forum.euler.finance/u/romanm)\
**Post date:** [March 7, 2023, 9:30pm UTC](https://forum.euler.finance/t/repay-loan-with-any-token-or-multiple-tokens/843/3 "2023-03-07T21:30:19Z")

</div>

Hey, @iamzim thank you for your reply and the context.

It is great that it’s already possible to swap exactly what’s needed to repay full debt using tokens inside the “Euler Deposits”. Similarly for repaying with any token from “Euler Deposits”.

The extra benefits, summarised, would be:

- Enable users to repay their loans with any token **directly from their wallet, in one click**. No need to have the token inside Euler Deposits, or bundle extra transaction using tx builder
- Ability to repay a loan with multiple tokens
  - Note: we could allow this feature to work with tokens in users’ wallets as well as tokens in users’ “Euler Deposits” if there is interest.

Generally, the proposal is about letting users do actions directly from their own wallets, in a single click, instead of using “Euler Deposits”. It would be great to hear your thoughts and interest in this approach.

On a separate note, I have noticed that it is currently impossible to deposit any tokens directly into the “Euler Deposits.” For example, I cannot deposit my ETH directly into “Euler Deposits” without first wrapping it. Similarly, for other tokens, I need to swap them for supported tokens before being able to deposit them. We are keen to expand this proposal to allow users to deposit any token into “Euler Deposits” with just one click, without requiring any additional steps.

---

<div class="post-metadata">

**Author:** ![iamzim](https://avatars.discourse-cdn.com/v4/letter/i/d6d6ee/32.png) [@iamzim](https://forum.euler.finance/u/iamzim)\
**Post date:** [March 10, 2023, 8:13am UTC](https://forum.euler.finance/t/repay-loan-with-any-token-or-multiple-tokens/843/4 "2023-03-10T08:13:03Z")

</div>

Hi @romanm, thanks for expanding.

Let me play a devil’s advocate for a sec. On your first point, one click repay from wallet can also be very easily implemented in FE as a single step proces. Tx builder already supports operations which are not atomic. Short for example is a mint and swap internally, but it’s a single form and a single item in the builder. I imagine however that having a dedicated contract could reduce gas costs slightly. On the other hand, as I understand the architecture, users would still need to approve the swapping contract for every token in their wallet, is this correct? Of course approval is also needed for depositing into Euler, but its a one time operation to interact with the platform.

On your second point, repaying with multiple tokens is also possible to implement as a single form in the UI, without any contract changes. In any case it would be a UX challange.

But I see your point about using ETH directly or tokens that don’t have activated markets in Euler, this is definitelly not possible currently.
