# MARKET_PRICE_THRESHOLDS

> MARKET_PRICE_THRESHOLDS sets out the market cap , floor and administered price thresholds applying to the electricity market

> MARKET_PRICE_THRESHOLDS data is public, so is available to all
> participants.
> 
> Source
> 
> MARKET_PRICE_THRESHOLDS only changes when a change is made to a market
> price threshold. This table changes infrequently.

## Column Schema

### EFFECTIVEDATE

> Calendar date that this record becomes effective

SQL Type: `DATE`
Polars Type: `pl.Date()`

This column is mandatory, and a primary key.

Example: `1997/11/04 00:00:00`

Note that AEMO represents dates as datetimes with a midnight time component.

### VERSIONNO

> version no for the effective date

SQL Type: `NUMBER(4,0)`
Polars Type: `pl.UInt16`

This column is mandatory, and a primary key.

Example: `1`

### ADMINISTERED_PRICE_THRESHOLD

> Threshold value beyond which Aggregate Prices per Region over 336 Trade Intervals (Energy), or 2016 Dispatch Intervals (FCAS), will result in an Administered Price declaration

SQL Type: `NUMBER(15,5)`
Polars Type: `pl.Float64`

This column is not mandatory.

Examples:
`150000`, `2225900`

### AUTHORISEDBY

> user authorising

SQL Type: `VARCHAR2(15)`
Polars Type: `str`

This column is not mandatory.

Examples:

- `LUKEB`
- `NORRIS`
- `PSS`
- `TOM`

### AUTHORISEDDATE

> date data authorised

!!! danger "Warning"
    Despite what the name suggests, this is a datetime, not a date.

SQL Type: `DATE`
Polars Type: `pl.Datetime()`

This column is not mandatory.

Example: `2002/03/25 08:34:36`

### LASTCHANGED

> Last date and time record changed

