# BIDTYPES

> BIDTYPES, together with the associated tracking data in [`BIDTYPESTRK`](./BIDTYPESTRK.md), define a set of ancillary services with bidding parameters from a given date.
> BIDTYPES is static data describing each type of bid quantity, the number of applicable bands, how many days ahead a price lock down becomes effective and the validation rule that applies.

> BIDTYPES is public to participants
> 
> Source
> 
> BIDTYPES updates when the static data relating to an ancillary service
> type is modified.
> 
> Volume
> 
> Expect modifications to be rare. Allow for approximately 20 records per
> year.

## Column Schema

### BIDTYPE

> Bid Type Identifier

The SQL type is `VARCHAR2(10)`.
This is actually a factor/enum, with values:

- `ENERGY`

- `LOWERREG`

- `LOWER60SEC`

- `RAISE5MIN`

- `LOWER5MIN`

- `LOWER6SEC`

- `RAISE60SEC`

- `RAISE6SEC`

- `RAISEREG`

- `RAISE1SEC`

- `LOWER1SEC`

This column is mandatory, and a primary key.

### EFFECTIVEDATE

> Market date starting at 04:30 inclusive

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

This column is mandatory, and a primary key.

Example: `2000/09/12 00:00:00`

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

### VERSIONNO

> Record version number

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

This column is mandatory, and a primary key.

Example: `1`

### DESCRIPTION

> Description of this Bid Type

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

This column is not mandatory.

Examples:

- `1 Second Lower Large Deviation FCAS`
- `1 Second Raise Large Deviation FCAS`
- `5 Minute Lower Large Deviation FCAS`
- `5 Minute Raise Large Deviation FCAS`
- `6 Second Lower Large Deviation FCAS`
- `6 Second Raise Large Deviation FCAS`
- `60 Second Lower Large Deviation FCAS`
- `60 Second Raise Large Deviation FCAS`
- `Energy to supply system demand`
- `Lower Regulation Small Deviation FCAS`

### 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: `2001/09/13 16:33:22`

### NUMBEROFBANDS

> Number of active bands (1 to 10)

SQL Type: `NUMBER(3,0)`
Polars Type: `pl.Int16`

This column is not mandatory.

Example: `10`

### NUMDAYSAHEADPRICELOCKED

> Number of days prior to the Market Day when prices are locked from 12:30pm

SQL Type: `NUMBER(2,0)`
Polars Type: `pl.Int8`

This column is not mandatory.

Example: `1`

### SPDALIAS

> Alias for this BIDTYPE used in the SPD Solver

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

This column is not mandatory.

Examples:

- `ENOF`
- `L1SE`
- `L5MI`
- `L5RE`
- `L60S`
- `L6SE`
- `R1SE`
- `R5MI`
- `R5RE`
- `R60S`

### VALIDATIONRULE

> ENERGY or AS validation rules to apply.

The SQL type is `VARCHAR2(10)`.
This is actually a factor/enum, with values:

- `ENERGY`

- `AS`

This column is not mandatory.

## New Data Timing

> When the ancillary service type static data is modified

## 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("LASTCHANGED").str.strptime(pl.Datetime, dt_s_fmt),
        pl.col("EFFECTIVEDATE").str.strptime(pl.Date, d_fmt),
    )
    .cast(
        {
            "BIDTYPE": pl.Enum(
                [
                    "ENERGY",
                    "LOWERREG",
                    "LOWER60SEC",
                    "RAISE5MIN",
                    "LOWER5MIN",
                    "LOWER6SEC",
                    "RAISE60SEC",
                    "RAISE6SEC",
                    "RAISEREG",
                    "RAISE1SEC",
                    "LOWER1SEC",
                ]
            ),
            "EFFECTIVEDATE": pl.Date(),
            "VERSIONNO": int,  # or pl.UInt16
            "DESCRIPTION": str,
            "NUMBEROFBANDS": int,  # or pl.Int16
            "NUMDAYSAHEADPRICELOCKED": int,  # or pl.Int8
            "SPDALIAS": str,
            "VALIDATIONRULE": pl.Enum(["ENERGY", "AS"]),
        }
    )
    # Deduplicate
    # We want one row per ['BIDTYPE', 'EFFECTIVEDATE', 'VERSIONNO']
    # Tie-breaker: greatest value of ['LASTCHANGED']
    .sort(["LASTCHANGED"], descending=False)
    .unique(subset=["BIDTYPE", "EFFECTIVEDATE", "VERSIONNO"], keep="last")
)

