Skip to main content
Update the fee configuration for a given market.
marketId
int
required
The market ID to update.
tradeFeePct
int
required
The trade fee percentage (uint16).
maxEntitlement
int
required
The maximum entitlement (uint16).
insuranceFundEntitlementPct
int
required
The insurance fund entitlement percentage (uint16).
maxImbalance
int
required
The maximum imbalance (uint56).
returns
string
required
None
async def updateFees(marketId: int, tradeFeePct: int, maxEntitlement: int, insuranceFundEntitlementPct: int, maxImbalance: int):
    contract = retrieveContract()
    w3 = retrieveWeb3Instance()
    fee_config = (tradeFeePct, maxEntitlement, insuranceFundEntitlementPct, maxImbalance)
    transaction = contract.functions.updateFees(marketId, fee_config).build_transaction({'from': Web3.to_checksum_address(os.getenv('ACCOUNT')), 'nonce': w3.eth.get_transaction_count(Web3.to_checksum_address(os.getenv('ACCOUNT'))), 'gas': GAS_VALUE, 'gasPrice': math.ceil(w3.eth.gas_price + w3.eth.gas_price * 0.25)})
    await submitTransactionWithOracle(w3, transaction, marketId)
    print(f'Fees updated for market ID {marketId}')