# Smart Wallets

A Smart Wallet is a smart contract-based wallet that enables easier position management and various complex operations. It is essentially your DeFi Saver/ETH Saver account, as it keeps all your positions created using both apps.

{% hint style="info" %}
Your Smart Wallet is created by you, owned by you and it can be accessed and managed solely by you.
{% endhint %}

### Why do I need a Smart Wallet?

DeFi protocols support simple, straightforward operations inside a single transaction. For example, you can execute a simple ETH supply on Aave. However, in order to do a complex task such as leveraging ETH to borrow DAI and sell it for more ETH, you would have to execute at least 3 separate transactions.&#x20;

> What smart contract-based wallets enable you is to execute multiple things inside a single transaction (for the techies: they do this by providing an execution context using \`delegatecall\`). Thus, instead of 3 separate transactions, you would execute a single one.&#x20;

Once you have this flexibility, you are able to do all sorts of things such as:

* Easily creating leveraged positions.
* Shifting them effortlessly between protocols and assets.
* Creating completely custom-tailored recipes for your specific use case. <br>

Some of these operations would be significantly less safe to do over separate transactions. For example, executing a position Repay when you're near liquidation (withdraw some collateral, swap, and pay back some debt) would be risky, as it would temporarily decrease your liquidation ratio even further.&#x20;

Executing all the steps at once, atomically, is a safer and easier way to do it. Additionally, many of these operations wouldn't even be possible without a Smart Wallet.&#x20;

Anything that uses flash loans is a good example of this. A flash loan would allow you to repay a large chunk of a position even when you don't have enough unutilized collateral to use as liquidity.&#x20;

### Is a Smart Wallet safe to use?

In addition to more flexibility, these wallets represent an additional layer of safety by providing a layer of separation between your main wallet (often referenced as an *Externally Owned Account - EOA*) and the DeFi protocols you use. Token approvals are never given directly to the protocol, but instead proxied through the Smart Wallet.&#x20;

There are two types of Smart Wallets utilized on DeFi Saver:<br>

* Safe Smart Wallets - These are the default Smart Wallets on DeFi Saver, as they've become the industry-standard Smart Wallets with the best cross-app compatibility<br>
* DSProxy - The wallet itself is fairly minimal and has been battle-tested since 2018. In technical terms, it is MakerDAO's [DsProxy](https://github.com/dapphub/ds-proxy). \
  \
  In fact, if you ever used the Maker protocol in the past, you already have a Smart Wallet that will be used in DeFi Saver (and vice-versa).&#x20;

{% hint style="info" %}
*ETH Saver uses a separate registry for technical reasons (in order to support multiple positions per protocol, as well as advanced profit tracking), but the actual wallets are exactly the same.*
{% endhint %}

### Is the DSProxy Smart Wallet cross-compatible?

We decided to use Maker's DSProxy as a basis for DeFi Saver in the beginning as it was and is a thoroughly tested and well-audited piece of open-source code that's perfectly capable of doing everything we have imagined and created as of now.&#x20;

> Additionally, this being an open standard and registry, we hoped other protocols and interfaces would adopt it, seeing it as a key to DeFi's interoperability. \
> \
> However, the ecosystem diverged over time, with protocols implementing an EOA-only or a protocol-specific bundling approach, and different interfaces developing walled gardens using proprietary, closed-off, allowlist-based wallets.&#x20;

DeFi Saver's team remains committed to supporting an open ecosystem, using open and permissionless standards. We hope to see a unified approach adopted across DeFi in the future, and we are actively following and supporting efforts to do so, account abstraction being one of them.&#x20;

{% hint style="info" %}
*Additionally, as mentioned above, in order to support multiple Smart Wallets per EOA (multiple positions per protocol), as well as precise profit tracking, ETH Saver uses a separate registry from the original MakerDAO one.* \
\
*This means that your Smart Wallets don't carry over between DeFi Saver and ETH Saver.*&#x20;
{% endhint %}
