gmx.keys

Documentation for eth_defi.gmx.keys Python module.

GMX Protocol Key Generation Functions

This module provides key generation functions for GMX protocol data store keys. These functions generate the proper keccak hashes used for accessing data from the GMX datastore contract.

Complete implementation matching gmx-synthetics/utils/keys.ts

Functions

accountPositionListKey(account)

Get account position list key.

account_deposit_list_key(account)

Get account deposit list key.

account_glv_deposit_list_key(account)

Get account GLV deposit list key.

account_glv_withdrawal_list_key(account)

Get account GLV withdrawal list key.

account_order_list_key(account)

Get account order list key.

account_position_list_key(account)

Get account position list key.

account_shift_list_key(account)

Get account shift list key.

account_withdrawal_list_key(account)

Get account withdrawal list key.

affiliate_reward_key(market, token, account)

Get affiliate reward key.

apply_factor(value, factor)

Apply a 30-decimal factor to a value.

atomic_swap_fee_factor_key(market)

Get atomic swap fee factor key.

atomic_withdrawal_fee_factor_key(market)

Get atomic withdrawal fee factor key.

auto_cancel_order_list_key(position_key)

Get auto cancel order list key.

borrowing_exponent_factor_key(market, is_long)

Get borrowing exponent factor key.

borrowing_factor_key(market, is_long)

Get borrowing factor key.

buyback_available_fee_amount_key(fee_token, ...)

Get buyback available fee amount key.

buyback_batch_amount_key(token)

Get buyback batch amount key.

buyback_gmx_factor_key(version)

Get buyback GMX factor key.

buyback_max_price_impact_factor_key(token)

Get buyback maximum price impact factor key.

cancel_deposit_feature_disabled_key(contract)

Get cancel deposit feature disabled key.

cancel_order_feature_disabled_key(contract, ...)

Get cancel order feature disabled key.

claim_terms_key(distribution_id)

Get claim terms key.

claimable_collateral_amount_key(market, ...)

Get claimable collateral amount key.

claimable_collateral_factor_for_account_key(...)

Get claimable collateral factor for account key.

claimable_collateral_factor_key(market, ...)

Get claimable collateral factor key.

claimable_collateral_reduction_factor_for_account_key(...)

Get claimable collateral reduction factor for account key.

claimable_fee_amount_key(market, token)

Get claimable fee amount key.

claimable_funding_amount_key(market, token, ...)

Get claimable funding amount key.

claimable_funding_amount_per_size_key(...)

Get claimable funding amount per size key.

claimable_ui_fee_amount_key(market, token, ...)

Get claimable UI fee amount key.

collateral_sum_key(market, collateral_token, ...)

Get collateral sum key.

contributor_token_amount_key(account, token)

Get contributor token amount key.

create_deposit_feature_disabled_key(contract)

Get create deposit feature disabled key.

create_hash(data_type_list, data_value_list)

Create a keccak hash using ABI encoding.

create_hash_string(string)

Hash a string value using keccak-256.

create_order_feature_disabled_key(contract, ...)

Get create order feature disabled key.

cumulative_borrowing_factor_key(market, is_long)

Get cumulative borrowing factor key.

cumulative_borrowing_factor_updated_at_key(...)

Get cumulative borrowing factor updated at key.

data_stream_id_key(token)

Get data stream ID key.

data_stream_multiplier_key(token)

Get data stream multiplier key.

data_stream_spread_reduction_factor_key(token)

Get data stream spread reduction factor key.

decrease_order_gas_limit_key()

Get decrease order gas limit key.

deposit_fee_factor_key(market, ...)

Get deposit fee factor key.

deposit_gas_limit_key()

Get deposit gas limit key.

edge_data_stream_id_key(token)

Get edge data stream ID key.

edge_data_stream_token_decimals_key(token)

Get edge data stream token decimals key.

eid_to_src_chain_id_key(eid)

Get EID to source chain ID key.

execute_adl_feature_disabled_key(contract, ...)

Get execute ADL feature disabled key.

execute_deposit_feature_disabled_key(contract)

Get execute deposit feature disabled key.

execute_order_feature_disabled_key(contract, ...)

Get execute order feature disabled key.

execution_gas_fee_base_amount_key()

Get execution gas fee base amount key.

execution_gas_fee_multiplier_key()

Get execution gas fee multiplier key.

fee_distributor_address_info_for_chain_key(...)

Get fee distributor address info for chain key.

fee_distributor_address_info_key(chain_id, ...)

