-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reenable loans at 1.5% and store on contract metrics (#3188)
* Reenable loans and store on contract metrics * Remove unused, add backfill * Share next loan code * Modify return * Add back in safeguards * Fix summary trigger * Table def * Fix cache & loan repayment in place-bet * Remove log * Calculate payouts with contract metrics * Optimize update metrics transaction * Pay back loan in multi-sell * Remove nextLoanCached and fix redemption loan amount * Simplify * Add proper loan numbers to multi-sell panel * Save loan when recalculating metrics * Use contract metric to show loan amount * Fix script * Merge main * Fix native profit column * Loan rate to 1.5%
- Loading branch information
1 parent
aa1fa77
commit 4338a6f
Showing
46 changed files
with
808 additions
and
739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { type APIHandler } from './helpers/endpoint' | ||
import { getNextLoanAmountResults } from 'api/request-loan' | ||
|
||
export const getNextLoanAmount: APIHandler<'get-next-loan-amount'> = async ({ | ||
userId, | ||
}) => { | ||
try { | ||
const { result } = await getNextLoanAmountResults(userId) | ||
return { amount: result.payout } | ||
} catch (e) { | ||
return { amount: 0 } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.