pie-dao / PieVaults

21 stars 11 forks source link

Best lending protocol oracle #20

Closed MickdeGraaf closed 3 years ago

MickdeGraaf commented 3 years ago

For a given underlying asset it returns the APR and which lending protocol has the best rate

User Story

Type

Description

Add a function to the lendingRegistry which returns the highest APR for a given _underlying and array of _protocols with the following interface:

getBestApr(address _underlying, bytes[] memory _protocols) external view returns(uint256 apr, bytes32 protocol);

Definition of Done

Relies on #17

Evert0x commented 3 years ago

it is appropriate to implement both getBestApr and getBestAprView? In relation to the underlying lending logic methods

Evert0x commented 3 years ago

Implemented in feature/best-apr, included the changes from #17 and #18