Skip to content

Commit

Permalink
Merge pull request #183 from morpho-org/fix/apys-computations
Browse files Browse the repository at this point in the history
fix(blue-api-sdk): fix market apys computation
  • Loading branch information
oumar-fall authored Nov 29, 2024
2 parents 16ea741 + 36220cf commit 98606c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/blue-api-sdk/src/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ export class BlueSdkConverter {
const rateAtTarget =
// rateAtUTarget is not typed nullable, but it will be as soon as a non-compatible IRM is enabled.
dto.state.rateAtUTarget != null
? // API rate at targed is annualized, while the Market rateAtTarget is per second.
this.options.parseNumber(dto.state.rateAtUTarget, 18) /
? // API rate at target is compounded over the year, while the Market rateAtTarget is per second.
//TODO use rateAtTarget directly per second
this.options.parseNumber(Math.log1p(dto.state.rateAtUTarget), 18) /
Time.s.from.y(1n)
: undefined;

Expand Down

0 comments on commit 98606c1

Please sign in to comment.