# ListContractHistory

PATH: /aurora.core.apiengine.contractsv1.ContractService/ListContractHistory

  ListContractHistory provides a way to query contract events
This can be used to get the full history of everything that has happened to a contract
or for example to get all the returns that happened on a specific date or for a specific instrument

Endpoint: POST /aurora.core.apiengine.contractsv1.ContractService/ListContractHistory
Version: v1.23.0
Security: Bearer

## Request fields (application/json):

  - `filter` (object)
    ListContractHistoryFilter specifies the filters applied to the returned events
Multiple filters can be set and are combined to create a subsetFields: event_types, event_time_start, event_time_end, instruments, counterparties, contracts, side, initiator_kind, initiator_id, open_quantity, contract_value, open_quantity_change, settlement_types, rate, rate_amount, ticker, unit_price, contract_value_adjustment, settlement_date_start, settlement_date_end, market_value, cusip

  - `filter.contract_value` (object)
    Fields: type, filter, filter_to

  - `filter.contract_value.filter` (string, required)

  - `filter.contract_value.filter_to` (string)

  - `filter.contract_value.type` (string, required)

  - `filter.contract_value_adjustment` (object)
    Fields: type, filter, filter_to

  - `filter.contract_value_adjustment.filter` (string, required)

  - `filter.contract_value_adjustment.filter_to` (string)

  - `filter.contract_value_adjustment.type` (string, required)

  - `filter.contracts` (array)
    Filter to get a subset of events for the specified contracts
All contracts are included when not specified

  - `filter.counterparties` (array)
    Filter to get a subset of events only for contracts with the specified counterparties
All counterparties are included when not specified

  - `filter.cusip` (string)
    Filter to get a subset of events for contracts with the specified CUSIP

  - `filter.event_time_end` (string)
    Timestamp to get all events before the specified time - in RFC3339 with millisecond precision

  - `filter.event_time_start` (string)
    Timestamp to get all events since the specified time - in RFC3339 with millisecond precision

  - `filter.event_types` (array)
    Filter to get a subset of event types
All event types are included when not specified
    Enum: "CREATED", "PENDING", "CANCEL_PENDING", "DO_PENDING", "MADE", "DROPPED", "REJECTED", "CANCEL_REJECTED", "CANCELLED", "RECALLED", "RECALL_REJECTED", "RECALL_CANCELED", "ROLLED", "ROLL_PENDING", "ROLL_PD_PENDING", "ROLL_PD_MADE", "RETURNED", "RETURN_PENDING", "PARTIALLY_RETURNED", "RETURN_CANCELED", "RETURN_FAILED", "RETURN_REJECTED", "TERMINATED", "BUY_IN", "BUY_IN_PENDING", "BUY_IN_CANCELLED", "BUY_IN_REJECTED", "BUY_IN_PO_MADE", "BUY_IN_PO_FAILED", "RENEGOTIATED", "RENEGOTIATION_CANCELED", "RENEGOTIATION_REJECTED", "RENEGOTIATION_EXPIRED", "CORPORATE_ACTION", "MARKED_TO_MARKET", "MARK_TO_MARKET_PO_FAILED", "MARK_TO_MARKET_PO_MADE", "DAILY_INTEREST_AMOUNT", "DAILY_INTEREST_PO_FAILED", "DAILY_INTEREST_PO_MADE", "FLOATING_RATE_RECALCULATED", "RETURN_PROPOSED", "RETURN_PROPOSAL_ACCEPTED", "RETURN_PROPOSAL_REJECTED", "RETURN_PROPOSAL_CANCELED", "RETURN_PROPOSAL_DROPPED", "RETURN_CANCEL_REJECTED"

  - `filter.initiator_id` (string)
    Filter to get a subset of events which were initiated by a specific actor
All initiators are included when not specified

  - `filter.initiator_kind` (string)
    Enum: "SYSTEM", "BOT", "TRADER", "CONTRA"

  - `filter.instruments` (array)
    Filter to get a subset of events only for contracts for the specified instruments (ticker or CUSIP)