Get fee distributor address info key.

fee_distributor_bridge_slippage_factor_key(...)

Get fee distributor bridge slippage factor key.

fee_distributor_fee_amount_gmx_key(chain_id)

Get fee distributor fee amount GMX key.

fee_distributor_layerzero_chain_id_key(chain_id)

Get fee distributor LayerZero chain ID key.

fee_distributor_staked_gmx_key(chain_id)

Get fee distributor staked GMX key.

funding_decrease_factor_per_second_key(market)

Get funding decrease factor per second key.

funding_exponent_factor_key(market)

Get funding exponent factor key.

funding_factor_key(market)

Get funding factor key.

funding_fee_amount_per_size_key(market, ...)

Get funding fee amount per size key.

funding_increase_factor_per_second_key(market)

Get funding increase factor per second key.

funding_updated_at_key(market)

Get funding updated at key.

gasless_feature_disabled_key(module)

Get gasless feature disabled key.

general_claim_feature_disabled_key(...)

Get general claim feature disabled key.

glv_deposit_gas_limit_key()

Get GLV deposit gas limit key.

glv_max_market_token_balance_amount_key(glv, ...)

Get GLV maximum market token balance amount key.

glv_max_market_token_balance_usd_key(glv, market)

Get GLV maximum market token balance USD key.

glv_per_market_gas_limit_key()

Get GLV per market gas limit key.

glv_shift_gas_limit_key()

Get GLV shift gas limit key.

glv_shift_max_loss_factor_key(glv)

Get GLV shift maximum loss factor key.

glv_shift_min_interval_key(glv)

Get GLV shift minimum interval key.

glv_supported_market_list_key(glv)

Get GLV supported market list key.

glv_withdrawal_gas_limit_key()

Get GLV withdrawal gas limit key.

increase_order_gas_limit_key()

Get increase order gas limit key.

is_adl_enabled_key(market, is_long)

Get ADL enabled status key.

is_atomic_oracle_provider_key(provider)

Get atomic oracle provider status key.

is_glv_market_disabled_key(glv, market)

Get GLV market disabled status key.

is_market_disabled_key(market)

Get market disabled status key.

is_multichain_endpoint_enabled_key(contract)

Get multichain endpoint enabled status key.

is_multichain_provider_enabled_key(contract)

Get multichain provider enabled status key.

is_oracle_provider_enabled_key(provider)

Get oracle provider enabled status key.

is_relay_fee_excluded_key(contract)

Get relay fee excluded status key.

is_src_chain_id_enabled_key(src_chain_id)

Get source chain ID enabled status key.

jit_feature_disabled_key(contract)

Get JIT feature disabled key.

latest_adl_block_key(market, is_long)

Get latest ADL block key.

lent_position_impact_pool_amount_key(market)

Get lent position impact pool amount key.

liquidation_fee_factor_key(market)

Get liquidation fee factor key.

max_allowed_subaccount_action_count_key(...)

Get maximum allowed subaccount action count key.

max_funding_factor_per_second_key(market)

Get maximum funding factor per second key.

max_lendable_impact_factor_for_withdrawals_key(market)

Get maximum lendable impact factor for withdrawals key.

max_lendable_impact_factor_key(market)

Get maximum lendable impact factor key.

max_lendable_impact_usd_key(market)

Get maximum lendable impact USD key.

max_open_interest_key(market, is_long)

Get maximum open interest key.

max_pnl_factor_key(pnl_factor_type, market, ...)

Get maximum PNL factor key.

max_pool_amount_key(market, token)

Get maximum pool amount key.

max_pool_usd_for_deposit_key(market, token)

Get maximum pool USD for deposit key.

max_position_impact_factor_for_liquidations_key(market)

Get maximum position impact factor for liquidations key.

max_position_impact_factor_key(market, ...)

Get maximum position impact factor key.

min_additional_gas_for_execution_key()

Get minimum additional gas for execution key.

min_affiliate_reward_factor_key(...)

Get minimum affiliate reward factor key.

min_collateral()

Get minimum collateral key.

min_collateral_factor_for_liquidation_key(market)

Get minimum collateral factor for liquidation key.

min_collateral_factor_for_open_interest_multiplier_key(...)

Get minimum collateral factor for open interest multiplier key.

min_collateral_factor_key(market)

Get minimum collateral factor key.

min_funding_factor_per_second_key(market)

Get minimum funding factor per second key.

min_glv_tokens_for_first_glv_deposit_key(glv)

Get minimum GLV tokens for first GLV deposit key.

min_market_tokens_for_first_deposit_key(market)

Get minimum market tokens for first deposit key.

min_pnl_factor_after_adl_key(market, is_long)

Get minimum PNL factor after ADL key.

min_position_impact_pool_amount_key(market)

Get minimum position impact pool amount key.

multichain_authorized_originators_key(originator)

Get multichain authorized originators key.

multichain_balance_key(account, token)

Get multichain balance key.

multichain_confirmations_key(eid)

Get multichain confirmations key.

multichain_peers_key(read_channel)

Get multichain peers key.

open_interest_in_tokens_key(market, ...)

Get open interest in tokens key.

open_interest_key(market, collateral_token, ...)

Get open interest key.

open_interest_reserve_factor_key(market, is_long)

Get open interest reserve factor key.

oracle_provider_for_token_key(oracle, token)

Get oracle provider for token key.

oracle_provider_updated_at_key(token, provider)

Get oracle provider updated at key.

oracle_timestamp_adjustment_key(provider, token)

Get oracle timestamp adjustment key.

oracle_type_key(token)

Get oracle type key.

pool_amount_key(market, token)

Get pool amount key.

position_fee_factor_key(market, ...)

Get position fee factor key.

position_impact_exponent_factor_key(market, ...)

Get position impact exponent factor key.

position_impact_factor_key(market, is_positive)

Get position impact factor key.

position_impact_pool_amount_key(market)

Get position impact pool amount key.

position_impact_pool_distributed_at_key(market)

Get position impact pool distributed at key.

position_impact_pool_distribution_rate_key(market)

Get position impact pool distribution rate key.

position_last_src_chain_id_key(position_key)

Get position last source chain ID key.

price_feed_heartbeat_duration_key(token)

Get price feed heartbeat duration key.

price_feed_key(token)

Get price feed key.

price_feed_multiplier_key(token)

Get price feed multiplier key.

pro_discount_factor_key(pro_tier)

Get pro discount factor key.

pro_trader_tier_key(account)

Get pro trader tier key.

reserve_factor_key(market, is_long)

Get reserve factor key.

saved_funding_factor_per_second_key(market)

Get saved funding factor per second key.

shift_gas_limit_key()

Get shift gas limit key.

single_swap_gas_limit_key()

Get single swap gas limit key.

stable_price_key(token)

Get stable price key.

subaccount_action_count_key(account, ...)

Get subaccount action count key.

subaccount_auto_top_up_amount_key(account, ...)

Get subaccount auto top up amount key.

subaccount_expires_at_key(account, ...)

Get subaccount expires at key.

subaccount_list_key(account)

Get subaccount list key.

swap_fee_factor_key(market, balance_was_improved)

Get swap fee factor key.

swap_impact_exponent_factor_key(market)

Get swap impact exponent factor key.

swap_impact_factor_key(market, is_positive)

Get swap impact factor key.

swap_impact_pool_amount_key(market, token)

Get swap impact pool amount key.

swap_order_gas_limit_key()

Get swap order gas limit key.

sync_config_feature_disabled_key(contract)

Get sync config feature disabled key.

sync_config_latest_update_id_key()

Get sync config latest update ID key.

sync_config_market_disabled_key(market)

Get sync config market disabled key.

sync_config_market_parameter_disabled_key(...)

Get sync config market parameter disabled key.

sync_config_parameter_disabled_key(parameter)

Get sync config parameter disabled key.

sync_config_update_completed_key(update_id)

Get sync config update completed key.

threshold_for_decrease_funding_key(market)

Get threshold for decrease funding key.

threshold_for_stable_funding_key(market)

Get threshold for stable funding key.

token_transfer_gas_limit_key(token)

Get token transfer gas limit key.

total_pending_impact_amount_key(market)

Get total pending impact amount key.

update_order_feature_disabled_key(contract, ...)

Get update order feature disabled key.

virtualTokenIdKey(token)

Get virtual token ID key.

virtual_inventory_for_positions_key(...)

Get virtual inventory for positions key.

virtual_inventory_for_swaps_key(...)

Get virtual inventory for swaps key.

virtual_market_id_key(market)

Get virtual market ID key.

virtual_token_id_key(token)

Get virtual token ID key.

withdraw_gas_limit_key()

Get withdrawal gas limit key.

withdrawable_buyback_token_amount_key(...)

Get withdrawable buyback token amount key.

withdrawal_fee_factor_key(market, ...)

Get withdrawal fee factor key.

withdrawal_gas_limit_key()