```

### Nemosis

This table is not yet available in [Nemosis](https://github.com/UNSW-CEEM/NEMOSIS/#static_table).

## Example File

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

=== "Raw Text with Metadata"
    ```csv
    C,SETP.WORLD,DVD_BIDTYPES,AEMO,PUBLIC,2026/10/09,15:24:41,001791523481479,MONTHLY_ARCHIVE,001791523481479
    I,MARKET_CONFIG,BIDTYPES,1,BIDTYPE,EFFECTIVEDATE,VERSIONNO,DESCRIPTION,NUMBEROFBANDS,NUMDAYSAHEADPRICELOCKED,VALIDATIONRULE,LASTCHANGED,SPDALIAS
    D,MARKET_CONFIG,BIDTYPES,1,ENERGY,"2000/09/12 00:00:00",1,"Energy to supply system demand",10,1,ENERGY,"2001/09/13 16:33:22",ENOF
    D,MARKET_CONFIG,BIDTYPES,1,RAISE6SEC,"2000/09/12 00:00:00",1,"6 Second Raise Large Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",R6SE
    D,MARKET_CONFIG,BIDTYPES,1,RAISE60SEC,"2000/09/12 00:00:00",1,"60 Second Raise Large Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",R60S
    D,MARKET_CONFIG,BIDTYPES,1,RAISE5MIN,"2000/09/12 00:00:00",1,"5 Minute Raise Large Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",R5MI
    D,MARKET_CONFIG,BIDTYPES,1,RAISEREG,"2000/09/12 00:00:00",1,"Raise Regulation Small Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",R5RE
    D,MARKET_CONFIG,BIDTYPES,1,LOWER5MIN,"2000/09/12 00:00:00",1,"5 Minute Lower Large Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",L5MI
    D,MARKET_CONFIG,BIDTYPES,1,LOWER6SEC,"2000/09/12 00:00:00",1,"6 Second Lower Large Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",L6SE
    D,MARKET_CONFIG,BIDTYPES,1,LOWER60SEC,"2000/09/12 00:00:00",1,"60 Second Lower Large Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",L60S
    D,MARKET_CONFIG,BIDTYPES,1,LOWERREG,"2000/09/12 00:00:00",1,"Lower Regulation Small Deviation FCAS",10,1,AS,"2001/09/13 16:33:22",L5RE
    D,MARKET_CONFIG,BIDTYPES,1,ENERGY,"2023/08/14 00:00:00",1,"Energy to supply system demand",10,1,ENERGY,"2023/08/14 11:52:34",ENOF
    D,MARKET_CONFIG,BIDTYPES,1,RAISE6SEC,"2023/08/14 00:00:00",1,"6 Second Raise Large Deviation FCAS",10,1,AS,"2023/08/14 11:52:34",R6SE
    ...
    C,"END OF REPORT",23
    ```

## 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/BIDTYPES.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
9 KB when zipped,
91 KB as unzipped CSV.

## Deduplication and PDR Loader Configuration

The primary keys are:

- [`BIDTYPE`](#bidtype)

- [`EFFECTIVEDATE`](#effectivedate)

- [`VERSIONNO`](#versionno)

!!! tip tip
    Bid deduplication is particularly tricky.
    See [the guide](../../guide/querying.md#bids).

The transaction type is ["INSERT-UPDATE"](https://di-help.docs.public.aemo.com.au/Content/pdrLoader/How_it_works.htm?TocPath=pdrLoader%7CAbout+pdrLoader%7C_____5#UPDATEINSERT), which means that you will likely see duplicate data with different values.

You should deduplicate by sorting based on `LASTCHANGED`, within each group of primary keys.

[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 | BIDTYPES  | 1 |

This means that the CSV files start with metadata columns:

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

`ROW_FILTER_TYPE` is LASTCHANGED

## Indexes

- [`LASTCHANGED`](#lastchanged)

## Links

[This page as JSON](../json/tables/BIDTYPES/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/BIDTYPES/json-schema.json) specification for this table.

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

## Other Information

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