For more information, see the [dedicated documentation page](../../guide/querying.md#deduplication).

SQL Type: `DATE`
Polars Type: `pl.Datetime()`

This column is not mandatory.

Example: `1998/06/30 22:01:36`

### MARKETPRICEFLOOR

> The floor price that the spot market price will not fall below.

SQL Type: `NUMBER(15,5)`
Polars Type: `pl.Float64`

This column is not mandatory.

Example: `-1000`

### VOLL

> value of lost load if total supply falls short of demand after load management then involuntary load

SQL Type: `NUMBER(15,5)`
Polars Type: `pl.Float64`

This column is not mandatory.

Examples:
`5000`, `23200`

## New Data Timing

> When there is a market price threshold change

## Code Examples

### Polars

Explicitly listing every column, casting to enums, categoricals etc is not essential, but may speed up parsing.
Swapping `int` for `pl.UInt16`, `pl.Int32` would also speed up parsing. However some of the datatypes are inferred, so they may be wrong.

This code deduplicates for you.
Deduplication is normally only required across multiple months.

This code assumes that all columns are present, which may not be true for older files.

```python
import polars as pl
import polars.selectors as cs

# e.g. "2029/03/15 00:05:00"
dt_s_fmt = "%Y/%m/%d %H:%M:%S"

# Dates are represented as datetimes at midnight

d_fmt = "%Y/%m/%d 00:00:00"

csv_paths = ["SOMEFILE.CSV", "OTHERFILE.CSV"]

lf = (
    pl.concat(
        [
            pl.scan_csv(
                csv_path,  # must be unzipped beforehand
                skip_rows=1,  # skip the header
                infer_schema=False,  # much faster
            )
            .filter(cs.by_index(0) == "D")  # drop the footer
            .select(~cs.by_index(range(4)))  # drop metadata columns
            for csv_path in csv_paths
        ],
        how="diagonal_relaxed",
    )
    .with_columns(
        pl.col("AUTHORISEDDATE", "LASTCHANGED").str.strptime(pl.Datetime, dt_s_fmt),
        pl.col("EFFECTIVEDATE").str.strptime(pl.Date, d_fmt),
    )
    .cast(
        {
            "EFFECTIVEDATE": pl.Date(),
            "VERSIONNO": int,  # or pl.UInt16
            "ADMINISTERED_PRICE_THRESHOLD": pl.Float64,
            "AUTHORISEDBY": str,
            "MARKETPRICEFLOOR": pl.Float64,
            "VOLL": pl.Float64,
        }
    )
    # Deduplicate
    # We want one row per ['EFFECTIVEDATE', 'VERSIONNO']
    # Tie-breaker: greatest value of ['LASTCHANGED']
    .sort(["LASTCHANGED"], descending=False)
    .unique(subset=["EFFECTIVEDATE", "VERSIONNO"], keep="last")
)

```

### Nemosis

```py
from nemosis import dynamic_data_compiler

df = dynamic_data_compiler(
    '2024/01/01 00:00:00',
    '2024/01/31 00:00:00',
    "MARKET_PRICE_THRESHOLDS",
    "data/"
)
```

Nemosis only includes [a subset of columns](https://github.com/UNSW-CEEM/NEMOSIS/#accessing-additional-table-columns) by default, as an optimisation. (i.e. the commonly used columns.)
To include others:

```py
from nemosis import defaults

defaults.table_columns["MARKET_PRICE_THRESHOLDS"] += ["ADMINISTERED_PRICE_THRESHOLD", "AUTHORISEDBY", "AUTHORISEDDATE", "LASTCHANGED"]
df = dynamic_data_compiler(...)
```

## Example File

From [PUBLIC_ARCHIVE_MARKET_PRICE_THRESHOLDS_FILE01_202609010000.zip](https://www.nemweb.com.au/Data_Archive/Wholesale_Electricity/MMSDM/2026/MMSDM_2026_09/MMSDM_Historical_Data_SQLLoader/DATA/PUBLIC_ARCHIVE%23MARKET_PRICE_THRESHOLDS%23FILE01%23202609010000.zip)

=== "Raw Text with Metadata"
    ```csv
    C,SETP.WORLD,DVD_MARKET_PRICE_THRESHOLDS,AEMO,PUBLIC,2026/10/09,15:53:06,001791525186987,MONTHLY_ARCHIVE,001791525186987
    I,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,EFFECTIVEDATE,VERSIONNO,VOLL,MARKETPRICEFLOOR,ADMINISTERED_PRICE_THRESHOLD,AUTHORISEDDATE,AUTHORISEDBY,LASTCHANGED
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"1997/11/04 00:00:00",1,5000,-1000,,"1997/11/04 00:00:00",NORRIS,"1998/06/30 22:01:36"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2002/04/01 00:00:00",1,10000,-1000,150000,"2002/03/25 08:34:36",LUKEB,"2002/03/25 08:34:36"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2010/07/01 00:00:00",1,12500,-1000,187500,"2010/07/01 13:20:00",TOM,"2010/07/01 13:20:00"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2012/07/01 00:00:00",1,12900,-1000,193900,"2012/06/13 12:42:48",TOM,"2012/06/13 12:42:48"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2013/07/01 00:00:00",1,13100,-1000,197100,"2013/06/21 11:30:30",TOM,"2013/06/21 11:30:30"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2014/07/01 00:00:00",1,13500,-1000,201900,"2014/06/24 15:27:32",TOM,"2014/06/24 15:27:32"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2015/07/01 00:00:00",1,13800,-1000,207000,"2015/06/24 12:08:35",TOM,"2015/06/24 12:08:35"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2016/07/01 00:00:00",1,14000,-1000,210100,"2016/06/24 12:27:01",TOM,"2016/06/24 12:27:01"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2017/07/01 00:00:00",1,14200,-1000,212800,"2017/06/23 14:51:09",TOM,"2017/06/23 14:51:09"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2018/07/01 00:00:00",1,14500,-1000,216900,"2018/06/22 11:57:52",TOM,"2018/06/22 11:57:52"
    D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,"2019/07/01 00:00:00",1,14700,-1000,221100,"2019/06/24 11:48:36",TOM,"2019/06/24 11:48:36"
    ...
    C,"END OF REPORT",22
    ```

## Availability

Visibility: Public

This table is in the public monthly [MMSDM archive](https://www.nemweb.com.au/Data_Archive/Wholesale_Electricity/MMSDM/).

I have collated the list of all those files into one place, in [this CSV metadata file](../../manifests/per_table/csv/MARKET_PRICE_THRESHOLDS.csv). (Columns `year`, `month`, `url`, `compressed_size` in bytes).

The earliest available data is month 1 of 2015.
The most recent available data is month 9 of 2026.

 Every month in between has a file. (No gaps.)

## Data Size

Each year of data is approximately
11 KB when zipped,
110 KB as unzipped CSV.

## Deduplication and PDR Loader Configuration

The primary keys are:

- [`EFFECTIVEDATE`](#effectivedate)

- [`VERSIONNO`](#versionno)

The transaction type is ["insert"](https://di-help.docs.public.aemo.com.au/Content/pdrLoader/How_it_works.htm?TocPath=pdrLoader%7CAbout+pdrLoader%7C_____5#INSERT), which means that you will usually not see duplicate data.
If you do, you can deduplicate based on the primary keys, without sorting first.
Rows from different files with the same primary keys should have the same values.

[PDR Loader configuration](https://nemweb.com.au/Reports/Current/MMSDataModelReport/PDRCONFIG/PROD_PUBLIC_PDR_CONFIG_FULL.zip) is:

| Report Name | Report Subtype | Version |
|---------------|-------------------|-----------|
| MARKET_CONFIG | MARKET_PRICE_THRESHOLDS  | 1 |

This means that the CSV files start with metadata columns:

```csv
I,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,...
D,MARKET_CONFIG,MARKET_PRICE_THRESHOLDS,1,...
```

## Indexes

- [`LASTCHANGED`](#lastchanged)

## Links

[This page as JSON](../json/tables/MARKET_PRICE_THRESHOLDS/bespoke.json) (schema documented [here](https://gitlab.com/MatthewDavis/mms-schema/-/blob/master/schema.py?ref_type=heads), but may change)

Download a [JSON Schema](../json/tables/MARKET_PRICE_THRESHOLDS/json-schema.json) specification for this table.

[Official AEMO schema documentation](https://nemweb.com.au/Reports/Current/MMSDataModelReport/Electricity/ElectricityDataModelReport_files/Elec33.htm#91)

## Other Information

Package: [MARKET_CONFIG](../packages/MARKET_CONFIG.md)
