3 ms·
This is an awesome idea. The only thing I log in to my account is to literally run this in my head a couple of times a month. I usually have a couple of active
by jimmies 10y ago
This is an awesome idea. The only thing I log in to my account is to literally run this in my head a couple of times a month. I usually have a couple of active credit cards with different due dates on them so this is at least annoying to keep track of.
safe_margin = rent + food + 500
emergency_fund_bal = monthly_salary * 3
// pay all credit cards if I can
sort(my_credit_cards, apr)
for (cc in my_credit_cards) {
if (cc.statement_bal == 0 || cc.paid) skip
if (checking.bal - cc.statement_bal - safe_margin >= 0) {
pay(to=cc, from=checking, amount=cc.statement_bal);
cc.paid = 1
} else if (checking.balance > cc.min_pay) {
pay(to=cc, from=checking, amount=cc.min_pay)
}
}
// refill the emergency funds if needed and can
if (savings.bal < emergency_fund_bal && checking.bal > safe_margin) {
transfer(from=checking, to=checking,
amount=min(
emergency_fund_bal - savings.bal,
checking.bal - safe_margin)
)
}
// invest the rest
if (checking.bal > safe_margin) {
invest(checking.bal - safe_margin)
}
- hdhzy 10y agoGlad I'm not the only one that'd be happy to have a proper api for their bank. In Europe to upcoming PSD2 directive basically requires banks to expose the api. In the mean time I'm abusing JSON/HTTP api my bank has built for their own RWD app...