VMP-23 Update risk models for current and upcoming perpetual futures

This is a follow on discussion from my last post about the margin scaling factors: VNP-24 Update Margin Scaling Factors to align UX with CEXs

In that post I proposed changes to the market.margin.scalingFactors network parameter. Those changes would result in lower initial leverage being available to traders on Vega, this proposal seeks to increase the available leverage on the existing and upcoming perpetual futures markets. To achieve this we will have to modify the risk models of these markets.

To decide what leverage we think is appropriate we can look to the amount of leverage offered by CEXs for the same type of markets. The values below take the form:

Instrument - Initial Leverage - Max Leverage

OKEx:

  • BTCUSDT Perp - 100x - 250x
  • ETHUSDT Perp - 100x - 250x
  • SOLUSDT Perp - 50x - ~154x
  • LINKUSDT Perp - 50x - ~154x

ByBit:

  • BTCUSDT Perp - 100x - 200x
  • ETHUSDT Perp - 100x - 200x
  • SOLUSDT Perp - 75x - 133.3x
  • LINKUSDT Perp - 50x - 100x

These values were derived from the initial and maintenance margin requirements listed on their respective websites:

Given the above leverage values I would propose that initially we provide markets with the following leverage:

BTCUSDT Perp - 50x - 100x
ETHUSDT Perp - 50x - 100x
SOLUSDT Perp - 37.5x - 75x
LINKUSDT Perp - 25x - 50x

The SOL market should enact with these values already based on the risk parameters it was proposed with.

To achieve the desired leverage levels on the rest of the markets I propose the following sets of risk model parameters:

BTCUSDT Perp:

{
"tau": 0.000003995,
"riskAversionParameter": 0.000001,
"sigma": 1.0,
"mu": 0,
"r": 0,
}

ETHUSDT Perp:

{
"tau": 0.00000305,
"riskAversionParameter": 0.000001,
"sigma": 1.15,
"mu": 0,
"r": 0,
}

LINKUSDT Perp:

{
"tau": 0.0000065,
"riskAversionParameter": 0.000001,
"sigma": 1.5,
"mu": 0,
"r": 0,
}

BTCUSDT Full Proposal JSON:

{
    "rationale": {
      "title": "VMP-23a Update BTC/USD Perpetual risk model to allow greater leverage.",
      "description": "A proposal to update the risk model of the BTCUSD Perp market. This is a follow up proposal to VNP-24 which seeks to change the margin scaling factors to align the UX of speculative trading on Vega with that of CEXs. Should that proposal be accepted then the initial leverage available to traders will be reduced on all markets. As a result, it makes sense to update the risk models of existing markets to allow greater leverage. The proposed risk params for the BTCUSD Perp are as follows: \"tau\": 0.000003995, \"riskAversionParameter\": 0.000001, \"sigma\": 1.0, \"mu\": 0, \"r\": 0. These parameters should result in an initial leverage of ~50x and a max leverage of ~100x. Full discussion: https://community.vega.xyz/t/vmp-23-update-risk-models-for-current-and-upcoming-perpetual-futures/4405"
    },
    "terms": {
      "updateMarket": {
      "marketId": "4e9081e20e9e81f3e747d42cb0c9b8826454df01899e6027a22e771e19cc79fc",
        "changes": {
          "linearSlippageFactor": "0.001",
          "quadraticSlippageFactor": "0",
          "instrument": {
            "code": "BTC/USD-PERP",
            "perpetual": {
              "quoteName": "USD",
              "marginFundingFactor": "0.9",
              "interestRate": "0.1095",
              "clampLowerBound": "-0.0005",
              "clampUpperBound": "0.0005",
              "dataSourceSpecForSettlementData": {
                "external": {
                  "ethOracle": {
                    "address": "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c",
                    "abi": "[{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
                    "method": "latestAnswer",
                    "normalisers": [
                      {
                        "name": "btc.price",
                        "expression": "$[0]"
                      }
                    ],
                    "requiredConfirmations": 3,
                    "trigger": {
                      "timeTrigger": {
                        "initial": "1701727200",
                        "every": "300"
                      }
                    },
                    "filters": [
                      {
                        "key": {
                          "name": "btc.price",
                          "type": "TYPE_INTEGER",
                          "numberDecimalPlaces": "8"
                        },
                        "conditions": [
                          {
                            "operator": "OPERATOR_GREATER_THAN",
                            "value": "0"
                          }
                        ]
                      }
                    ]
                  }
                }
              },
              "dataSourceSpecForSettlementSchedule": {
                "internal": {
                  "timeTrigger": {
                    "conditions": [
                      {
                        "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                        "value": "0"
                      }
                    ],
                    "triggers": [
                      {
                        "initial": "1701727200",
                        "every": "28800"
                      }
                    ]
                  }
                }
              },
              "dataSourceSpecBinding": {
                "settlementDataProperty": "btc.price",
                "settlementScheduleProperty": "vegaprotocol.builtin.timetrigger"
              }
            }
          },
          "metadata":[
            "base:BTC",
            "quote:USDT",
            "class:fx/crypto",
            "perpetual",
            "sector:defi",
            "enactment:2023-12-01T18:00:00Z"
          ],
          "priceMonitoringParameters": {
            "triggers": [
              {
                "horizon": "4320",
                "probability": "0.9999999",
                "auctionExtension": "300"
              },
              {
                "horizon": "1440",
                "probability": "0.9999999",
                "auctionExtension": "180"
              },
              {
                "horizon": "360",
                "probability": "0.9999999",
                "auctionExtension": "120"
              }
            ]
          },
          "liquidityMonitoringParameters": {
            "targetStakeParameters": {
              "timeWindow": "3600",
              "scalingFactor": 0.05
            },
            "triggeringRatio": "0.1",
            "auctionExtension": "1"
          },
          "logNormal": {
            "tau": 0.000003995,
            "riskAversionParameter": 0.000001,
            "params": {
              "mu": 0,
              "r": 0,
              "sigma": 1.0
            }
          },
          "liquiditySlaParameters": {
            "priceRange": "0.03",
            "commitmentMinTimeFraction": "0.85",
            "performanceHysteresisEpochs": "1",
            "slaCompetitionFactor": "0.5"
          }
        }
      },
      "closingTimestamp": 1702321200,
      "enactmentTimestamp": 1702321200
    }
  }

ETHUSDT Full Proposal JSON:

{
  "rationale": {
    "title": "VMP-23b Update ETH/USD Perpetual risk model to allow greater leverage.",
    "description": "A proposal to update the risk model of the ETHUSD Perp market. This is a follow up proposal to VNP-24 which seeks to change the margin scaling factors to align the UX of speculative trading on Vega with that of CEXs. Should that proposal be accepted then the initial leverage available to traders will be reduced on all markets. As a result, it makes sense to update the risk models of existing markets to allow greater leverage. The proposed risk params for the ETHUSD Perp are as follows: \"tau\": 0.00000305, \"riskAversionParameter\": 0.000001, \"sigma\": 1.15, \"mu\": 0, \"r\": 0. These parameters should result in an initial leverage of ~50x and a max leverage of ~100x. Full discussion: https://community.vega.xyz/t/vmp-23-update-risk-models-for-current-and-upcoming-perpetual-futures/4405"
  },
  "terms": {
    "updateMarket": {
      "marketId": "e63a37edae8b74599d976f5dedbf3316af82579447f7a08ae0495a021fd44d13",
      "changes": {
        "linearSlippageFactor": "0.001",
        "quadraticSlippageFactor": "0",
        "instrument": {
          "code": "ETH/USD-PERP",
          "perpetual": {
            "quoteName": "USD",
            "marginFundingFactor": "0.95",
            "interestRate": "0.1095",
            "clampLowerBound": "-0.0005",
            "clampUpperBound": "0.0005",
            "dataSourceSpecForSettlementSchedule": {
              "internal": {
                "timeTrigger": {
                  "conditions": [
                    {
                      "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                      "value": "0"
                    }
                  ],
                  "triggers": [
                    {
                      "initial": "1700359200",
                      "every": "28800"
                    }
                  ]
                }
              }
            },
            "dataSourceSpecForSettlementData": {
              "external": {
                "ethOracle": {
                  "address": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419",
                  "abi": "[{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
                  "method": "latestAnswer",
                  "args": [],
                  "trigger": {
                    "timeTrigger": {
                      "initial": "1700359200",
                      "every": "300"
                    }
                  },
                  "requiredConfirmations": "3",
                  "filters": [
                    {
                      "key": {
                        "name": "eth.price",
                        "type": "TYPE_INTEGER",
                        "numberDecimalPlaces": "8"
                      },
                      "conditions": [
                        {
                          "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                          "value": "0"
                        }
                      ]
                    }
                  ],
                  "normalisers": [
                    {
                      "name": "eth.price",
                      "expression": "$[0]"
                    }
                  ]
                }
              }
            },
            "dataSourceSpecBinding": {
              "settlementDataProperty": "eth.price",
              "settlementScheduleProperty": "vegaprotocol.builtin.timetrigger"
            }
          }
        },
        "metadata": [
          "enactment:2023-11-19T02:00:00Z",
          "base:ETH",
          "quote:USD",
          "class:fx/crypto",
          "perpetual",
          "sector:defi"
        ],
        "priceMonitoringParameters": {
          "triggers": [
            {
              "horizon": "43200",
              "probability": "0.9999999",
              "auctionExtension": "300"
            }
          ]
        },
        "liquidityMonitoringParameters": {
          "targetStakeParameters": {
            "timeWindow": "3600",
            "scalingFactor": 0.05
          },
          "triggeringRatio": "0.1",
          "auctionExtension": "1"
        },
        "logNormal": {
          "tau": 0.00000305,
          "riskAversionParameter": 0.000001,
          "params": {
            "mu": 0,
            "r": 0,
            "sigma": 1.15
          }
        },
        "liquiditySlaParameters": {
          "priceRange": "0.03",
          "commitmentMinTimeFraction": "0.85",
          "performanceHysteresisEpochs": "1",
          "slaCompetitionFactor": "0.5"
        }
      }
    },
    "closingTimestamp": 1702321200,
    "enactmentTimestamp": 1702321200
  }
}

LINKUSDT Full Proposal JSON:

{
  "rationale": {
    "title": "VMP-23c Update LINK/USD Perpetual risk model to fix accidental high leverage.",
    "description": "A proposal to update the risk model of the LINKUSD Perp market. This is a follow up proposal to VNP-24 which seeks to change the margin scaling factors to align the UX of speculative trading on Vega with that of CEXs. While VMP-23 seeks to increase the leverage on existing markets it seeks to reduce the leverage on the LINK market due to an error in selecting the risk params that resulted in greater than intended leverage, discussion available on the original LINK Perp proposal forum post: https://community.vega.xyz/t/vmp-14-create-market-link-usd-usdt-perpetual/4372/17. The proposed risk params for the LINKUSD Perp are as follows: \"tau\": 0.0000065, \"riskAversionParameter\": 0.000001, \"sigma\": 1.5, \"mu\": 0, \"r\": 0. These parameters should result in an initial leverage of ~25x and a max leverage of ~50x. Scaling factor discussion: https://community.vega.xyz/t/vmp-23-update-risk-models-for-current-and-upcoming-perpetual-futures/4405."
  },
  "terms": {
    "updateMarket": {
      "marketId": "74f8bb5c2236dac8f29ee10c18d70d553b8faa180f288b559ef795d0faeb3607",
      "changes": {
        "linearSlippageFactor": "0.001",
        "quadraticSlippageFactor": "0",
        "instrument": {
          "code": "LINK/USD-PERP",
          "perpetual": {
            "quoteName": "USD",
            "marginFundingFactor": "0.95",
            "interestRate": "0.1095",
            "clampLowerBound": "-0.0005",
            "clampUpperBound": "0.0005",
            "dataSourceSpecForSettlementSchedule": {
              "internal": {
                "timeTrigger": {
                  "conditions": [
                    {
                      "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                      "value": "0"
                    }
                  ],
                  "triggers": [
                    {
                      "initial": "1702094400",
                      "every": "28800"
                    }
                  ]
                }
              }
            },
            "dataSourceSpecForSettlementData": {
              "external": {
                "ethOracle": {
                  "address": "0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c",
                  "abi": "[{\"inputs\":[],\"name\":\"latestAnswer\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
                  "method": "latestAnswer",
                  "args": [],
                  "trigger": {
                    "timeTrigger": {
                      "initial": "1702094400",
                      "every": "300"
                    }
                  },
                  "requiredConfirmations": "3",
                  "filters": [
                    {
                      "key": {
                        "name": "link.price",
                        "type": "TYPE_INTEGER",
                        "numberDecimalPlaces": "8"
                      },
                      "conditions": [
                        {
                          "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                          "value": "0"
                        }
                      ]
                    }
                  ],
                  "normalisers": [
                    {
                      "name": "link.price",
                      "expression": "$[0]"
                    }
                  ]
                }
              }
            },
            "dataSourceSpecBinding": {
              "settlementDataProperty": "link.price",
              "settlementScheduleProperty": "vegaprotocol.builtin.timetrigger"
            }
          }
        },
        "metadata": [
          "enactment:2023-12-09T04:00:00Z",
          "base:LINK",
          "quote:USD",
          "class:fx/crypto",
          "perpetual",
          "sector:defi"
        ],
        "priceMonitoringParameters": {
          "triggers": [
            {
              "horizon": "360",
              "probability": "0.9999999",
              "auctionExtension": "120"
            },
            {
              "horizon": "1440",
              "probability": "0.9999999",
              "auctionExtension": "180" 
            },
            {
              "horizon": "4320",
              "probability": "0.9999999",
              "auctionExtension": "300" 
            }
          ]
        },
        "liquidityMonitoringParameters": {
          "targetStakeParameters": {
            "timeWindow": "3600",
            "scalingFactor": 0.05
          },
          "triggeringRatio": "0.1",
          "auctionExtension": "1"
        },
        "logNormal": {
          "tau": 0.0000065,
          "riskAversionParameter": 0.000001,
          "params": {
            "mu": 0,
            "r": 0,
            "sigma": 1.5
          }
        },
        "liquiditySlaParameters": {
          "priceRange": "0.03",
          "commitmentMinTimeFraction": "0.85",
          "performanceHysteresisEpochs": "1",
          "slaCompetitionFactor": "0.5"
        }
      }
    },
    "closingTimestamp": 1702321200,
    "enactmentTimestamp": 1702321200
  }
}
1 Like

Looks sensible after a quick look, however please do let us get these enacted on Fairground first to explore the impact of those changes before submitting the proposals to mainnet. I’ll get to it in the next few days and report here when done.

1 Like

I’ve submitted VMP-24 to Fairground and VMP-23 to ETH/USD PERP on Fairground yesterday and they both went through fine and initial leverage was 50x (not in the UI though, that seems to be misrepresenting it a bit in the market info tab, I’m looking into it now - but that’s got nothing to do with updating the market, the same issue is present on mainnet).

Fairground is getting upgraded today so this changes will be lost, I can reapply them after the upgrade if you wish.

1 Like

UI issue I mentioned above has been fixed: fix(trading): amend formula for max leverage calc by witgaw · Pull Request #5462 · vegaprotocol/frontend-monorepo · GitHub

1 Like

Great, thanks for the update @Witold, I will update my post with the finalized JSON now and submit them on chain shortly.