Bingex.Swap.ContractInfo (Bingex v0.1.7)

Represents contract information for a swap contract in BingX.

This module provides structured details about a swap contract, including precision settings, trading fees, status, and lifecycle timestamps.

Summary

Types

t()

Contract (market) information.

Types

contract_status()

@type contract_status() :: :online | :pre_online | :offline | :forbidden

t()

@type t() :: %Bingex.Swap.ContractInfo{
  asset: binary(),
  closing_status: binary(),
  contract_id: term(),
  currency: binary(),
  guaranteed_stop_fee_rate: binary(),
  guaranteed_stop_status: boolean(),
  launch_time: non_neg_integer(),
  maintain_time: non_neg_integer(),
  maker_fee_rate: float(),
  min_quantity: float(),
  min_quote_amount: float(),
  off_time: non_neg_integer(),
  opening_status: binary(),
  price_precision: integer(),
  quantity_precision: integer(),
  status: contract_status(),
  symbol: binary(),
  taker_fee_rate: float(),
  transactions_status: boolean()
}

Contract (market) information.

Fields:

  • contract_id (binary): Unique identifier for the contract.
  • symbol (binary): Trading pair symbol (e.g., "BTC-USDT").
  • quantity_precision (integer): Precision of order quantity.
  • price_precision (integer): Precision of price values.
  • taker_fee_rate (float): Taker fee rate as a percentage.
  • maker_fee_rate (float): Maker fee rate as a percentage.
  • min_quantity (float): Minimum order quantity.
  • min_quote_amount (float): Minimum order value in quote currency.
  • currency (binary): Settlement currency (e.g., "USDT").
  • asset (binary): Base asset of the contract.
  • status (contract_status()): Current contract status (:online, :pre_online, :offline, :forbidden).
  • opening_status (boolean): Whether trading is open.
  • closing_status (boolean): Whether closing of positions is allowed.
  • guaranteed_stop_status (boolean): Whether guaranteed stop-loss is available.
  • guaranteed_stop_fee_rate (float): Fee rate for guaranteed stop-loss.
  • transactions_status (boolean): Whether contract transactions are enabled.
  • launch_time (non_neg_integer): Timestamp of contract launch.
  • maintain_time (non_neg_integer): Timestamp of next maintenance.
  • off_time (non_neg_integer): Timestamp when contract will be taken offline.

Functions

decode(data)

@spec decode(any()) :: {:ok, t()} | :error