Gain on trading securities

  
The following table presents the Company’s financial assets and liabilities which are measured at fair values on a recurring basis as of December 31, 2021 and 2020, (in thousands): 

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|  |  | Fair Value |  | Level 1 |  | Level 2 |  | Level 3 |
| December 31, 2021 |  |  |  |  |  |  |  |  |
| Assets: |  |  |  |  |  |  |  |  |
| Repurchase agreements |  | $ | 477,069  |  |  | $ | —  |  |  | $ | 477,069  |  |  | $ | —  |  |
| Money market |  | 43,023  |  |  | —  |  |  | 43,023  |  |  | —  |  |
| Certificates of deposit |  | 958  |  |  | —  |  |  | 958  |  |  | —  |  |
|  |  |  |  |  |  |  |  |  |
| Foreign exchange contracts |  | 120,859  |  |  | —  |  |  | 120,859  |  |  | —  |  |
| Total assets |  | $ | 641,909  |  |  | $ | —  |  |  | $ | 641,908  |  |  | $ | —  |  |
| Cash collateral for foreign exchange contracts |  | $ | 25,881  |  |  | $ | —  |  |  | $ | —  |  |  | $ | —  |  |
| Liabilities: |  |  |  |  |  |  |  |  |
| Interest rate swaps |  | $ | (30,733) |  |  | $ | —  |  |  | $ | (30,733) |  |  | $ | —  |  |
| Foreign exchange contracts |  | 89,925  |  |  | —  |  |  | 89,925  |  |  | —  |  |
| Total liabilities |  | $ | 59,192  |  |  | $ | —  |  |  | $ | 59,192  |  |  | $ | —  |  |
| Cash collateral obligation for foreign exchange contracts |  | $ | 24,803  |  |  | $ | —  |  |  | $ | —  |  |  | $ | —  |  |
|  |  |  |  |  |  |  |  |  |
| December 31, 2020 |  |  |  |  |  |  |  |  |
| Assets: |  |  |  |  |  |  |  |  |
| Repurchase agreements |  | $ | 446,116  |  |  | $ | —  |  |  | $ | 446,116  |  |  | $ | —  |  |
| Money market |  | 48,227  |  |  | —  |  |  | 48,227  |  |  | —  |  |
| Certificates of deposit |  | 188  |  |  | —  |  |  | 188  |  |  | —  |  |
|  |  |  |  |  |  |  |  |  |
| Foreign exchange contracts |  | 155,846  |  |  | —  |  |  | 155,846  |  |  | —  |  |
| Total assets |  | $ | 650,377  |  |  | $ | —  |  |  | $ | 650,377  |  |  | $ | —  |  |
| Cash collateral for foreign exchange contracts |  | $ | 18,229  |  |  | $ | —  |  |  | $ | —  |  |  | $ | —  |  |
| Liabilities: |  |  |  |  |  |  |  |  |
| Interest rate swaps |  | $ | 87,873  |  |  | —  |  |  | $ | 87,873  |  |  | —  |  |
| Foreign exchange contracts |  | 140,272  |  |  | —  |  |  | 140,272  |  |  | —  |  |
| Total liabilities |  | $ | 228,145  |  |  | $ | —  |  |  | $ | 228,145  |  |  | $ | —  |  |
| Cash collateral obligation for foreign exchange contracts |  | $ | 38,569  |  |  | $ | —  |  |  | $ | —  |  |  | $ | —  |  |

The Company utilizes Level 1 fair value for financial assets designated as trading securities for which there are quoted market prices. During the year ended December 31, 2020, the Company recognized a $30.0 million gain on trading securities sold. Cash flow from trading securities sold was recognized within the Investing section of the Statement of Cash Flows based on the nature of the investment. The Company has highly-liquid investments classified as cash equivalents, with original maturities of 90 days or less, included in our Consolidated Balance Sheets. The Company utilizes Level 2 fair value determinations derived from directly or indirectly observable (market based) information to determine the fair value of these highly liquid investments. The Company has certain cash and cash equivalents that are invested on an overnight basis in repurchase agreements, money markets and certificates of deposit. The value of overnight repurchase agreements is determined based upon the quoted market prices for the treasury securities associated with the repurchase agreements. The value of money market instruments is determined based upon the financial institutions' month-end statement, as these instruments are not tradable and must be settled directly by us with the respective financial institution. Certificates of deposit are valued at cost, plus interest accrued. Given the short-term nature of these instruments, the carrying value approximates fair value. Foreign exchange derivative contracts are carried at fair value, with changes in fair value recognized in the Consolidated Statements of Income. The fair value of the Company's derivatives is derived with reference to a valuation from a derivatives dealer operating in an active market, which approximates the fair value of these instruments.The fair value represents the net settlement if the contracts were terminated as of the reporting date. Cash collateral received for foreign exchange derivatives is recorded within customer deposits in our Consolidated Balance Sheets. Cash collateral deposited for foreign exchange derivatives is recorded within restricted cash in our Consolidated Balance Sheet. The level within the fair value hierarchy and the measurement technique are reviewed quarterly. Transfers between levels are deemed to have occurred at the end of the quarter. There were no transfers between fair value levels during the periods presented for 2021 and 2020.69
