Skip to content

Margin Trading Config

Markus Waas edited this page Jul 8, 2020 · 1 revision

The config contract handles all functions regarding system configurations. Setting the values is only allowed for the owner.

External Functions

getTradingPairs

Receive a list of all currently supported trading pairs.

Full details can be seen at MarginFlowProtocolConfig.getTradingPairs.

getCurrentTotalSwapRateForPoolAndPair

Get the total swap rate for a pair based on the configured swap rate and the additional pool markup. The exact formula used is total swap = swap - (abs(swap) * pool markup).

Full details can be seen at MarginFlowProtocolConfig.getCurrentTotalSwapRateForPoolAndPair.

setCurrentSwapRateForPair

Set the base swap rate for a pair. The value can be positive or negative.

Full details can be seen at MarginFlowProtocolConfig.setCurrentSwapRateForPair.

Owner functions

addTradingPair

The owner may add new trading pairs to the system. Only added pairs can be supported by pools.

Full details can be seen at MarginFlowProtocolConfig.addTradingPair.

set(-X)

The owner may change the following configuration settings:

  • max spread: Defines the maximally allowed spread for trading pairs.
  • max trading pair count: Defines the maximum for total trading pairs in the protocol. The value should be low enough to ensure
  • trader margin call threshold: Defines the threshold for traders to be margin called.
  • trader liquidation threshold: Defines the threshold for traders to be liquidated.
  • pool ENP margin call threshold: Defines the threshold for pools to be margin called due to the ENP being too low.
  • pool ELL margin call threshold: Defines the threshold for pools to be margin called due to the ELL being too low.
  • pool ENP liquidation threshold: Defines the threshold for pools to be liquidated due to the ENP being too low.
  • pool ELL liquidation threshold: Defines the threshold for pools to be liquidated due to the ELL being too low.