diff --git a/package.json b/package.json index 1f876750..bbacf446 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "liquidops", - "version": "1.2.1", + "version": "1.2.2", "author": "Lorimer Jenkins , Marton Lederer ", "repository": { "type": "git", diff --git a/src/functions/lend/getEarnings.ts b/src/functions/lend/getEarnings.ts index 955c1f1a..9b3bc416 100644 --- a/src/functions/lend/getEarnings.ts +++ b/src/functions/lend/getEarnings.ts @@ -15,6 +15,7 @@ export interface GetEarnings { export interface GetEarningsRes { base: bigint; profit: bigint; + startDate?: number; } export async function getEarnings( @@ -114,8 +115,12 @@ export async function getEarnings( // they have deposited (without the interest!!) const base = sumDeposited - sumWithdrawn; + // the first mint date + const startDate = lendConfirmations?.edges?.[lendConfirmations?.edges?.length - 1 || 0]?.node?.block?.timestamp; + return { base, profit: collateralization - base, + startDate }; }