Form 4 Transaction Codes Explained: P, S, A, M, F, G, D, X
A one-letter code on every Form 4 row separates real insider conviction from payroll plumbing. P, S, A, M, F, G, D, and X decoded, with the traps to avoid.

Pull insider trades with transaction codes intact
Use the article to understand the filing rules, then query the live Form 4 feed. The API separates open-market trades from awards and exercises, with source accessions attached.
curl -H "Authorization: Bearer $ARKOLITH_KEY" \
"https://arkolith.com/api/v1/insider/transactions?ticker=TSM&signal=true"Agent prompt
Use Arkolith to find recent open-market insider buys for TSM, explain each transaction code, and cite the source filing.
The short version
Form 4 transaction codes are one-letter labels that explain why an insider's position changed. Code P (open market purchase) carries the most signal because the insider chose to put their own cash at risk. S (open market sale) needs context before you read it as bearish. A, M, F, X, and D are mostly compensation mechanics, and G is a gift. If you apply only one filter to insider data, filter for P.
What a Form 4 transaction code actually tells you
When a corporate officer, director, or 10 percent owner trades their company's stock, they must report it on Form 4 within two business days of the trade. The sibling forms run on slower clocks: Form 3 is due within 10 days of becoming an insider, and Form 5 is due within 45 days of fiscal year end for transactions that were exempt or missed during the year. The SEC's investor education site has a plain overview of Forms 3, 4, and 5.
Every transaction row on the form carries a single-letter code defined in the form's general instructions. That code is the entire difference between "the CFO wrote a personal check to buy stock" and "the CFO's restricted shares vested and the company withheld some for taxes." Both events produce a Form 4 line item. Both show shares moving. Only one says anything about conviction.
This is why raw "insider selling" headlines are so often misleading. A feed that ignores transaction codes counts routine option exercises, vesting events, and tax withholding as if they were trading decisions. Across the 51,000+ insider transactions Arkolith tracks, a large share of rows are exactly this kind of plumbing. Filter wrong and your insider signal is mostly payroll.
Form 4 is also only one piece of the ownership picture. For how it fits next to the quarterly institutional filings and the 5 percent stake disclosures, see 13F vs 13D vs 13G vs Form 4.

