All skills
joellewis avatar

/trade-execution

@cf3e6ba
by joellewisjoellewis/finance_skills200 stars
37

Guide the design, evaluation, and monitoring of trade execution quality and best execution practices. Use when assessing best execution obligations under FINRA Rule 5310 or RIA fiduciary duty, designing smart order routing across exchanges and dark pools, selecting execution algorithms (VWAP, TWAP, implementation shortfall, POV), building transaction cost analysis (TCA) for pre-trade estimation or post-trade measurement, analyzing bid-ask spread decomposition or market impact or information leakage, conducting best execution committee reviews, evaluating payment for order flow (PFOF) arrangements, interpreting Rule 605/606 reports, or handling fixed income or ETF execution via RFQ protocols. Also covers Reg NMS Order Protection Rule and venue fee structures.

Use this Skill: https://skilld.dev/gh/joellewis/finance_skills/trade-execution

This session only. Nothing lands on disk.

referencesexamples.md

≈4.8k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Trade Execution — Worked Examples

Example 1: Evaluating Best Execution for a Mid-Size RIA Routing Through a Single Custodian

Scenario: A mid-size RIA managing $600 million across 400 client accounts custodies all assets at a single custodian. The custodian provides commission-free equity trading and routes orders through its internal execution desk and affiliated wholesalers. The firm's compliance officer is preparing the annual best execution review and must evaluate whether the current arrangement satisfies the firm's fiduciary duty, particularly given that the firm has not compared execution quality against alternative arrangements.

Design Considerations:

The compliance officer structures the review around three pillars: data collection, quantitative analysis, and qualitative assessment.

