Commit Graph

3 Commits

Author SHA1 Message Date
James Grugett
cf74a195b2 Redeem shares: pay back a smaller frac of your loan 2022-09-08 22:59:25 -05:00
James Grugett
8b7cd20b6f
Loans2: Bets return you some capital every week (#588)
* Remove some old loan code

* Almost complete implementation of updateLoans cloud function

* Merge fixes

* Use invested instead of sale value, check if eligible, perform payouts

* Run monday 12am

* Implement loan income notification

* Fix imports

* Loan update fixes / debug

* Handle NaN and negative loan calcs

* Working loan notification

* Loan modal!

* Move loans calculation to /common

* Better layout

* Pay back loan on sell shares

* Pay back fraction of loan on redeem

* Sell bet loan: negate buy bet's loan

* Modal tweaks

* Compute and store nextLoanCached for all users

* lint

* Update loans with newest portfolio

* Filter loans to only unresolved contracts

* Tweak spacing

* Increase memory
2022-08-22 00:22:49 -05:00
Marshall Polaris
4d1c50a6cc
Redemption refactoring (#614)
* Refactor share redemption code into a few sensible functions

* Put very general share redemption code into common
2022-07-05 12:35:39 -07:00