The eight codes decoded
The codes appear in column 3 of Table I (non-derivative securities, meaning common stock) and Table II (derivative securities, meaning options, RSUs, warrants). Here are the eight you will see constantly:
| Code | Official meaning | Insider's own cash at risk? | Read it as |
|---|---|---|---|
P |
Open market or private purchase | Yes | The strongest code: a deliberate buy |
S |
Open market or private sale | Cash comes out | Context dependent: often diversification or a plan |
A |
Grant, award, or other acquisition from the issuer | No | Compensation, not a trade |
M |
Exercise or conversion of a derivative security | Rarely | Mechanics; watch what happens to the shares next |
F |
Shares withheld or delivered to cover taxes or exercise price | No | Payroll plumbing, not a sale decision |
G |
Bona fide gift | No | Usually estate or charity planning |
D |
Disposition of securities back to the issuer | No | Mechanics under Rule 16b-3(e) |
X |
Exercise of an in-the-money or at-the-money derivative | Rarely | Mechanics, a cousin of M |
Two details trip people up. First, do not confuse code A with the separate acquired/disposed flag printed next to every code: each row also carries an "A" or "D" marker that just says whether shares went up or down. Second, the alphabet does not stop at eight. C marks a conversion, W marks shares moving by will or inheritance, and J is the catch-all "other" code that requires a footnote explaining the transaction. J-coded rows with long footnotes are sometimes the most interesting lines on the form.
Which codes carry signal
P is the code worth building screens around. An open market purchase means an insider, who already has salary, options, and career tied to the company, chose to concentrate further with personal cash. Academic work on insider trading has generally found that open market purchases are followed by better-than-average stock performance, while the predictive value of sales is much weaker. Purchases are rare relative to compensation events, which is exactly why they stand out.
The signal strengthens with context:
- Clustering. One director buying is a data point. Three or four insiders buying within days of each other is a pattern. We track these setups in insider buying clusters.
- Who is buying. A CFO or CEO purchase tends to be read as more informative than an outside director topping up.
- Size relative to holdings. A buy that doubles an insider's stake reads differently than a token purchase.
S is genuinely ambiguous. Insiders sell to diversify, pay taxes, buy houses, and fund divorces. Many sales execute automatically under Rule 10b5-1 trading plans adopted months earlier, and Form 4 now includes a checkbox indicating whether a transaction was made under such a plan. A checked box drains most of the information out of a sale. An unchecked, unusually large S-coded sale at a price low relative to the insider's history is a different animal, and worth a closer look on the company's insider page, for example insider activity for TSM.
Which codes are noise, and the classic traps
The compensation codes generate most Form 4 volume and most retail misreadings. Three traps recur:
The M+S exercise-and-sell. An executive exercises options (M) and sells the resulting shares the same day (S). The headline number can be large, but the insider may simply be harvesting compensation before options expire. The tell is the pairing: an M row and an S row with matching share counts on the same date. Treat the S leg as weaker evidence than a standalone open market sale.
The F "sale" that is not a sale. When restricted stock vests, companies routinely withhold a slice of the shares to cover the insider's tax bill. That withholding files as code F. Screens that lump F into "insider selling" will flag every vesting calendar as bearish activity. It is payroll, executed by the company, on a schedule set years earlier.
The A grant counted as buying. Code A means the company granted shares or units to the insider. No cash changed hands and no view on valuation was expressed. Counting grants as accumulation inflates "insider buying" statistics badly, since grants are far more common than P-coded purchases.
D (shares surrendered back to the issuer) and X (exercising an in-the-money derivative) belong in the same mechanical bucket. G (gifts) is usually estate planning, although academic work has suggested that the timing of large gifts can occasionally be opportunistic, since gift valuations depend on the share price. The honest default is to exclude gifts from trading signals and eyeball the large ones.
Pulling insider transactions into an agent or screen
Code-aware filtering is exactly the kind of rule an AI agent gets wrong when it works from memory instead of data. An agent that "remembers" that a CEO sold stock, without the transaction code, will confidently report conviction selling where the filing shows tax withholding. The fix is grounding: query the filings, keep the codes, and carry the source. Every insider datapoint in Arkolith resolves to its SEC EDGAR accession number, which is the anti-hallucination pattern described in stopping AI from hallucinating market data.
Resolving a company is one call:
curl -H "Authorization: Bearer YOUR_KEY" \
"https://arkolith.com/api/v1/search?q=TSM"
From there an agent can pull insider activity for the ticker and apply the rules above: keep P, weigh unplanned S, drop A, M, F, X, and D from conviction math. The same logic composes with institutional data. If you want to check whether smart money agrees with the insiders, pull a fund's holdings and compare:
curl -H "Authorization: Bearer YOUR_KEY" \
"https://arkolith.com/api/v1/funds/1067983/holdings"
Insider purchases plus quarter-over-quarter institutional accumulation on the same name is one of the cleaner confluence setups in public filings data, and you can browse the institutional side on the investors leaderboard. To wire the whole flow into Claude or another agent via MCP rather than raw REST, start with the quickstart.
One honest limitation: codes describe mechanics, not motive. A P-coded buy can still be a signaling gesture timed around bad news, and a footnote can recharacterize almost anything. Read the footnotes on anything you intend to act on.

Frequently asked questions about form 4 transaction codes
What does transaction code P mean on a Form 4?
Code P marks an open market or private purchase of securities. It means the insider spent personal cash to acquire shares, which is why it is widely treated as the highest-signal transaction code on the form.
Is transaction code S always bearish?
No. Many S-coded sales are diversification, tax funding, or automatic executions under prearranged Rule 10b5-1 plans, and the form includes a checkbox for plan trades. An unplanned, unusually large sale deserves attention; a scheduled one usually does not.
What is the difference between codes M and F?
Code M records the exercise or conversion of a derivative security, such as employee stock options turning into common shares. Code F records shares withheld or delivered to cover the tax bill or exercise price on that kind of event. Both are compensation mechanics rather than trading decisions.
Which Form 4 transaction codes should a screen ignore?
For conviction-based screens, exclude A (grants), M and X (exercises), F (tax withholding), D (dispositions to the issuer), and G (gifts). Build the screen around P, treat unplanned S with context, and read the footnotes on J-coded rows individually.
This article explains public filings and data concepts. It is not investment advice.
Keep reading
Insider Trading Data API: Query Form 4 Filings at Scale
What a good insider trading data API looks like: Form 4 mechanics, amendment handling, derivative separation, provenance, and code examples for agents.

Form 4 Purchases This Week: UUUU, WRAP, AVO
Three source-checked Form 4 signals from July 6 to 8: two Energy Fuels buyers, an amendment-aware Wrap cluster, and $24.1M reported by a Mission Produce 10% owner.

How to Read SEC Filings: A Beginner's Map
SEC filings split into company reports and ownership disclosures. Learn which form answers which question, and where the who-owns-what data actually lives.