v3.22.4
Financial Instruments (Tables)
12 Months Ended
Dec. 31, 2022
Fair Value Disclosures [Abstract]  
Summary of Debt Securities by Investment Classification
The following tables summarize debt securities by significant investment classification:
As at December 31, 2022
Carrying Value
Cash EquivalentsMarketable SecuritiesEquity and Other InvestmentsFair Value
$$$$
Level 1:
U.S. term deposits600,000608,337
U.S. federal bonds and agency securities27,944740,978769,318
Canadian federal bonds and agency securities202,488546,943750,252
Corporate bonds and commercial paper201,513201,644
Repurchase agreements99,00099,023
530,9451,887,9212,428,574
Level 2:
Corporate bonds and commercial paper1,515,7011,517,667
Level 3:
Convertible notes in private companies220,992220,992
530,9453,403,622220,9924,167,233
As at December 31, 2021
Carrying Value
Cash EquivalentsMarketable SecuritiesEquity and Other InvestmentsFair Value
$$$$
Level 1:
Corporate bonds and commercial paper267,953268,090
U.S. term deposits900,000901,689
U.S. federal bonds and agency securities680,436681,629
Canadian federal bonds and agency securities50,1381,215,6461,268,139
318,0912,796,0823,119,547
Level 2:
Corporate bonds and commercial paper2,469,0192,475,051
Level 3:
Convertible notes in private companies205,878205,878
318,0915,265,101205,8785,800,476
Schedule of Equity and Other Investments
Equity investments with readily determinable fair values are comprised of:
December 31, 2022December 31, 2021
Level 1Level 3TotalLevel 1Level 3Total
$$$$$$
Affirm Holdings, Inc.196,278196,2782,041,1262,041,126
Global-E Online Ltd.400,22250,900451,122741,775423,3871,165,162
Other568568
597,06850,900647,9682,782,901423,3873,206,288
Adjustments related to equity and other investments with readily determinable fair values for the years ended December 31, 2022 and 2021 were as follows:

Years ended
December 31, 2022December 31, 2021
$$
Balance, beginning of the year3,206,288 — 
Adjustments related to equity and other investments with readily determinable fair values:
Investments received not tied to services(1)
105,268 — 
Investments received as non-cash consideration in exchange for services29,577 — 
Purchases of equity and other investments67 40 
Sale of equity and other investments(3,082)— 
Net unrealized (losses) gains(2,690,150)2,855,718 
Transfers from measurement alternative (2)(3)
— 350,530 
Balance, end of the year647,968 3,206,288 
(1) During the year ended December 31, 2022, certain private investments were acquired by third-party investors resulting in the deemed sale of equity and other investments in the year and the receipt of shares in certain public companies. Any resulting realized gains or losses were presented as "net realized gain on equity and other investments" in the consolidated statement of operations and comprehensive (loss) income.
(2) Effective January 13, 2021, the Company's investment in Affirm no longer qualified for the use of the measurement alternative as the fair value of the investment became readily determinable.
(3) Effective May 12, 2021, the Company's investment in Global-E no longer qualified for the use of the measurement alternative as the fair value of the investment became readily determinable.
Schedule of Equity Investments without Readily Determinable Fair Values
The carrying value of equity investments in private companies without readily determinable fair values are:
December 31, 2022December 31, 2021
$$
Total initial value1,359,950 539,221 
Cumulative gross unrealized gains59,023 38,880 
Cumulative gross unrealized losses and impairment(334,473)(34,722)
Total carrying value of equity and other investments without readily determinable fair values (1)
1,084,500 543,379 
(1) As at December 31, 2022, three investments in private companies represent $879,998 (December 31, 2021 - $348,278) of the total carrying value of equity and other investments without readily determinable fair values.
Adjustments related to equity and other investments without readily determinable fair values for the years ended December 31, 2022 and 2021 were as follows:
Years ended
December 31, 2022December 31, 2021
$$
Balance, beginning of the year543,379 173,454 
Adjustments related to equity and other investments without readily determinable fair values:
Purchases of equity and other investments598,585 450,193 
Investments received as non-cash consideration in exchange for services243,624 268,058 
Gross unrealized gains20,143 36,926 
Sales of equity and other investments(1)
(13,480)— 
Transfers to readily determinable fair values (2)(3)
— (350,530)
Gross unrealized losses and impairments(4)
(307,751)(34,722)
Balance, end of the year1,084,500 543,379 
(1) During the year ended December 31, 2022, certain private investments were acquired by third-party investors resulting in the deemed sale of equity and other investments in the year. Any resulting realized gains or losses were presented as "net realized gain on equity and other investments" in the consolidated statement of operations and comprehensive (loss) income.
(2) Effective January 13, 2021, the Company's investment in Affirm no longer qualified for the use of the measurement alternative as the fair value of the investment became readily determinable.
(3) Effective May 12, 2021, the Company's investment in Global-E no longer qualified for the use of the measurement alternative as the fair value of the investment became readily determinable.
(4) The Company applied certain valuation methods based on information available, including the market approach and option pricing models in order to quantify the level of impairment. This required the Company to develop certain key assumptions, including revenue growth rates, revenue multiples based on market comparables and a discount for lack of marketability. Non-public information, made available to the Company from investee companies, was supplemented with estimates such as volatility, expected time to liquidity and the rights and obligations of the securities the Company holds.
Schedule of Cash Flow Hedges Included in Accumulated Other Comprehensive Income (Loss)
The fair values of outstanding derivative instruments were as follows:
December 31, 2022December 31, 2021
$$
Level 2:
Foreign exchange forward contracts and options assets (classified in other current assets)1,484 1,824 
Foreign exchange forward contract liabilities (classified in accounts payable and accrued liabilities)15,548 5,926 

Unrealized gains and unrealized losses related to changes in the fair value of foreign exchange forward contracts and options designated as cash flow hedges were as follows:
December 31, 2022December 31, 2021
$$
Unrealized gains1,189 1,215 
Unrealized losses(15,350)(4,936)
Total net unrealized losses(14,161)(3,721)
Realized losses and realized gains related to the maturity of foreign exchange forward contracts and options designated as cash flow hedges were as follows:
Years ended
December 31, 2022December 31, 2021
$$
Realized (losses) gains in cost of revenues(864)1,001 
Realized (losses) gains in operating expenses(22,348)21,851 
(23,212)22,852