All instruments are included when not specified

  - `filter.market_value` (object)
    Fields: type, filter, filter_to

  - `filter.market_value.filter` (string, required)

  - `filter.market_value.filter_to` (string)

  - `filter.market_value.type` (string, required)

  - `filter.open_quantity` (object)
    Fields: type, filter, filter_to

  - `filter.open_quantity.filter` (string, required)

  - `filter.open_quantity.filter_to` (string)

  - `filter.open_quantity.type` (string, required)

  - `filter.open_quantity_change` (object)
    Fields: type, filter, filter_to

  - `filter.open_quantity_change.filter` (string, required)

  - `filter.open_quantity_change.filter_to` (string)

  - `filter.open_quantity_change.type` (string, required)

  - `filter.rate` (object)
    Fields: type, filter, filter_to

  - `filter.rate.filter` (string, required)

  - `filter.rate.filter_to` (string)

  - `filter.rate.type` (string, required)

  - `filter.rate_amount` (object)
    Fields: type, filter, filter_to

  - `filter.rate_amount.filter` (string, required)

  - `filter.rate_amount.filter_to` (string)

  - `filter.rate_amount.type` (string, required)

  - `filter.settlement_date_end` (string)

  - `filter.settlement_date_start` (string)
    Filter to get a subset of events for contracts with settlement date in the specified range - YYYY-MM-DD format

  - `filter.settlement_types` (array)
    Filter to get a subset of events for contracts with the specified settlement types
All settlement types are included when not specified
    Enum: "NSCC", "BILATERAL"

  - `filter.side` (string)
    Enum: "BORROW", "LOAN"

  - `filter.ticker` (string)
    Filter to get a subset of events for contracts with the specified ticker

  - `filter.unit_price` (object)
    Fields: type, filter, filter_to

  - `filter.unit_price.filter` (string, required)

  - `filter.unit_price.filter_to` (string)

  - `filter.unit_price.type` (string, required)

  - `page_limit` (integer, required)
    Number of events to fetch per page (max=1000)

  - `page_number` (integer, required)
    Page number to fetch, starting from 1

  - `sorts` (array)
    Sorting options, multiple can be specified

  - `sorts.field` (string, required)
    Enum: "EVENT_TYPE", "EVENT_TIME", "OPEN_QUANTITY", "COUNTERPARTY", "INSTRUMENT_TICKER", "INSTRUMENT_CUSIP", "RATE", "RATE_AMOUNT", "SETTLEMENT_AMOUNT", "SETTLEMENT_TYPE", "SETTLEMENT_AMOUNT_CHANGE", "OPEN_QUANTITY_CHANGE", "INITIATOR", "SIDE", "SETTLEMENT_DATE"

  - `sorts.order` (string, required)
    Enum: "ASC", "DESC"

## Response 200 fields (application/json):

  - `events` (array)
    List of events

  - `events.contract_state` (object, required)
    Fields: id, settlement_type, instrument, side, counterparty_id, total_quantity, open_quantity, unit_price, rate_details, contract_value, interest_due_amount, market_value, market_value_adjustment, contract_value_adjustment, open_quantity_change, settlement_id, settlement_date, collateral_rate, agreement_id, status, rounding_rule, recalled_quantity, returned_quantity, created_at

  - `events.contract_state.agreement_id` (string)
    Id of the agreement associated with this contract

  - `events.contract_state.collateral_rate` (string, required)
    Collateral rate of the contract

  - `events.contract_state.contract_value` (string, required)
    Value of the contract at the time of the event

  - `events.contract_state.contract_value_adjustment` (string, required)
    The change in the value of the contract as effect of the event

  - `events.contract_state.counterparty_id` (string, required)
    Counterparty ID

  - `events.contract_state.created_at` (string, required)
    Time of contract creation - in RFC3339 with millisecond precision

  - `events.contract_state.id` (string, required)
    Contract identifier (persistent identifier inside Aurora system)

  - `events.contract_state.instrument` (object, required)
    Instruments can be identified by their CUSIP or Ticker SymbolFields: cusip, ticker, name

  - `events.contract_state.instrument.cusip` (string, required)
    CUSIP

  - `events.contract_state.instrument.name` (string, required)
    Security name

  - `events.contract_state.instrument.ticker` (string, required)
    Ticker

  - `events.contract_state.interest_due_amount` (string, required)
    Daily interest amount of the contract at the time of the event

  - `events.contract_state.market_value` (string, required)
    Market value of the contract at the time of the event

  - `events.contract_state.market_value_adjustment` (string, required)
    The change in the Market value of the contract as effect of the event

  - `events.contract_state.open_quantity` (string, required)
    Open quantity of the contract at the time of the event

  - `events.contract_state.open_quantity_change` (string, required)
    The change in the open quantity of the contract as effect of the event

  - `events.contract_state.rate_details` (object, required)
    Fields: rate, benchmark

  - `events.contract_state.rate_details.benchmark` (string)
    possible rate benchmarks
    Enum: "OBFR", "EFFR", "SOFR", "BGCR", "TGCR", "IORB"

  - `events.contract_state.rate_details.rate` (string, required)

  - `events.contract_state.recalled_quantity` (string, required)
    Total quantity currently recalled

  - `events.contract_state.returned_quantity` (string, required)
    Total quantity that has been returned

  - `events.contract_state.rounding_rule` (string, required)
    Enum: "NO_ROUNDING", "UP_TO_NEAREST_0_DOT_01", "UP_TO_NEAREST_0_DOT_05", "UP_TO_NEAREST_0_DOT_10", "UP_TO_NEAREST_0_DOT_25", "UP_TO_NEAREST_1_DOT_0"

  - `events.contract_state.settlement_date` (string, required)
    Settlement date of SFT (if exists)

  - `events.contract_state.settlement_id` (string, required)
    Settlement Type specific identifier