Get withdrawal gas limit key.

apply_factor(value, factor)

Apply a 30-decimal factor to a value.

GMX uses 30-decimal fixed-point arithmetic for many values. This function applies a factor stored as an integer with 30 decimals.

Parameters
  • value (numeric) – Value to apply factor to

  • factor (int) – Factor in 30-decimal format (e.g., 10^30 = 1.0)

Returns

Result of (value * factor) / 10^30

Return type

numeric

create_hash(data_type_list, data_value_list)

Create a keccak hash using ABI encoding.

Parameters
  • data_type_list (list) – List of data types as strings (e.g., [“string”, “address”])

  • data_value_list (list) – List of values matching the data types

Returns

Keccak-256 hashed key

Return type

bytes

create_hash_string(string)

Hash a string value using keccak-256.

Parameters

string (str) – String to hash

Returns

Keccak-256 hashed string

Return type

bytes

account_deposit_list_key(account)

Get account deposit list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

account_withdrawal_list_key(account)

Get account withdrawal list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

account_shift_list_key(account)

Get account shift list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

account_position_list_key(account)

Get account position list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

account_order_list_key(account)

Get account order list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

account_glv_deposit_list_key(account)

Get account GLV deposit list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

account_glv_withdrawal_list_key(account)

Get account GLV withdrawal list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

subaccount_list_key(account)

Get subaccount list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

auto_cancel_order_list_key(position_key)

Get auto cancel order list key.

Parameters

