Derivative Instruments and Hedging Activities Disclosure | Derivative Financial Instruments We selectively utilize crude oil and refined product commodity derivative contracts to reduce the risk associated with potential price changes on committed obligations as well as to reduce earnings volatility. We also utilize interest rate swaps to manage our exposure to interest rate risk. We do not speculate using derivative instruments. Credit risk on our derivative instruments is mitigated by transacting with counterparties meeting established collateral and credit criteria. Mark to Market We have certain contracts that serve as economic hedges, which are derivatives used for risk management but not designated as hedges for financial accounting purposes. All economic hedge transactions are recorded at fair value and any changes in fair value between periods are recognized in earnings. We have contracts that are used to fix prices on forecasted purchases of inventory, which we refer to as futures and forwards. Futures represent trades executed on the New York Mercantile Exchange which have not been closed or settled at the end of the reporting period. Forwards represent physical trades for which pricing and quantities have been set, but the physical product delivery has not occurred by the end of the reporting period. During the year ended December 31, 2016, we had economic hedges in the form of swap contracts that fixed price differentials between different types of crude oil and refined products that we use or produce at our refineries. As of March 31, 2017 and December 31, 2016 , we did not have any outstanding commodity swap contracts accounted for as economic hedges. Fair Value Hedges Fair value hedges are used to hedge price volatility of certain refining inventories and firm commitments to purchase inventories. The gain or loss on a derivative instrument designated and qualifying as a fair value hedge, as well as the offsetting gain or loss on the hedged item attributable to the hedged risk, is recognized in earnings in the same period. We have certain commodity contracts associated with the Supply and Offtake Agreements discussed in Note 7 that have been accounted for as fair value hedges, which had purchase volumes of 444 thousand barrels of crude oil as of March 31, 2017 . Cash Flow Hedges To designate a derivative as a cash flow hedge, we document at the inception of the hedge the assessment that the derivative will be highly effective in offsetting expected changes in cash flows from the hedged item. This assessment, which is updated at least quarterly, is generally based on the most recent relevant historical correlation between the derivative and the hedged item. If, during the term of the derivative, the hedge is determined to be no longer highly effective, hedge accounting is prospectively discontinued and any remaining unrealized gains or losses, based on the effective portion of the derivative at that date, are reclassified to earnings when the underlying transactions occur. Interest Rate Derivatives. We have interest rate swap agreements, maturing March 2019, that effectively fixed the variable LIBOR interest component of the term loans within the retail credit agreement. These interest rate swaps have been accounted for as cash flow hedges. The aggregate notional amount under these agreements covers approximately 75% of the outstanding principal of these term loans throughout the duration of the interest rate swaps. As of March 31, 2017 , the outstanding principal of these term loans was $95,884 . The interest rate swaps lock in an average fixed interest rate of 2.40% through the remainder of 2017; 2.89% in 2018 and 3.06% in 2019. Related to interest rate swap cash flow hedges in OCI, we recognized unrealized gains (losses) of $293 and $(1,051) for the three months ended March 31, 2017 and 2016 , respectively. For the three months ended March 31, 2017 and 2016 , there was no cash flow hedge ineffectiveness recognized in income and no component of our cash flow hedges’ gains or losses was excluded from the assessment of hedge effectiveness. As of March 31, 2017 , we have unrealized losses of $1,663 classified in OCI related to cash flow hedges. Assuming interest rates remain unchanged, unrealized losses of $827 will be reclassified from OCI into earnings over the next twelve-month period as the underlying transactions occur. The following tables present the effect of derivative instruments on the consolidated balance sheets: As of March 31, 2017 Asset Derivatives Liability Derivatives Balance Sheet Location Fair Value Balance Sheet Location Fair Value Derivatives not designated as hedging instruments: Commodity contracts (futures and forwards) Accounts receivable $ 2,692 Accrued liabilities $ 3,495 Total derivatives not designated as hedging instruments 2,692 3,495 Derivatives designated as hedging instruments: Interest rate swaps $ — Other non-current liabilities $ 1,663 Fair value hedges of consigned inventory Other assets 17,340 — Total derivatives designated as hedging instruments 17,340 1,663 Total derivatives $ 20,032 $ 5,158 As of December 31, 2016 Asset Derivatives Liability Derivatives Balance Sheet Location Fair Value Balance Sheet Location Fair Value Derivatives not designated as hedging instruments: Commodity contracts (futures and forwards) Accounts receivable $ 3,602 Accrued liabilities $ 5,163 Total derivatives not designated as hedging instruments 3,602 5,163 Derivatives designated as hedging instruments: Interest rate swaps $ — Other non-current liabilities $ 1,956 Fair value hedges of consigned inventory Other assets 14,777 — Total derivatives designated as hedging instruments 14,777 1,956 Total derivatives $ 18,379 $ 7,119 The following tables present the effect of derivative instruments on the consolidated statements of operations and accumulated other comprehensive income: Derivatives designated as hedging instruments: Cash Flow Hedging Relationships Gain (Loss) Recognized in OCI Gain (Loss) Reclassified from Accumulated OCI into Income (Effective Portion) Gain (Loss) Reclassified from Accumulated OCI into Income (Ineffective Portion and Amount Excluded from Effectiveness Testing) Location Amount Location Amount For the Three Months Ended March 31, 2017 Interest rate swaps $ 293 Interest expense $ (172 ) $ — Total derivatives $ 293 $ (172 ) $ — For the Three Months Ended March 31, 2016 Interest rate swaps $ (1,051 ) Interest expense $ (70 ) $ — Total derivatives $ (1,051 ) $ (70 ) $ — Derivatives in fair value hedging relationships: Gain (Loss) Recognized in Income For the Three Months Ended March 31, Location 2017 2016 Fair value hedges of consigned inventory (1) Interest expense $ 2,563 $ (1,215 ) Total derivatives $ 2,563 $ (1,215 ) ________________ (1) Changes in the fair value hedges are substantially offset in earnings by changes in the hedged items. Derivatives not designated as hedging instruments: Gain (Loss) Recognized in Income For the Three Months Ended March 31, Location 2017 2016 Commodity contracts (futures and forwards) Cost of sales $ (871 ) $ 5,213 Commodity contracts (swaps) Cost of sales — 366 Total derivatives $ (871 ) $ 5,579 Offsetting Assets and Liabilities Our derivative instruments are subject to master netting arrangements to manage counterparty credit risk associated with derivatives, and we offset the fair value amounts recorded for derivative instruments to the extent possible under these agreements on our consolidated balance sheets. The following table presents offsetting information regarding our derivatives by type of transaction as of March 31, 2017 and December 31, 2016 : Gross Amounts of Recognized Assets/Liabilities Gross Amounts offset in the Statement of Financial Position Net Amounts Presented in the Statement of Financial Position Gross Amounts Not offset in the Statement of Financial Position Net Amount Financial Instruments Cash Collateral Pledged As of March 31, 2017 Derivative Assets: Commodity contracts (futures and forwards) $ 3,525 $ (833 ) $ 2,692 $ (2,692 ) $ — $ — Interest rate swaps 46 (46 ) — — — — Fair value hedges of consigned inventory 17,340 — 17,340 — — 17,340 Derivative Liabilities: Commodity contracts (futures and forwards) $ 4,328 $ (833 ) $ 3,495 $ (2,692 ) $ — $ 803 Interest rate swaps 1,709 (46 ) 1,663 — — 1,663 As of December 31, 2016 Derivative Assets: Commodity contracts (futures and forwards) $ 5,169 $ (1,567 ) $ 3,602 $ (3,602 ) $ — $ — Interest rate swaps 29 (29 ) — — — — Fair value hedges of consigned inventory 14,777 — 14,777 — — 14,777 Derivative Liabilities: Commodity contracts (futures and forwards) $ 6,730 $ (1,567 ) $ 5,163 $ (3,602 ) $ — $ 1,561 Interest rate swaps 1,985 (29 ) 1,956 — — 1,956 Compliance Program Market Risk We are obligated by government regulations to blend a certain percentage of biofuels into the products that we produce and are consumed in the U.S. We purchase biofuels from third parties and blend those biofuels into our products, and each gallon of biofuel purchased includes a RIN. To the degree we are unable to blend biofuels at the required percentage, a RINs deficit is generated and we must acquire that number of RINs by the annual reporting deadline in order to remain in compliance with applicable regulations. Alternatively, if we have a RINs surplus, some of those RINs could be sold. Any such sales would be subject to our normal credit evaluation process. We are exposed to market risk related to the volatility in the price of credits needed to comply with these governmental and regulatory programs. We manage this risk by purchasing RINs when prices are deemed favorable utilizing fixed price purchase contracts. We may also sell the RINs with an agreement to repurchase in the future at a fixed price. Some of these contracts are derivative instruments; however, we elect the normal purchase and sale exception and do not record these contracts at their fair values. In February 2017, the Environmental Protection Agency approved a small refinery exemption for the Krotz Springs refinery from the requirements of the renewable fuel standard for the 2016 calendar year (the “Krotz Springs Exemption”). As a result, we recorded a reduction to RINs expense of $27,746 in the first quarter of 2017. The total net cost (benefit) related to meeting our obligations under these compliance programs was $(13,246) and $11,211 for the three months ended March 31, 2017 and 2016 , respectively, inclusive of the Krotz Springs Exemption. These amounts are reflected in cost of sales in the consolidated statements of operations and are exclusive of the benefit generated from operations at our California renewable fuels facility. |