ie. DTCC reference id for SFT

  - `events.contract_state.settlement_type` (string, required)
    Enum: "NSCC", "BILATERAL"

  - `events.contract_state.side` (string, required)
    Enum: "BORROW", "LOAN"

  - `events.contract_state.status` (string, required)
    possible states in the lifecycle of a contract
    Enum: "NEW", "PENDING", "REJECTED", "DROPPED", "CANCELED", "OPEN", "CLOSED", "TERMINATED", "UNDER_CORP_ACTION", "ROLL_PENDING", "CANCEL_ROLL_PENDING", "CANCEL_RETURN_PENDING", "CANCEL_NEW_LOAN_PENDING", "ERROR"

  - `events.contract_state.total_quantity` (string, required)
    Original total quantity of the contract (that it originally had before any returns)

  - `events.contract_state.unit_price` (string, required)
    Last prior day market price

  - `events.event_id` (string, required)
    Unique identifier of the event

  - `events.event_time` (string, required)
    Event timestamp - in RFC3339 with millisecond precision

  - `events.event_type` (string, required)
    Enum: "CREATED", "PENDING", "CANCEL_PENDING", "DO_PENDING", "MADE", "DROPPED", "REJECTED", "CANCEL_REJECTED", "CANCELLED", "RECALLED", "RECALL_REJECTED", "RECALL_CANCELED", "ROLLED", "ROLL_PENDING", "ROLL_PD_PENDING", "ROLL_PD_MADE", "RETURNED", "RETURN_PENDING", "PARTIALLY_RETURNED", "RETURN_CANCELED", "RETURN_FAILED", "RETURN_REJECTED", "TERMINATED", "BUY_IN", "BUY_IN_PENDING", "BUY_IN_CANCELLED", "BUY_IN_REJECTED", "BUY_IN_PO_MADE", "BUY_IN_PO_FAILED", "RENEGOTIATED", "RENEGOTIATION_CANCELED", "RENEGOTIATION_REJECTED", "RENEGOTIATION_EXPIRED", "CORPORATE_ACTION", "MARKED_TO_MARKET", "MARK_TO_MARKET_PO_FAILED", "MARK_TO_MARKET_PO_MADE", "DAILY_INTEREST_AMOUNT", "DAILY_INTEREST_PO_FAILED", "DAILY_INTEREST_PO_MADE", "FLOATING_RATE_RECALCULATED", "RETURN_PROPOSED", "RETURN_PROPOSAL_ACCEPTED", "RETURN_PROPOSAL_REJECTED", "RETURN_PROPOSAL_CANCELED", "RETURN_PROPOSAL_DROPPED", "RETURN_CANCEL_REJECTED"

  - `events.initiator` (string, required)
    Event initiator

  - `total_entries` (string, required)
    Total number of events


