Coder Social home page Coder Social logo

johanley / end-game Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 2.29 MB

Personal finance simulator for retired Canadians.

License: Creative Commons Zero v1.0 Universal

Java 100.00%
canada canadian retirement retirement-calculator retirement-planning simulation simulator personal-finance

end-game's People

Contributors

johanley avatar wohanley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wohanley

end-game's Issues

Update the GIS brackets.

This has to be done yearly. It's important to verify the max number of pages that are fetched. The number keeps increasing each year. So if you don't change it, it will truncate the table.

Support for ETFs

As usual, the more complex tax considerations are for non-reg accounts.

Link:
https://www.advisor.ca/tax/tax-news/tax-and-etfs-what-you-need-to-know/

In a non-reg account there are 6 buckets for a distribution (and a bucket for foreign-tax-withheld):

distribution
  cash: interest, foreign income (taxed like interest), dividend, cap gain
  return-of-capital: reduce the adjusted cost base
  reinvested: increase the adjusted cost base (cap gain)

Since the adjusted cost base is not applicable to the holdings in a registered account, what happens with such distros in a registered account? Answer: nothing!

Can a single distribution be divided into parts, as in part interest and part dividend? Yes, according to the RBC link below.

When is tax withheld? Only for foreign income? Correct.

ACB = 
   total purchase price (including commissions) 
    + reinvested distributions
      – return of capital

ETFs are priced like stock. They trade like stock. Whole shares, not fractional. The market price is for almost all purposes the same as the net asset value (NAV).

Sometimes the commish is 0.

Link:
https://www.taxtips.ca/personaltax/investing/taxtreatment/exchange-traded-funds.htm

- return of capital is not taxed (and reduces the ACB)
- reinvested cap gain is taxed (and increases the ACB)
- the details on the changes in the ACB may be non-obvious 
- when shares in ETFs are sold, the result is a capital gain or loss.
- US ETFs are more complex

Link:
https://www.rbcgam.com/en/ca/learn-plan/types-of-investments/etf-investing-common-questions-for-tax-season/detail

A distro can be a combination - part dividend, part interest, part cap gain, for example.

They describe some monkey business with the market price dropping by the amount of a dividend. Is similar to a stock going ex-dividend? Yes, they call it ex-distribution.

Link:
https://www.rbcgam.com/en/ca/learn-plan/types-of-investments/etf-investing-common-questions-for-tax-season/detail

Reinvestment can happen for any form of distribution, not just for cap gain.
Reinvestment always increases the ACB, no matter what form it takes.

Link:
https://www.adjustedcostbase.ca/blog/calculating-adjusted-cost-base-with-reinvested-distributions-dividend-reinvestment-plans-drips/

"When a distribution is reinvested in additional shares/units, it’s still immediately taxable in the exact same way as it would be if you had received cash. But additional care must be taken to ensure that the Adjusted Cost Base (ACB) is calculated correctly."

Link:
https://www.td.com/ca/en/asset-management/documents/investor/pdf/solutions/how_ETFs_are_taxed_en.pdf

Phantom distro = reinvested income / capital gain.

It's unclear to me what exactly happens when I elect to reinvest all distros. What if it's a dividend that's reinvested? Does it only change the ACB? Does nothing else change?

Link:
https://etfsage.com/FAQ.php#fees

PACC, DRIP, and SWP

Link:
https://www.vanguard.ca/en/advisor/products/products-group/etfs/VRIF

See "Annual Distributions". Example of yearly distro buckets.

It's bizarre to me that for distros that only change the ACB, they seem to be a complete non-event in registered accounts, because registered accounts don't track ACB.

Life tables for provinces

Currently the life tables are Canada-wide. The addition of life-tables specific to provinces is simple, just a bit tedious.
I'm not sure if this is worthwhile. It depends in part on the amount of variation between the various jurisdictions.

It might be beneficial to imitate the GisBracketFetcher's implementation.

Allow more flexibility for moving cash around.

The current 'sweep' transactions are one way only, investment account to bank.

It should be more flexible, any account to any other account.

For example, if you sell your house, the cash moves from your bank into an investment account.

Logic for OAS and CPP start-date is incorrect.

Example error.
DOB 1962-05-21
OAS start date 2027-05

This is because the code computes the age on the start of the month. The error occurs only if the birthday is on the first of the month.

The same issue occurs for CPP.

Add support for LIRA/LIF

On the surface, Lira/Lif are analogous to Rsp/Rif, with the addition of maxima.

BUT, Lira/Lif accounts are subject to provincial legislation, so there's likely a bunch of variations.
I've read that the maxima are linked to market conditions. That means they would need to be updated every year, and that across all provinces. A bit tedious.

Note that the province is the province of former employment, which can differ from the province of residence.

Feds: https://www.osfi-bsif.gc.ca/Eng/pp-rr/faq/Pages/lif-frv.aspx
General: https://ca.rbcwealthmanagement.com/delegate/services/file/3244485/content

I could input the RBC data above as a starting point. But that data changes every year, according to interest rates.

Add support for more kinds of assets.

Supporting more kinds of assets is important, but usually not easy.

Assets I have in mind:

  • ETFs
  • Bonds
  • Mutual Funds

Plain bonds would likely be the simplest to implement of the these three. Plain bonds apparently have high commissions at moderate levels of principal.

One aspect is how widely held the asset is. For example, do people hold actual bonds more than they hold bond ETFs? I don't know.

Another aspect is the tax implications, especially for the non-registered account. Would it be acceptable, at least initially, to restrict an asset class to the TFSA and RIF, and exclude it from the NRA? That would greatly simplify the tax treatment.

Would it be acceptable to support ETFs, but leave out Mutual Funds? The distributions of mutual funds seem particularly complex for tax implications, because they come in a mix of dividends, interest, capital gain, and return-of-capital.

Ref: https://www.finiki.org/wiki/Conventional_bonds

Delete ConvertRspToRif

Doesn't seem to be called. I think it's just a piece of data now, the conversion date in the rif account block.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.