position_key (bytes) – Position key (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

is_market_disabled_key(market)

Get market disabled status key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

min_market_tokens_for_first_deposit_key(market)

Get minimum market tokens for first deposit key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

create_deposit_feature_disabled_key(contract)

Get create deposit feature disabled key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

cancel_deposit_feature_disabled_key(contract)

Get cancel deposit feature disabled key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

gasless_feature_disabled_key(module)

Get gasless feature disabled key.

Parameters

module (str) – Module address

Returns

Keccak-256 hashed key

Return type

bytes

jit_feature_disabled_key(contract)

Get JIT feature disabled key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

execute_deposit_feature_disabled_key(contract)

Get execute deposit feature disabled key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

create_order_feature_disabled_key(contract, order_type)

Get create order feature disabled key.

Parameters
  • contract (str) – Contract address

  • order_type (int) – Order type (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

execute_order_feature_disabled_key(contract, order_type)

Get execute order feature disabled key.

Parameters
  • contract (str) – Contract address

  • order_type (int) – Order type (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

execute_adl_feature_disabled_key(contract, order_type)

Get execute ADL feature disabled key.

Parameters
  • contract (str) – Contract address

  • order_type (int) – Order type (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

update_order_feature_disabled_key(contract, order_type)

Get update order feature disabled key.

Parameters
  • contract (str) – Contract address

  • order_type (int) – Order type (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

cancel_order_feature_disabled_key(contract, order_type)

Get cancel order feature disabled key.

Parameters
  • contract (str) – Contract address

  • order_type (int) – Order type (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

general_claim_feature_disabled_key(distribution_id)

Get general claim feature disabled key.

Parameters

distribution_id (int) – Distribution ID (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

claimable_fee_amount_key(market, token)

Get claimable fee amount key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

claimable_funding_amount_key(market, token, account)

Get claimable funding amount key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

  • account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

claimable_collateral_amount_key(market, token, time_key, account)

Get claimable collateral amount key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

  • time_key (int) – Time key (uint256)

  • account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

claimable_collateral_factor_key(market, token, time_key)

Get claimable collateral factor key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

  • time_key (int) – Time key (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

claimable_collateral_factor_for_account_key(market, token, time_key, account)

Get claimable collateral factor for account key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

  • time_key (int) – Time key (uint256)

  • account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

claimable_collateral_reduction_factor_for_account_key(market, token, time_key, account)

Get claimable collateral reduction factor for account key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

  • time_key (int) – Time key (uint256)

  • account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

claimable_ui_fee_amount_key(market, token, ui_fee_receiver)

Get claimable UI fee amount key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

  • ui_fee_receiver (str) – UI fee receiver address

Returns

Keccak-256 hashed key

Return type

bytes

affiliate_reward_key(market, token, account)

Get affiliate reward key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

  • account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

min_affiliate_reward_factor_key(referral_tier_level)

Get minimum affiliate reward factor key.

Parameters

referral_tier_level (int) – Referral tier level (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

token_transfer_gas_limit_key(token)

Get token transfer gas limit key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

price_feed_key(token)

Get price feed key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

price_feed_multiplier_key(token)

Get price feed multiplier key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

price_feed_heartbeat_duration_key(token)

Get price feed heartbeat duration key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

data_stream_id_key(token)

Get data stream ID key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

edge_data_stream_id_key(token)

Get edge data stream ID key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

edge_data_stream_token_decimals_key(token)

Get edge data stream token decimals key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

data_stream_multiplier_key(token)

Get data stream multiplier key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

data_stream_spread_reduction_factor_key(token)

Get data stream spread reduction factor key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

stable_price_key(token)

Get stable price key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

oracle_type_key(token)

Get oracle type key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

oracle_timestamp_adjustment_key(provider, token)

Get oracle timestamp adjustment key.

Parameters
  • provider (str) – Provider address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

oracle_provider_for_token_key(oracle, token)

Get oracle provider for token key.

Parameters
  • oracle (str) – Oracle address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

oracle_provider_updated_at_key(token, provider)

Get oracle provider updated at key.

Parameters
  • token (str) – Token address

  • provider (str) – Provider address

Returns

Keccak-256 hashed key

Return type

bytes

open_interest_key(market, collateral_token, is_long)

Get open interest key.

Parameters
  • market (str) – Market address

  • collateral_token (str) – Collateral token address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

open_interest_in_tokens_key(market, collateral_token, is_long)

Get open interest in tokens key.

Parameters
  • market (str) – Market address

  • collateral_token (str) – Collateral token address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

is_oracle_provider_enabled_key(provider)

Get oracle provider enabled status key.

Parameters

provider (str) – Provider address

Returns

Keccak-256 hashed key

Return type

bytes

is_atomic_oracle_provider_key(provider)

Get atomic oracle provider status key.

Parameters

provider (str) – Provider address

Returns

Keccak-256 hashed key

Return type

bytes

min_collateral_factor_key(market)

Get minimum collateral factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

min_collateral_factor_for_liquidation_key(market)

Get minimum collateral factor for liquidation key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

min_collateral_factor_for_open_interest_multiplier_key(market, is_long)

Get minimum collateral factor for open interest multiplier key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

reserve_factor_key(market, is_long)

Get reserve factor key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

open_interest_reserve_factor_key(market, is_long)

Get open interest reserve factor key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

max_pnl_factor_key(pnl_factor_type, market, is_long)

Get maximum PNL factor key.

Parameters
  • pnl_factor_type (bytes) – PNL factor type (bytes32)

  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

min_pnl_factor_after_adl_key(market, is_long)

Get minimum PNL factor after ADL key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

collateral_sum_key(market, collateral_token, is_long)

Get collateral sum key.

Parameters
  • market (str) – Market address

  • collateral_token (str) – Collateral token address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

pool_amount_key(market, token)

Get pool amount key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

max_pool_amount_key(market, token)

Get maximum pool amount key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

max_pool_usd_for_deposit_key(market, token)

Get maximum pool USD for deposit key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

max_open_interest_key(market, is_long)

Get maximum open interest key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

position_impact_pool_amount_key(market)

Get position impact pool amount key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

lent_position_impact_pool_amount_key(market)

Get lent position impact pool amount key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

total_pending_impact_amount_key(market)

Get total pending impact amount key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

min_position_impact_pool_amount_key(market)

Get minimum position impact pool amount key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

position_impact_pool_distribution_rate_key(market)

Get position impact pool distribution rate key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

position_impact_pool_distributed_at_key(market)

Get position impact pool distributed at key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

max_lendable_impact_factor_key(market)

Get maximum lendable impact factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

max_lendable_impact_factor_for_withdrawals_key(market)

Get maximum lendable impact factor for withdrawals key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

max_lendable_impact_usd_key(market)

Get maximum lendable impact USD key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

swap_impact_pool_amount_key(market, token)

Get swap impact pool amount key.

Parameters
  • market (str) – Market address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

swap_fee_factor_key(market, balance_was_improved)

Get swap fee factor key.

Parameters
  • market (str) – Market address

  • balance_was_improved (bool) – Whether balance was improved

Returns

Keccak-256 hashed key

Return type

bytes

deposit_fee_factor_key(market, balance_was_improved)

Get deposit fee factor key.

Parameters
  • market (str) – Market address

  • balance_was_improved (bool) – Whether balance was improved

Returns

Keccak-256 hashed key

Return type

bytes

withdrawal_fee_factor_key(market, balance_was_improved)

Get withdrawal fee factor key.

Parameters
  • market (str) – Market address

  • balance_was_improved (bool) – Whether balance was improved

Returns

Keccak-256 hashed key

Return type

bytes

atomic_swap_fee_factor_key(market)

Get atomic swap fee factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

atomic_withdrawal_fee_factor_key(market)

Get atomic withdrawal fee factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

swap_impact_factor_key(market, is_positive)

Get swap impact factor key.

Parameters
  • market (str) – Market address

  • is_positive (bool) – Is positive impact

Returns

Keccak-256 hashed key

Return type

bytes

swap_impact_exponent_factor_key(market)

Get swap impact exponent factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

position_impact_factor_key(market, is_positive)

Get position impact factor key.

Parameters
  • market (str) – Market address

  • is_positive (bool) – Is positive impact

Returns

Keccak-256 hashed key

Return type

bytes

position_impact_exponent_factor_key(market, is_positive)

Get position impact exponent factor key.

Parameters
  • market (str) – Market address

  • is_positive (bool) – Is positive impact

Returns

Keccak-256 hashed key

Return type

bytes

max_position_impact_factor_key(market, is_positive)

Get maximum position impact factor key.

Parameters
  • market (str) – Market address

  • is_positive (bool) – Is positive impact

Returns

Keccak-256 hashed key

Return type

bytes

max_position_impact_factor_for_liquidations_key(market)

Get maximum position impact factor for liquidations key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

position_fee_factor_key(market, balance_was_improved)

Get position fee factor key.

Parameters
  • market (str) – Market address

  • balance_was_improved (bool) – Whether balance was improved

Returns

Keccak-256 hashed key

Return type

bytes

pro_trader_tier_key(account)

Get pro trader tier key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

pro_discount_factor_key(pro_tier)

Get pro discount factor key.

Parameters

pro_tier (int) – Pro tier (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

liquidation_fee_factor_key(market)

Get liquidation fee factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

latest_adl_block_key(market, is_long)

Get latest ADL block key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

is_adl_enabled_key(market, is_long)

Get ADL enabled status key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

funding_factor_key(market)

Get funding factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

funding_exponent_factor_key(market)

Get funding exponent factor key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

saved_funding_factor_per_second_key(market)

Get saved funding factor per second key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

funding_increase_factor_per_second_key(market)

Get funding increase factor per second key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

funding_decrease_factor_per_second_key(market)

Get funding decrease factor per second key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

min_funding_factor_per_second_key(market)

Get minimum funding factor per second key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

max_funding_factor_per_second_key(market)

Get maximum funding factor per second key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

threshold_for_stable_funding_key(market)

Get threshold for stable funding key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

threshold_for_decrease_funding_key(market)

Get threshold for decrease funding key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

funding_fee_amount_per_size_key(market, collateral_token, is_long)

Get funding fee amount per size key.

Parameters
  • market (str) – Market address

  • collateral_token (str) – Collateral token address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

claimable_funding_amount_per_size_key(market, collateral_token, is_long)

Get claimable funding amount per size key.

Parameters
  • market (str) – Market address

  • collateral_token (str) – Collateral token address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

funding_updated_at_key(market)

Get funding updated at key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

borrowing_factor_key(market, is_long)

Get borrowing factor key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

borrowing_exponent_factor_key(market, is_long)

Get borrowing exponent factor key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

cumulative_borrowing_factor_key(market, is_long)

Get cumulative borrowing factor key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

cumulative_borrowing_factor_updated_at_key(market, is_long)

Get cumulative borrowing factor updated at key.

Parameters
  • market (str) – Market address

  • is_long (bool) – Is long position

Returns

Keccak-256 hashed key

Return type

bytes

virtual_token_id_key(token)

Get virtual token ID key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

virtual_market_id_key(market)

Get virtual market ID key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

virtual_inventory_for_swaps_key(virtual_market_id, is_long_token)

Get virtual inventory for swaps key.

Parameters
  • virtual_market_id (bytes) – Virtual market ID (bytes32)

  • is_long_token (bool) – Is long token

Returns

Keccak-256 hashed key

Return type

bytes

virtual_inventory_for_positions_key(virtual_token_id)

Get virtual inventory for positions key.

Parameters

virtual_token_id (bytes) – Virtual token ID (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

max_allowed_subaccount_action_count_key(account, subaccount, action_type)

Get maximum allowed subaccount action count key.

Parameters
  • account (str) – Account address

  • subaccount (str) – Subaccount address

  • action_type (bytes) – Action type (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

subaccount_expires_at_key(account, subaccount, action_type)

Get subaccount expires at key.

Parameters
  • account (str) – Account address

  • subaccount (str) – Subaccount address

  • action_type (bytes) – Action type (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

subaccount_action_count_key(account, subaccount, action_type)

Get subaccount action count key.

Parameters
  • account (str) – Account address

  • subaccount (str) – Subaccount address

  • action_type (bytes) – Action type (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

subaccount_auto_top_up_amount_key(account, subaccount)

Get subaccount auto top up amount key.

Parameters
  • account (str) – Account address

  • subaccount (str) – Subaccount address

Returns

Keccak-256 hashed key

Return type

bytes

glv_supported_market_list_key(glv)

Get GLV supported market list key.

Parameters

glv (str) – GLV address

Returns

Keccak-256 hashed key

Return type

bytes

min_glv_tokens_for_first_glv_deposit_key(glv)

Get minimum GLV tokens for first GLV deposit key.

Parameters

glv (str) – GLV address

Returns

Keccak-256 hashed key

Return type

bytes

glv_max_market_token_balance_usd_key(glv, market)

Get GLV maximum market token balance USD key.

Parameters
  • glv (str) – GLV address

  • market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

glv_max_market_token_balance_amount_key(glv, market)

Get GLV maximum market token balance amount key.

Parameters
  • glv (str) – GLV address

  • market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

glv_shift_min_interval_key(glv)

Get GLV shift minimum interval key.

Parameters

glv (str) – GLV address

Returns

Keccak-256 hashed key

Return type

bytes

glv_shift_max_loss_factor_key(glv)

Get GLV shift maximum loss factor key.

Parameters

glv (str) – GLV address

Returns

Keccak-256 hashed key

Return type

bytes

is_glv_market_disabled_key(glv, market)

Get GLV market disabled status key.

Parameters
  • glv (str) – GLV address

  • market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

sync_config_feature_disabled_key(contract)

Get sync config feature disabled key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

sync_config_market_disabled_key(market)

Get sync config market disabled key.

Parameters

market (str) – Market address

Returns

Keccak-256 hashed key

Return type

bytes

sync_config_parameter_disabled_key(parameter)

Get sync config parameter disabled key.

Parameters

parameter (str) – Parameter name (string)

Returns

Keccak-256 hashed key

Return type

bytes

sync_config_market_parameter_disabled_key(market, parameter)

Get sync config market parameter disabled key.

Parameters
  • market (str) – Market address

  • parameter (str) – Parameter name (string)

Returns

Keccak-256 hashed key

Return type

bytes

sync_config_update_completed_key(update_id)

Get sync config update completed key.

Parameters

update_id (int) – Update ID (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

sync_config_latest_update_id_key()

Get sync config latest update ID key.

Returns

Sync config latest update ID constant

Return type

bytes

buyback_batch_amount_key(token)

Get buyback batch amount key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

buyback_available_fee_amount_key(fee_token, swap_token)

Get buyback available fee amount key.

Parameters
  • fee_token (str) – Fee token address

  • swap_token (str) – Swap token address

Returns

Keccak-256 hashed key

Return type

bytes

buyback_gmx_factor_key(version)

Get buyback GMX factor key.

Parameters

version (int) – Version (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

buyback_max_price_impact_factor_key(token)

Get buyback maximum price impact factor key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

withdrawable_buyback_token_amount_key(buyback_token)

Get withdrawable buyback token amount key.

Parameters

buyback_token (str) – Buyback token address

Returns

Keccak-256 hashed key

Return type

bytes

is_multichain_provider_enabled_key(contract)

Get multichain provider enabled status key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

is_multichain_endpoint_enabled_key(contract)

Get multichain endpoint enabled status key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

is_relay_fee_excluded_key(contract)

Get relay fee excluded status key.

Parameters

contract (str) – Contract address

Returns

Keccak-256 hashed key

Return type

bytes

is_src_chain_id_enabled_key(src_chain_id)

Get source chain ID enabled status key.

Parameters

src_chain_id (int) – Source chain ID (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

eid_to_src_chain_id_key(eid)

Get EID to source chain ID key.

Parameters

eid (int) – EID (uint32)

Returns

Keccak-256 hashed key

Return type

bytes

position_last_src_chain_id_key(position_key)

Get position last source chain ID key.

Parameters

position_key (bytes) – Position key (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

claim_terms_key(distribution_id)

Get claim terms key.

Parameters

distribution_id (int) – Distribution ID (uint256 or string)

Returns

Keccak-256 hashed key

Return type

bytes

multichain_balance_key(account, token)

Get multichain balance key.

Parameters
  • account (str) – Account address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

multichain_peers_key(read_channel)

Get multichain peers key.

Parameters

read_channel (str) – Read channel (uint32)

Returns

Keccak-256 hashed key

Return type

bytes

multichain_confirmations_key(eid)

Get multichain confirmations key.

Parameters

eid (str) – EID (uint32)

Returns

Keccak-256 hashed key

Return type

bytes

multichain_authorized_originators_key(originator)

Get multichain authorized originators key.

Parameters

originator (str) – Originator address

Returns

Keccak-256 hashed key

Return type

bytes

fee_distributor_fee_amount_gmx_key(chain_id)

Get fee distributor fee amount GMX key.

Parameters

chain_id (int) – Chain ID (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

fee_distributor_staked_gmx_key(chain_id)

Get fee distributor staked GMX key.

Parameters

chain_id (int) – Chain ID (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

fee_distributor_bridge_slippage_factor_key(chain_id)

Get fee distributor bridge slippage factor key.

Parameters

chain_id (int) – Chain ID (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

fee_distributor_layerzero_chain_id_key(chain_id)

Get fee distributor LayerZero chain ID key.

Parameters

chain_id (int) – Chain ID (uint256)

Returns

Keccak-256 hashed key

Return type

bytes

fee_distributor_address_info_key(chain_id, address_name)

Get fee distributor address info key.

Parameters
  • chain_id (int) – Chain ID (uint256)

  • address_name (str) – Address name (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

fee_distributor_address_info_for_chain_key(chain_id, address_name)

Get fee distributor address info for chain key.

Parameters
  • chain_id (int) – Chain ID (uint256)

  • address_name (str) – Address name (bytes32)

Returns

Keccak-256 hashed key

Return type

bytes

contributor_token_amount_key(account, token)

Get contributor token amount key.

Parameters
  • account (str) – Account address

  • token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

deposit_gas_limit_key()

Get deposit gas limit key.

Returns

Deposit gas limit constant

Return type

bytes

withdrawal_gas_limit_key()

Get withdrawal gas limit key.

Returns

Withdrawal gas limit constant

Return type

bytes

shift_gas_limit_key()

Get shift gas limit key.

Returns

Shift gas limit constant

Return type

bytes

single_swap_gas_limit_key()

Get single swap gas limit key.

Returns

Single swap gas limit constant

Return type

bytes

increase_order_gas_limit_key()

Get increase order gas limit key.

Returns

Increase order gas limit constant

Return type

bytes

decrease_order_gas_limit_key()

Get decrease order gas limit key.

Returns

Decrease order gas limit constant

Return type

bytes

swap_order_gas_limit_key()

Get swap order gas limit key.

Returns

Swap order gas limit constant

Return type

bytes

glv_deposit_gas_limit_key()

Get GLV deposit gas limit key.

Returns

GLV deposit gas limit constant

Return type

bytes

glv_withdrawal_gas_limit_key()

Get GLV withdrawal gas limit key.

Returns

GLV withdrawal gas limit constant

Return type

bytes

glv_shift_gas_limit_key()

Get GLV shift gas limit key.

Returns

GLV shift gas limit constant

Return type

bytes

glv_per_market_gas_limit_key()

Get GLV per market gas limit key.

Returns

GLV per market gas limit constant

Return type

bytes

execution_gas_fee_base_amount_key()

Get execution gas fee base amount key.

Returns

Execution gas fee base amount constant

Return type

bytes

execution_gas_fee_multiplier_key()

Get execution gas fee multiplier key.

Returns

Execution gas fee multiplier factor constant

Return type

bytes

min_additional_gas_for_execution_key()

Get minimum additional gas for execution key.

Returns

Minimum additional gas for execution constant

Return type

bytes

min_collateral()

Get minimum collateral key.

Returns

Minimum collateral USD constant

Return type

bytes

accountPositionListKey(account)

Get account position list key.

Parameters

account (str) – Account address

Returns

Keccak-256 hashed key

Return type

bytes

virtualTokenIdKey(token)

Get virtual token ID key.

Parameters

token (str) – Token address

Returns

Keccak-256 hashed key

Return type

bytes

withdraw_gas_limit_key()

Get withdrawal gas limit key.

Returns

Withdrawal gas limit constant

Return type

bytes