Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liquidops",
"version": "1.2.1",
"version": "1.2.2",
"author": "Lorimer Jenkins <lorimer@liquidops.io>, Marton Lederer <marton@liquidops.io>",
"repository": {
"type": "git",
Expand Down
5 changes: 5 additions & 0 deletions src/functions/lend/getEarnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface GetEarnings {
export interface GetEarningsRes {
base: bigint;
profit: bigint;
startDate?: number;
}

export async function getEarnings(
Expand Down Expand Up @@ -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
};
}
Loading