✅ [RFC] Disable automated collection of fees for Mainnet Save redemptions

Summary

Reduce gas costs of Mainnet Save (imUSD and imBTC) redemptions by disabling the automated collection of swap and redeem fees.

Abstract

Around 100k in gas can be avoided from Save redemptions. With a gas price of 100 Gwei, that’s over 30 USD in Ether at today’s Ether prices.

This was implemented when gas costs and Ether prices were a lot lower. There was also a smaller amount of mUSD in Save which meant the missed fees could be significant.

Motivation

The following Save (SavingsContract) redeem functions are currently configured to automatically collect swap and redeem fees from mUSD:

  • redeem
  • redeemCredits
  • redeemUnderlying
  • redeemAndUnwrap (new function coming with the Save Unwrapper)

If Save’s automateInterestCollection is true, SavingsMaanger.collectAndDistributeInterest is called at the start of the redeem functions. SavingsMaanger.collectAndDistributeInterest collects swap and redeem fees from mUSD and transfers 90% of it to Save (SavingsContract). The 10% left is the governance fee.

The collection of the swap and redeem fees is done daily as part of the SavingsManager.collectAndStreamInterest process. eg Ethereum Transaction Hash (Txhash) Details | Etherscan

SavingsMaanger.collectAndDistributeInterest is also called on all Save deposits. There is no config to automatically turn this off.

If automated collection on redeems is disabled, the longest time fees will have not been collected should only be 1 day. But this is likely to be shorter as there are Save deposits during the day.

The amount of daily swap and redeem fees varies as it depends on the swap and redeem volumes. There are only a few days over the last 18 months where over 15k USD was collected. The average for this 2020 year is around 2k in fees daily Dune Analytics. With 44m currently in Save, an extra 2k makes little difference on the imUSD to mUSD exchange rate. The impact is even less if the redeemer does not a Save whale.

Looking at some recent examples, less than 10 mUSD of fees was collected for a gas cost over 30 mUSD. eg this redemption cost 116,124 in gas to only collect 3 mUSD in fees for the Save product Ethereum Transaction Hash (Txhash) Details | Etherscan.

BTC Save (imBTC) on Mainnet can also be configured to not automatically collect swap and redeem fees from mBTC on Save redemptions.

Give gas is still cheap on Polygon, the automated collection of swap and redeem fees of Polygon Save (imUSD) can remain.

Pros

  • Significantly reduce the gas costs Save redeems.
  • Reduced gas costs makes the Save product more attractive for 3rd parties to integrate with.

Cons

  • A redeeming Save whale will miss some of the daily swap and redeem fees.
2 Likes

Great RFC Nick, and happy to see further optimizations on gas are possible on our contracts! :sunglasses:

Definitely in favour of this happening, as the downside is marginal, and the upside benefits most users in perpetuity.

It’s also a very slight “incentive” for whales to remain in our product, so why not? :smiley:

Keen to see this happen!

1 Like

A Save Whale could also execute SavingsMaanger.collectAndDistributeInterest themselves before they redeem from Save if they wanted to get the latest swap and redeem fees.

1 Like

Seems reasonable to me.

Looked up the contract and it’s just using this function? Seems easy enough to do.

function automateInterestCollectionFlag(bool _enabled) external onlyGovernor

I think that makes a lot of sense, given the current gas prices and the ease of implementation.

Can it be called depending on the user’s balance?

Could be, but then you add more complexity. How do you set it? You would need new variables and setters for that. How do you determine the amount?

I think it’s really most effective just to continue as proposed.

100%, I was just wondering :smiley:

It possible to collect trading fees if a users balance is large but it’d require deploying a new contract and upgrading the proxy. If this was to be done, I’d say the redeem amount would be better as any balance remaining will get the interest next collection. The problem then becomes what’s the trigger point for collecting the interest? Amount over 1m are about the break even point assuming no other deposits were done and the redeem is just under 24 hours since the last interest collection. For amounts over 10m, the missed trading fees starts be be hundreds of dollars but we only have three accounts in Save > 10m.

I’d say we just remove the automated collection with a governance tx for now.

1 Like

I think we could move this to an MCCP. Not much opposition here.

I agree with this take, as enough feedback has been gathered. Will mark this as resolved, and await the MCCP :innocent: