Giter Site home page Giter Site logo

Comments (7)

Rubilmax avatar Rubilmax commented on July 29, 2024 2

What about passing nothing to the IRM, and letting it get what it needs ?

In my PoC, the state can only be loaded all at once from outside the contract and is already loaded to memory anyway, so this way is cheaper

from morpho-blue.

MathisGD avatar MathisGD commented on July 29, 2024 1

https://eips.ethereum.org/EIPS/eip-2330 could also help

from morpho-blue.

Rubilmax avatar Rubilmax commented on July 29, 2024 1

the state can only be loaded all at once from outside the contract

Yeah you just reminded me that I also expose extsload getters, so this sentence is wrong. I feel like it doesn't cost much considering the size of the state so it's not much of a matter to always pass it to the IRM

from morpho-blue.

Rubilmax avatar Rubilmax commented on July 29, 2024

Agreed, here's how I did it:

https://github.com/morpho-labs/blue/blob/63e8da9592869a8935a4dadba3b73063db19302f/src/interfaces/IRateModel.sol#L7-L10

https://github.com/morpho-labs/blue/blob/63e8da9592869a8935a4dadba3b73063db19302f/src/libraries/MarketStateLib.sol#L169C8-L172

from morpho-blue.

MathisGD avatar MathisGD commented on July 29, 2024

What about passing nothing to the IRM, and letting it get what it needs ?

from morpho-blue.

makcandrov avatar makcandrov commented on July 29, 2024

I agree with Patrick on that point. It is more efficient and elegant to give the IRM the variables we know it will need. Also, it limits the potential effects of the IRM, because imo it shouldn't depend on the market addresses.

from morpho-blue.

MathisGD avatar MathisGD commented on July 29, 2024

I don't think that we should pass specific data to the IRM (except if we could pass everything with a market struct for example) because it would necessarily restrict the possibilities in the IRM. Blue is meant to work with any contract that returns a reasonable rate.

And I think that the IRM should return a rate and not an amount of interests, because it is a more natural split between Blue and IRMs, it let less logic to the IRM, and it seems that we want to emit the rate from Blue directly.

from morpho-blue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.