Skip to content

blockTrade · Block Trades

sdk.blockTrade exposes A-share block-trade (大宗交易) data: a daily market overview, trade-level details, and per-stock daily aggregates.

ts
import { StockSDK } from 'stock-sdk'

const sdk = new StockSDK()
const stat = await sdk.blockTrade.marketStat()

Methods

MethodDescription
blockTrade.marketStat()Daily market-wide block-trade overview
blockTrade.detail(options?)Trade-level block-trade records over a date range
blockTrade.dailyStat(options?)Per-stock daily block-trade aggregates

All amount fields are in CNY. Items with a date follow the unified data contract and carry date / timestamp (number | null) / tz. Exact fields follow the implementation.

Block trades are post-close data

Block trades are compiled and published after the close, so querying today's date intraday returns nothing for today and the latest marketStat entry is usually the previous trading day. That is the source's normal timing, not a call failure.

blockTrade.marketStat

Daily market-wide block-trade overview, showing daily volume and the premium / discount structure.

Example

ts
const stat = await sdk.blockTrade.marketStat()

stat.slice(0, 5).forEach(s => {
  console.log(
    `${s.date} total ${s.totalAmount}, premium ${s.premiumRatio}%, discount ${s.discountRatio}%`,
  )
})

Returns

BlockTradeMarketStatItem[]. Representative fields:

FieldDescription
dateTrading day
shCloseShanghai Composite close
shChangePercentShanghai Composite change (percentage)
totalAmountTotal block-trade turnover (CNY)
premiumAmount / premiumRatioPremium turnover (CNY) / share (percentage)
discountAmount / discountRatioDiscount turnover (CNY) / share (percentage)

Exact fields follow the implementation.

blockTrade.detail

Trade-level block-trade records over a date range. Each record is a single deal.

Example

ts
const detail = await sdk.blockTrade.detail({
  startDate: '20240101', // YYYYMMDD or YYYY-MM-DD
  endDate: '20240131',
})

// Filter block trades of a single stock
const moutai = detail.filter(d => d.code === '600519')
for (const d of moutai) {
  console.log(`${d.date} price ${d.dealPrice}, premium ${d.premiumRate}%`)
}

Parameters

ParameterTypeDescription
options.startDatestring?Start date, YYYYMMDD or YYYY-MM-DD
options.endDatestring?End date

When omitted, a default range is used per implementation.

Returns

BlockTradeDetailItem[]. Representative fields:

FieldDescription
code / nameStock code / name
dateDeal date
close / changePercentDaily close (CNY) / change (percentage)
dealPriceBlock-trade price (CNY)
dealVolumeVolume (shares)
dealAmountTurnover (CNY)
premiumRatePremium rate (percentage; negative means discount)
buyBranch / sellBranchBuy- / sell-side brokerage branch

Exact fields follow the implementation.

blockTrade.dailyStat

Per-stock daily aggregates that roll up multiple deals of the same stock on the same day into one record.

Example

ts
const daily = await sdk.blockTrade.dailyStat({
  startDate: '20240101',
  endDate: '20240131',
})

// Stocks with the largest block-trade turnover that month
const top = [...daily]
  .sort((a, b) => (b.dealTotalAmount ?? 0) - (a.dealTotalAmount ?? 0))
  .slice(0, 10)

top.forEach(d => console.log(`${d.name}(${d.code}) total ${d.dealTotalAmount}`))

Parameters

Same as blockTrade.detail: optional startDate / endDate.

Returns

BlockTradeDailyStatItem[]. Representative fields:

FieldDescription
code / nameStock code / name
dateStat date
close / changePercentClose (CNY) / change (percentage)
dealCountNumber of deals
dealTotalAmountTotal turnover (CNY)
dealTotalVolumeTotal volume (shares)
premiumAmount / discountAmountPremium / discount turnover (CNY)

Exact fields follow the implementation.