morpho-org / morpho-utils

Repository gathering useful libraries and contracts.
GNU Affero General Public License v3.0
65 stars 1 forks source link

Implement similar maths features in TypeScript & publish package #48

Closed Rubilmax closed 1 year ago

Rubilmax commented 1 year ago

Below is a sample PR showing the code to this issue

The goal is to publish an npm package to avoid having to duplicate maths across codebases

Open questions:

QGarchery commented 1 year ago

Where would that package be used ? Looking at your implementation I understand that it looks very similar to what we implemented in solidity, but I feel like the use cases will be different (simply because of the language it is implemented in). Maybe later they will even diverge even more because of this. So maybe ts to distinguish the two implementations, or even put it in another repository

Rubilmax commented 1 year ago

That package would be used in any TS or js app integrating Morpho or event Compound/Aave

QGarchery commented 1 year ago

Ok so the purpose is to ease integration by providing the same math functions in js. It makes sense to have them in the same repository then, and I vote for ts

MerlinEgalite commented 1 year ago

I vote for ts or package. Not src. Do we know if it will be useful or not?

Rubilmax commented 1 year ago

Already used in https://github.com/morpho-dao/morpho-v1/pull/1301 and morpho-js. Could also ease work of integrators

julien-devatom commented 1 year ago

Because 90% of the morpho-utils repo is independent of ethers, I think that we have to create another repo for a peer dependency of ethers. So you have to say that morpho-utils is a repo extending ethers behavior where the majority of use cases do not implicate ethers. For me is the same thing as if you are trying to create a plugin for babel & one for jest in the same repo. Ok, they are related to maths but totally independent in their implementation. I'm not close to your solution and it can be a good one but I think that we can debate about that.

Rubilmax commented 1 year ago

The package was published at ethers-utils