thank you for the feedback. I will do a separate thread when I reiterate over the the dApp. I have not much spare time atm, so this will likely be delayed for some time.
I can summarize the function here a bit:
The first view entering the dApp you can enter your crypto address where the liquids are stored or you can directly connect with Metamask (Use it at your own risk!).
After providing the address you will be automatically redirected to the balancer view. On the top you see some general controls.
The most important is the Balance button on the left. By clicking the algorithm will automatically calculate a balanced distribution of the activated liquids according to the overall debt pool. The inputs on the same line are setting some constrains on the balancing strategy:
max balance gain factor adjusts the width of the sliders below where you can in/decrease your balance to specific assets.
max position deviation adjusts the amount of deviation in lUSD from the desired balance when you wish to trade / adjust your balance. This will only suggest trading actions if the deviation is bigger than this value.
minimum lUSD left ensures that you will always have enough lUSD after trading to pay future trading fees. I don’t actually know if this works correctly because I never hit that edge.
The liquid views below shows the actual state of your portfolio and how it is currently balanced against the debt pool.
There is a slider in place where you can adjust your desired amount relatively to the debt pool. Below the slider there is a number which shows how it is currently balanced. In the example above the BNB amount relatively to the accounts liquids is 1.93x higher than it is in the overall debt pool. The Button below that value activates/deactivates the liquid for the balancing described in the first part. You can use this button to fix the current amount of that liquid by deactivating the liquid for balancing.
The view right to the slider shows the balancing information and allows the user to trade the asset according to the calculated Balance:
Here the balancer calculated, that the user should sell 2.092 lBNB to reach the desired balance. In case Metamask is connected you can click on that button and execute the transaction through the linear exchange spot contract. Ensure that Metamask shows the correct contract address like in the followoing:
The linear exchange address is: 0x2C33d6Fa54bB6Fa81B3a569D639Fe23ab36cca7f
You should also check the hex attributes in Metamask if everything is setup correctly for the transaction. especially you should look for your address in the transaction to ensure that it is the target address for the trade (third attribute):
Please only connect Metamask if you know what you are doing!
Otherwise you could also read the desired trade from the button and trade it directly on the linear exchange.
Hope this little tutorial helps. I will do a follow up if I had the time on overhaul the dApp. If there are questions you could reach out here, I will try to answer everything.