Skip to content

quantpylib.gateway.exchange

Exchange

Bases: BaseGateway

contract_specifications(exc, **kwargs) async

Retrieve the contract's trading rules from the exchange.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

Returns:

Type Description
dict

Dictionary containing contract specifications such as price precision,

quantity precision and minimum notional order value.

get_exchange_server_timestamp(exc, **kwargs)

Retrieve the server timestamp from the exchange.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

Returns:

Type Description
int

The server timestamp from the exchange.

get_exchange_tz(exc, **kwargs)

Get the timezone for a specific exchange.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

Returns:

Type Description
str

Timezone of the exchange.

get_perps_data(exc, **kwargs) async

Retrieve perpetuals data.

Parameters:

Name Type Description Default
exc str

Alias for the exchange client.

required
**kwargs

Exchange wrapper specific keyword arguments.

{}

Returns:

Type Description
dict

A dictionary containing symbol to perp data with the following perp data structure:

  • "baseAsset" str : The base asset symbol.
  • "fr" float : Funding rate.
  • "frint" float, Floating point representation of the funding rate.
  • "marginAsset" str, The margin asset symbol.
  • "markPrice" float, The mark price.
  • "minQty" Decimal, The minimum quantity.
  • "min_notional" float, The minimum notional value.
  • "next_funding" int, Unix timestamp of the next funding, milliseconds.
  • "pricePrecision" Decimal, The price precision.
  • "quantityPrecision" Decimal, The quantity precision.
  • "quoteAsset" str, The quote asset symbol.
  • "stepSize" Decimal, The step size.
  • "symbol" str, The symbol.
  • "timestamp" int, Unix timestamp of the data retrieval, milliseconds.
  • "exchange" str The exchange code , "hyp"