For data collection, the firm extracts 12 months of execution data from the custodian, covering approximately 8,000 equity and ETF trades. For each trade, the data includes the security, order type (market or limit), order size, execution price, NBBO at time of order entry, execution venue (the custodian's internal desk, affiliated wholesaler, or exchange), and timestamp. The firm supplements this with the custodian's Rule 605 and Rule 606 reports, which disclose aggregate execution quality statistics and order routing practices including any payment for order flow received.

The quantitative analysis examines several dimensions. Price improvement analysis reveals that 82% of market orders received price improvement relative to the NBBO, with an average improvement of 0.8 cents per share. However, the analysis segments by order size and finds that orders under 500 shares received average improvement of 1.2 cents, while orders over 2,000 shares received only 0.2 cents — a pattern consistent with wholesaler execution, where small retail-sized orders receive meaningful improvement but larger orders do not. Effective spread analysis shows an average effective spread of 1.4 cents per share across all trades, compared to an average quoted spread (NBBO) of 2.1 cents, indicating that the custodian's execution is capturing approximately 67% of the quoted spread. Speed of execution averages 35 milliseconds for market orders, which is acceptable for advisory workflows. Fill rate on limit orders is 71%, which the compliance officer benchmarks against industry data (typically 65-80% depending on limit order aggressiveness).

The qualitative assessment considers factors beyond raw execution metrics. The custodian provides commission-free trading, which eliminates explicit transaction costs — a significant benefit for an advisory firm executing thousands of trades annually. The custodian also provides research, custody, reporting, and technology services that the RIA relies on for daily operations. Under Section 28(e) of the Securities Exchange Act and the SEC's fiduciary interpretation, the RIA may consider these qualitative benefits when evaluating best execution, provided that the total value received justifies any incremental execution costs relative to alternatives.

Analysis:

The compliance officer identifies two concerns. First, the declining price improvement for larger orders suggests that the custodian's routing arrangements may not be optimal for the firm's institutional-sized trades. The firm should consider whether the custodian offers alternative routing options — such as direct exchange access or algorithmic execution — for orders above a specified size threshold. Second, the firm has relied on a single custodian without comparing execution quality against alternatives. While there is no regulatory requirement to use multiple custodians, the best execution obligation requires the firm to have a reasonable basis for concluding that the current arrangement delivers favorable results. The compliance officer recommends conducting a competitive execution quality comparison — either by requesting execution quality data from alternative custodians or by engaging a third-party TCA provider to benchmark the firm's execution against industry standards.

The review is documented in a written report presented to the firm's best execution committee. The report concludes that the custodian's execution quality is generally acceptable for small to mid-size orders but may be suboptimal for larger orders. The committee approves two action items: (1) request that the custodian provide execution algorithm access for orders exceeding 1,000 shares, and (2) engage a TCA vendor to conduct an independent benchmarking study within the next quarter. These findings and actions are recorded in the committee minutes and retained as part of the firm's books and records under SEC Rule 204-2.

The compliance officer also reviews the custodian's Rule 606 report to understand routing practices, noting that 65% of the custodian's equity order flow is routed to two affiliated wholesalers under PFOF arrangements. The compliance officer documents this finding and notes that while PFOF does not automatically indicate poor execution quality, it creates a potential conflict of interest that the firm must monitor. The firm adds a standing agenda item to its quarterly best execution committee meetings: review of the custodian's order routing disclosures and any changes in PFOF arrangements. This ongoing monitoring fulfills the SEC's expectation that RIAs exercise continuous oversight of their execution arrangements, not merely conduct a one-time annual review.

Example 2: Designing a Smart Order Routing Strategy for a Broker-Dealer with Multiple Venue Connections

Scenario: A broker-dealer with direct connections to eight exchanges, three dark pools, and two wholesalers is redesigning its smart order routing logic. The firm handles a mix of retail and institutional order flow. The current SOR uses a static routing table based solely on displayed price, which has resulted in suboptimal fill rates on limit orders and excessive exchange fee costs. The firm wants a routing strategy that optimizes across price, fill probability, and net execution cost while maintaining Rule 611 compliance.

Design Considerations:

The SOR redesign begins with defining routing objectives by order category. The firm segments its order flow into three categories with distinct optimization targets:

For retail market orders (orders under 500 shares at market), the primary objective is price improvement. The SOR should route these orders to wholesalers who commit to price improvement guarantees. The firm negotiates tiered price improvement commitments with its two wholesalers: Wholesaler A guarantees a minimum of 0.5 cents per share improvement with an average target of 1.0 cent; Wholesaler B guarantees 0.3 cents minimum with an average target of 0.8 cents. The SOR routes retail market orders to Wholesaler A as the primary destination, with Wholesaler B as the backup if Wholesaler A's response time exceeds 50 milliseconds. All wholesaler executions are monitored monthly against the guaranteed minimums.

For institutional and larger orders (orders above 500 shares or flagged as institutional), the primary objectives are minimizing market impact and achieving high fill rates. The SOR implements a multi-phase routing approach. Phase 1: the SOR probes dark pools by sending small "child" orders (10-20% of the total quantity) to the three connected dark pools simultaneously, seeking midpoint or better crosses. Phase 2: for any unfilled quantity after 500 milliseconds, the SOR routes to the lit exchange with the best displayed price, using intermarket sweep orders (ISOs) to simultaneously access all protected quotations. Phase 3: any remaining quantity is posted as a displayed or reserve limit order at the best available price on the exchange with the highest historical fill rate for the security.

For limit orders, the primary objective is maximizing fill probability while minimizing exchange fees. The SOR analyzes historical fill rates by venue for each security and routes limit orders to the venue with the highest fill probability at the specified price level. For securities where the displayed depth at the limit price is thin across all venues, the SOR splits the order across multiple venues to increase the probability of catching a crossing order. Fee optimization is incorporated: for maker-taker exchanges, limit orders earn rebates; for inverted (taker-maker) exchanges, limit orders pay fees. The SOR preferentially routes passive limit orders to maker-taker venues to earn rebates, shifting net cost from positive to negative.

Rule 611 compliance is embedded in all routing logic. Before any routing decision, the SOR checks the current NBBO across all protected quotations. If the order would result in a trade-through (execution at a price inferior to a protected quote), the SOR either routes to the protecting venue or uses an ISO to sweep all protected quotations. The SOR maintains a real-time map of each exchange's operational status; if an exchange declares a self-help situation (experiencing a systems issue that prevents it from providing timely responses), the SOR removes that exchange's quotations from the protected quote calculation for the duration of the self-help event.

Analysis:

The firm implements the redesigned SOR and monitors performance over three months. The results show: retail market order price improvement increased from 0.6 cents to 1.1 cents per share (driven by the wholesaler guarantees); institutional order fill rates improved from 68% to 79% (driven by the dark pool probing phase); limit order fill rates improved from 61% to 72% (driven by venue-specific fill rate analysis); and net exchange fee costs decreased by 18% (driven by preferential routing of limit orders to maker-taker venues). The firm's compliance team validates that no Rule 611 violations occurred during the monitoring period by cross-referencing execution data against NBBO records.

The routing table is reviewed monthly by the trading desk and quarterly by the best execution committee. Venue performance metrics that trigger routing table changes include: a drop in fill rate of more than 5 percentage points over a rolling 30-day period, a sustained decline in price improvement below the negotiated minimum, an increase in exchange outages or message processing errors, or a change in the venue's fee schedule. All routing table changes are documented with the rationale and approved by the head of trading.

The firm also implements anti-gaming logic in the SOR to detect and respond to adverse selection. If the SOR detects that a dark pool consistently fills orders just before an adverse price move (indicating that the dark pool may be leaking information or that toxic flow is present), the SOR automatically reduces the priority of that venue and alerts the trading desk for investigation. Anti-gaming detection typically monitors the "mark-out" — the price movement in the seconds and minutes after a dark pool fill. A consistently negative mark-out indicates that the fills are being adversely selected, and the venue should be deprioritized or removed from the routing table.

For Rule 606 compliance, the firm publishes quarterly reports disclosing its order routing arrangements, including the identity of each venue receiving non-directed orders, the percentage of order flow routed to each venue, any payment for order flow received, and any material aspects of the relationship between the firm and each venue. The 2020 amendments to Rule 606 also require the firm to provide institutional customers with order-level routing and execution data upon request (Rule 606(b)(3)), enabling those customers to independently evaluate the firm's execution quality.

Example 3: Building a TCA Framework for Quarterly Best Execution Committee Review

Scenario: An institutional asset manager executing $2 billion in equity trades per quarter across multiple strategies (fundamental long/short, quantitative market-neutral, and index rebalancing) needs to build a TCA framework that provides the best execution committee with actionable analysis. The committee has requested a framework that distinguishes between controllable and uncontrollable costs, attributes costs to specific causes, and identifies concrete improvement opportunities.

Design Considerations:

The TCA framework is structured in three tiers: trade-level measurement, strategy-level aggregation, and committee-level reporting.

At the trade-level measurement tier, every execution is measured against multiple benchmarks. For fundamental long/short trades, the primary benchmark is arrival price (midpoint of NBBO at order submission), because the portfolio manager's alpha is captured relative to the decision point. For quantitative strategy trades, the benchmark is also arrival price, but with an additional comparison to the pre-trade cost estimate generated by the firm's market impact model. For index rebalancing trades, the primary benchmark is closing price, because the rebalancing mandate requires tracking the closing-price index. Implementation shortfall is decomposed for each trade into delay cost, market impact cost, timing cost, and opportunity cost as defined above. The decomposition requires three price points: the decision price (when the portfolio manager signals the trade), the submission price (when the order enters the market), and the execution price.

At the strategy-level aggregation tier, trade-level costs are aggregated by strategy, security type, order size bucket, algorithm used, and execution venue. The aggregation reveals patterns that are not visible at the individual trade level. For example, aggregating by algorithm shows that the firm's VWAP algorithm achieves an average cost of 3.2 basis points for orders under 5% of ADV but 8.7 basis points for orders between 5% and 15% of ADV — suggesting that VWAP may not be the appropriate algorithm for larger orders, where an implementation shortfall algorithm (which trades more aggressively early) might reduce timing risk. Aggregating by venue reveals that dark pool A provides better midpoint crosses for large-cap stocks (average improvement of 0.4 basis points) while dark pool B performs better for mid-cap stocks (average improvement of 0.7 basis points) — informing venue-specific routing preferences.

The pre-trade cost model is calibrated quarterly by comparing predicted costs to actual costs. If the model consistently underpredicts costs for a particular security type or order size, the model parameters (market impact coefficients, volatility inputs) are adjusted. Model accuracy is reported to the committee as a percentage of trades where actual cost fell within the model's 80% confidence interval.

At the committee-level reporting tier, the quarterly TCA report presents: (1) an executive summary showing total implementation shortfall in basis points and dollars, broken down by controllable costs (market impact, venue selection) and uncontrollable costs (market drift, opportunity cost from unfilled orders); (2) strategy-level cost summaries with trends over the prior four quarters; (3) algorithm performance comparison — a table showing each algorithm's average cost by order size bucket, with a recommendation for any algorithm-selection changes; (4) venue performance scorecard — each venue rated on fill rate, price improvement, effective spread, and speed, with a flag for any venue that has deteriorated since the prior quarter; (5) outlier analysis — the top 10 highest-cost trades of the quarter, with a root-cause narrative for each (e.g., "Trade X in ABC Corp cost 22 bps due to an unexpected earnings pre-announcement during execution; market impact model did not account for event risk"); and (6) action items — specific, measurable recommendations such as "Switch orders exceeding 10% ADV from VWAP to IS algorithm" or "Add Dark Pool C to the routing table for mid-cap names based on benchmarking data."

Analysis:

The committee reviews the report and evaluates whether the firm's execution costs are reasonable relative to the alpha generated by each strategy. For the fundamental long/short strategy, average implementation shortfall of 12 basis points per round-trip trade is compared to the strategy's gross alpha of 180 basis points annually — execution costs consume approximately 6.7% of gross alpha (assuming annual turnover of 100%), which is within the acceptable range but warrants monitoring. For the quantitative strategy with 400% annual turnover, average implementation shortfall of 5 basis points per trade translates to 20 basis points of annual execution cost drag, which is material for a strategy targeting 300 basis points of gross alpha.

The committee approves three actions from the report: (1) transition orders exceeding 10% of ADV from VWAP to implementation shortfall algorithm, effective next quarter; (2) add a third dark pool to the routing configuration for mid-cap securities, with a 90-day trial period and performance review; and (3) engage the pre-trade cost model vendor to recalibrate impact coefficients for small-cap securities, where the model has underpredicted costs by an average of 40% over the past two quarters. All actions are documented in the committee minutes with assigned owners and deadlines. The compliance officer certifies that the review was conducted in accordance with the firm's best execution policy and that the documentation satisfies the requirements of FINRA Rule 5310 and the SEC's fiduciary interpretation.

The committee also reviews the pre-trade cost model's accuracy across all security types. The model uses a square-root impact formula: estimated impact (bps) = sigma_daily * k * sqrt(order_size / ADV), where sigma_daily is the security's daily volatility, k is an empirically fitted coefficient, and ADV is the 20-day average daily volume. For large-cap equities, the model's predictions fall within the 80% confidence interval for 76% of trades — acceptable accuracy. For small-cap equities (market cap below $2 billion), accuracy drops to 54%, indicating that the impact coefficient k is too low for the small-cap universe. The committee directs the quantitative research team to segment the model by market cap and estimate separate k coefficients for large-cap, mid-cap, and small-cap securities.

The quarterly report also includes a year-over-year trend analysis showing that total execution costs (measured as implementation shortfall in basis points) have declined from 9.2 bps to 7.4 bps over the prior four quarters. This improvement is attributed to three factors: the introduction of dark pool routing for mid-cap securities (reducing market impact by accessing hidden liquidity), optimization of algorithm parameters based on prior quarter TCA feedback, and a reduction in delay cost achieved by shortening the time between portfolio manager decision and order submission through workflow automation. The trend data demonstrates that the TCA framework is driving measurable improvements in execution quality — a finding that the compliance officer highlights as evidence of the firm's commitment to best execution.

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a comprehensive reference guide and educational resource focusing on financial trade execution compliance, transaction cost analysis (TCA), and market microstructure. It consists entirely of informational documentation and contains no executable code or security risks.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at cf3e6ba. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago

README badge

README badge for joellewis/finance_skills/trade-execution