osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

Charge Interest #9

Closed ethanfrey closed 2 years ago

ethanfrey commented 2 years ago

We need to define a charge_interest method which is invoked by many other methods before performing other actions. Basically, it may return a Vec<CosmosMsg>, which we need to prepend on other actions. There may well be some issues of message ordering that come up (I assume this to be non-trivial), but I will define the basic behaviour:

More technically,

Please bring up any questions... The actual deposit/withdraw etc are defined in base assets and will be adjusted by the new multiplier automatically if they are returned after the other messages from charge_interest

uint commented 2 years ago

So this method would produce zero or two CosmosMsgs? One to trigger BToken increase, one to trigger LToken increase? Or was there something else you had in mind with the Vec<CosmosMsg>?

ethanfrey commented 2 years ago

So this method would produce zero or two CosmosMsgs? One to trigger BToken increase, one to trigger LToken increase? Or was there something else you had in mind with the Vec<CosmosMsg>?

That is a correct understanding. I had nothing else in mind

ethanfrey commented 2 years ago

This requires #31 which is not yet merged. The logic is implemented but not yet tested.

Please either wait for that to merge, or base on top of that branch.

ueco-jb commented 2 years ago

I'm aware, I've created branch on top of his.