Implement a STBL2 router for the DEX and reduce swap fees

Summary

The Algofi Core Developer team will implement a (simple) STBL2 router for the DEX and will reduce the swap fees for STBL2-ASSET lending pools to 0.125% down from 0.25%. If someone wants to perform a swap on the Algofi DEX of ASSET1->ASSET2 the router will check if there are STBL2-ASSET1 and STBL2-ASSET2 pools and if it would be better to swap ASSET1->STBL2->ASSET2 considering prices, price impact and swap fees.

Temperature Check: STBL2-.... pairs as the central liquidity pairs of the protocol

To learn about lending pools, see a write up here .

To learn about STBL2, see a write up here .

Proposal

Implement a STBL2 router for the DEX and reduce the swap fees to 0.125% for STBL2 lending pools.

Motivation

The motivation is to add STBL2 utility and use it as the central liquidity asset for the Algofi DEX. This is supposed to help with concentrating liquidity by not having multiple pools with low liquidity for an ASSET instead of one ASSET-STBL2 pool which would directly enable swaps to ALGO, USDC, goETH, goBTC and BANK (for now). Only STBL2 lending pools are part of this since the reduction of swap fees is an important part of that proposal. Since lending pools earn lending APR of the assets in the liquidity pool the reduction of swap fees wouldn’t effect the attractiveness to add liquidity to those pools as much.

Instead of proposing a full DEX router like the one pact introduced recently in BETA (you can read more on that here) i think a simple STBL2 focussed DEX router would be time efficient usage of dev time and would further disincentivize multiple low liquidity pools. Additionally, splitting the order is not part of this proposal. Splitting the order into two swaps to be executed via ASSET1->ASSET2 and ASSET1->STBL2->ASSET2 to optimize the swap price would only encourage adding liquidity to the ASSET1-ASSET2 pool which again would not help with concentrating liquidity.

The swap fee reduction to 0.125% down from 0.25% would make the routing through STBL2 pools more attractive and is therefore an essential part of the proposal in my opinion to make the routing through STBL2 lending pools a viable option. If a swap gets routed through STBL2 then the max swap fees would still be 0.125%+0.125%=0.25% as they are right now anyways.

Further Discussion

The usage of STBL2 as the central liquidity asset for the Algofi DEX would make the DEX more unique and by this the DEX would not compete as much with the other DEXs for the same liquidity (ALGO-ASSET) which then gets splitted and leaves all those DEXs with low liquidity pools which essentially means people have to use DEX aggregators to make decent swaps.

A contra point could be that people do not like adding liquidity to ASSET-STBL2 instead of for example ASSET-ALGO pools because of the risk of possibly higher impermanent loss (you can read more about IL here) since the price correlation of assets could result in less IL. A very personal view on that is that in my opinion people are a bit too scared of impermanent loss since they always view that as “i am loosing money”. Impermanent loss just means you earned less then you could have if you held those assets just in your wallet. But at the same time adding liquidity to a pool means you are automatically follow the market without the need to do anything, you sell your asset when it rises and you buy it when it drops in value (when paired to STBL2). Furthermore, when the market does not move for some time like ALGO whose price hovers around 0.3$ for some time now you still can earn swap fees + farm rewards.

The inclusion of “splitting orders” should be discussed underneath this post. As I have said a full DEX router would not make sense in my opinion. Splitting orders would incentivize multiple pools but at the same time this would be an auto-arbitrage of the pools on Algofi. Additonally, when its possible to get a better swap for someone by splitting the order then the question is why not just do it. The devs should comment on the feasibility of that.

The swap fee reduction would as a by-product also incentivize the use of STBL2 in general since people would be able to swap STBL2 with lower fees. That could further incentivize people borrowing STBL2 instead of USDC in the lending market and therefore help with adoption of STBL2 in the ecosystem. The usage of the router could also mean that STBL2 pools are getting used more which could mean that the swap fee APR doesnt drop as much. Additionally, all those lending pools receive BANK emissions so they are not as much reliant on those swap fees and we should continue to support STBL2 lending pools primarily with BANK emissions.

