Some helper functions are omitted for brevity.
MarketData
struct MarketData {
    Header header;
    FeeData feeData;
}

updateFeeDataAfterTrade

updateFeeDataAfterTrade
function updateFeeDataAfterTrade(
    MarketData storage self, 
    uint256 quoteTokenTraded
) internal returns (uint256 feeAmount)

Updates the fee data in the market after a trade by calculating the fee amount based on the amount of quote token traded and adding it to both the total and unclaimed quote token fees.

getFactory

getFactory
function getFactory(
    MarketData storage self
) internal view returns (address)

Retrieves the address of the factory associated with the market data.

getFactoryOwner

getFactoryOwner
function getFactoryOwner(
    MarketData storage self
) internal view returns (address)

Retrieves the owner address of the factory associated with the market data.

getFeeRecipient

getFeeRecipient
function getFeeRecipient(
    MarketData storage self
) internal view returns (address)

Retrieves the address of the fee recipient from the factory associated with the market data.