Calculate the max pain strike of every expiry: the expiry price at which the options outstanding would pay their holders the least, the sum over every call of open interest times max(price - strike, 0) and over every put of open interest times max(strike - price, 0) being smallest. Option writers, often market makers, profit most there, and some traders expect the price to drift towards it as the expiry nears; the evidence for that is mixed, so it is best read as a description of where open interest is concentrated.

Also known as: max pain theory, option pain, maximum pain.

Max Pain in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_max_pain as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL"], api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.options.get_max_pain(number_of_expirations=4)

Or, after setting up the Finance Toolkit MCP, ask:

What is the max pain price of Apple options for the next four expirations, and how far is it from the share price?

Which returns:

  Days to Expiration Max Pain Stock Price Distance to Max Pain
(‘AAPL’, ‘2026-10-26’) 2 345 347.73 -0.0079
(‘AAPL’, ‘2026-10-28’) 4 345 347.73 -0.0079
(‘AAPL’, ‘2026-10-30’) 6 342.5 347.73 -0.015
(‘AAPL’, ‘2026-11-06’) 13 340 347.73 -0.0222

Parameters

get_max_pain accepts the following parameters.

ParameterTypeDescriptionExample
expiration_dateslist[str] | NoneThe expiries to use. Defaults to None, the nearest number_of_expirations expiries.["2027-12-17", "2028-01-21"]
number_of_expirationsintThe number of nearest expiries to use when no dates are given. Defaults to 6.4
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the Toolkit’s rounding.2
Share