Since there were a few temperature checks about adding ASAs to the lending market and the problems that were mentioned regarding that I wanted to mention that it would still be possible to add lending pools for those ASAs without the need to have a “working” lending market for those assets. This would mean ASAs could still benefit from the STBL2 router when they decide to propose opneing a ASSET-STBL2 lending pool. An example of this: STBL2-BANK is a lending pool and you still cant use BANK as collateral and you cant borrow it. But in the future this could change and without the need of moving liquidity over from a normal pool to a lending pool just the parameters of the respective lending market could be changed.

Implement a STBL2 router for the DEX and reduce the swap fees to 0.125% for STBL2 lending pools
  • Approve
  • Disapprove

0 voters

13 Likes

DragonFi proudly endorses this proposal.

@lobo is a tireless Algofi ambassador AND valued member of the prestigious Dragon Guard team. He conducts himself with integrity and professionalism at all times.

This is an important potential step for Algofi. It deserves everyone’s attention and consideration.

Drag-on

7 Likes

Overall I think this proposal is a really positive step. I will vote for it subject to a few changes to clarify/explicitly improve the user experience:

  • show the user the expected gain from using the router;
  • allow the user to easily toggle between using the router and swapping directly from ASSET1 to ASSET2.

When using aggregators and routers that create multiple taxable transactions I want to know ahead of time whether the benefits outweigh the cost of tracking/reporting on the additional taxable transactions and take the appropriate action. The above changes/clarifications would allow me to do that.

7 Likes

i fully support that! it is important to let the user decide if he wants to use that feature and showing the expected gain is a really nice addition

3 Likes

@lobo awesome proposal and this is one of the best things I think we could be doing with the platform.

A contra point could be that people do not like adding liquidity to ASSET-STBL2 instead of for example ASSET-ALGO pools because of the risk of possibly higher impermanent loss (you can read more about IL here) since the price correlation of assets could result in less IL.

I think part of why that is silly is because people saying it are only hedging against losing upside. Lets say someone was talking about goETH pairs. goETH <> Algo might be more correlated but the losses are also correlated. So if you were holding that pair over goETH <> STBL2 the last month, you lost more money because ETH and Algo lost . Personally I think the solution to this is ranged pairs. If people are so concerned about IL ranged pairs are a better feature to give them more control of that. Ranged pairs can be modeled like options which is probably easier for managing risk.

The swap fee reduction would as a by-product also incentivize the use of STBL2 in general since people would be able to swap STBL2 with lower fees. That could further incentivize people borrowing STBL2 instead of USDC in the lending market and therefore help with adoption of STBL2 in the ecosystem.

To add on to that, the incentive to provide liquidity to STBL2 LP pools is going to lead to less slippage on STBL2 routed trades. That will also incentivize borrowing STBL2 over USDC in the leveraging case.

Lastly, I’d like to propose the idea that BANK rewards would only go to STBL2 based pairs in the future. STBL(X) is the flagship product line and imo that should be the focus over everything else.

4 Likes

A very good proposal for Algofi overall and STBL2 in particular. I’ll vote for this proposal. Thanks.

4 Likes

want to bring this proposal online every soon (sorry it took so long) but i want to change one point which i want to post so if anyone doesnt like it can complain and we can discuss this issue:

i want to remove the part

as i think that

is a good idea and that point:

i think the concerns i had that it would encourage people providing liquidity to the ASSET1-ASSET2 pools can be ignored honestly

1 Like

Sounds great but I don’t believe @lobo’s proposal requires ‘smart-routing’ nor is it in conflict with your pursuit. Simply compare 2 routes: ASSET1-ASSET2 vs ASSET1-STBL2-ASSET2

Couldnt we just lower the base rate of all STBL2 lending pools in general? Router could be a UI side thing. These new fees will influence dex aggregators to funnel more volume towards Algofi DEX, increasing fees and incentivizing more LP. Also Deridex will be able to support higher volume towards these pools.

3 Likes

now since the lending pools are integrated into deflex one could definitely think about that. if enough users use deflex this could work

would definitely prefer it being on-chain. one could implement it ui wise until the team implemented it on-chain maybe?

I think there is something to be said about being conservative and doing it in the UI first. Make it so people can opt out as well. If the dev team tracks analytics on the UI, we can see if anyone is opting out of routing through . The code to compose a routed transaction should also go in the docs for any developers. It would also be interesting to see from onchain data if any of them use it. Then with all the data, it will be easy to decide if moving it to the contract layer makes sense.

2 Likes