VMP-010 - Create market BTC/WETH Future - 2023/12/31

Hi everyone!

Thank you for the broad community support on my WETH asset proposal.

Below is a proposal for a new BTC/WETH market to be created once the WETH asset passes governance vote. It is currently set to pass. I have filled in the spec as to the best of my abilities from docs. I’m unsure if the termination trigger is correct as the “New Market” docs mention a internal.time condition while the data source docs mention oracleSpecForTradingTermination.

For price monitoring I have chosen longer triggers from existing markets, as this is a brand new settlement asset.

Liquidity monitoring parameters I have used a time window of 1h, but left other parameters to their network defaults.

For the risk model I have also used the defaults from other markets, but I could calculate the volatility etc. from existing BTC/WETH defi markets on other platforms.

Some fields are left as “TBD” for now.

Please let me know if anything should change.

VMP-010 - Create market BTC/WETH Future - 2023/12/31

Market Summary:
Name
BTC/WETH expiry 2023 Dec 31st

Settlement asset
WETH

Rationale
BTC and ETH are the top decentralised cryptocurrencies. With the recent introduction of the WETH settlement asset, this will be the first market to allow traders to hedge risk between these two cryptocurrencies

Market/Update Details:
Instrument
BTC/WETH-231231

Settlement data oracle
Built-in data source based on time alone. This could be updated later if eg. the Ethereum Oracles spec is finalised and implemented. The Github issue currently says Q2 2022 which is obviously in the past, but the PR has had recent activity

Risk model
Log-normal risk model

Liquidity monitoring parameters

{
    "targetStakeParameters": {
        "timeWindow": "3600",
        "scalingFactor": 1
    },
    "triggeringRatio": null // Left empty to default
    "auctionExtension": null // Left empty to default to network parameter
}

Price monitoring parameters

{
  "triggers": [
    {
      "horizon": "14400",
      "probability": "0.9999",
      "auctionExtension": "180"
    },
    {
      "horizon": "43200",
      "probability": "0.9999",
      "auctionExtension": "300"
    }
  ]
}

Full Proposal JSON:

{
    "proposalSubmission": {
        "reference": "BTC/WETH-231231",
        "terms": {
            "closingTimestamp": "TBD",
            "enactmentTimestamp": "TBD",
            "newMarket": {
                "changes": {
                    "instrument": {
                        "name": "BTC/WETH expiry 2023 Dec 31st",
                        "code": "BTC/WETH-231231",
                        "future": {
                            "settlementAsset": "TBD",
                            "quoteName": "WETH",
                            "oracleSpecForTradingTermination": {
                                "pubkeys": [],
                                "filters": [{
                                    "key": {
                                        "name": "vegaprotocol.builtin.timestamp",
                                        "type": "TYPE_TIMESTAMP"
                                    },
                                    "conditions": [{
                                        "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                                        "value": "1704009600"
                                    }]
                                }],
                            }
                        }
                    },
                    "metadata": [
                        "base:BTC",
                        "quote:WETH",
                        "class:fx/crypto",
                        "half-yearly",
                        "sector:defi",
                        "enactment:2023-06-30T08:00:00Z",
                        "settlement:2023-12-31T08:00:00Z"
                    ],
                    "priceMonitoringParameters": {
                        "triggers": [
                            {
                                "horizon": "14400",
                                "probability": "0.9999",
                                "auctionExtension": "180"
                            },
                            {
                                "horizon": "43200",
                                "probability": "0.9999",
                                "auctionExtension": "300"
                            }
                        ]
                    },
                    "liquidityMonitoringParameters": {
                        "targetStakeParameters": {
                            "timeWindow": "3600",
                            "scalingFactor": 1
                        },
                        "triggeringRatio": null,
                        "auctionExtension": null
                    },
                    "logNormal": {
                        "riskAversionParameter": 0.000001,
                        "tau": 0.0001140771161,
                        "params": {
                            "sigma": 1.5
                        }
                    },
                    "decimalPlaces": "8",
                    "positionDecimalPlaces": "8",
                    "lpPriceRange": "0.8",
                    "linearSlippageFactor": "0.001",
                    "quadraticSlippageFactor": "0.0"
                }
            }
        },
        "rationale": {
            "description": "TBD",
            "title": "VMP-010 - Create market BTC/WETH Future - 2023/12/31"
        }
    }
}
1 Like

Hi there, interesting

Looking at this market, assuming WETH gets voted through, just so that I understand.
1: You want to launch a market that is not possible to terminate unless marketupdate proposal is voted through?

2: The assumption is to be able to use Ethereum Oracles?
Oracle for settlement needs to be included in the proposal either way, the proposal will be rejected at it’s current state.

I realised my proposal was wrong in the termination, binding and settlement sections. The docs are really fuzzy on this (sometimes they seem contradicting), so I tried to update the proposal with the below after having a read over the protocol buffer definitions in the API documentation:

{
  "rationale": {
    "description": "TBD",
    "title": "VMP-010 - Create market BTC/WETH Future - 2023/12/31"
  },
  "reference": "BTC/WETH-231231",
  "terms": {
    "closingTimestamp": "TBD",
    "enactmentTimestamp": "TBD",
    "newMarket": {
      "changes": {
        "decimalPlaces": "8",
        "positionDecimalPlaces": "8",
        "lpPriceRange": "0.8",
        "linearSlippageFactor": "0.001",
        "quadraticSlippageFactor": "0.0",
        "instrument": {
          "name": "BTC/WETH expiry 2023 Dec 31st",
          "code": "BTC/WETH-231231",
          "future": {
            "settlementAsset": "TBD",
            "quoteName": "WETH",
            "dataSourceSpecBinding": {
              "settlementDataProperty": "TBD",
              "tradingTerminationProperty": "vegaprotocol.builtin.timestamp"
            },
            "dataSourceSpecForSettlementData": {
              "internal": {
                "time": {
                  "conditions": [
                    {
                      "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                      "value": "1704009600"
                    }
                  ]
                }
              }
            },
            "dataSourceSpecForTradingTermination": {
              "internal": {
                "time": {
                  "conditions": [
                    {
                      "operator": "OPERATOR_GREATER_THAN_OR_EQUAL",
                      "value": "1704009600"
                    }
                  ]
                }
              }
            }
          }
        },
        "metadata": [
          "base:BTC",
          "quote:WETH",
          "class:fx/crypto",
          "half-yearly",
          "sector:defi",
          "enactment:2023-06-30T08:00:00Z",
          "settlement:2023-12-31T08:00:00Z"
        ],
        "priceMonitoringParameters": {
          "triggers": [
            {
              "horizon": "14400",
              "probability": "0.9999",
              "auctionExtension": "180"
            },
            {
              "horizon": "43200",
              "probability": "0.9999",
              "auctionExtension": "300"
            }
          ]
        },
        "liquidityMonitoringParameters": {
          "targetStakeParameters": {
            "timeWindow": "3600",
            "scalingFactor": 1
          },
          "triggeringRatio": null,
          "auctionExtension": null
        },
        "logNormal": {
          "riskAversionParameter": 0.000001,
          "tau": 0.0001140771161,
          "params": {
            "mu": 0.0,
            "sigma": 1.5,
            "r": 0.0
          }
        }
      }
    }
  }
}

To answer you questions;

  1. Yes and no. I realise a free-floating price that is not confirmed by any external data source has it issues, so hopefully the Ethereum Oracles or similar will solve this problem. It looks like there is already a lot of work that has been done on the Ethereum Oracles in the Vega repository, but I only had a cursory read of it. I guess it also depends on when and if Vega will have another network upgrade before this market terminates, and whether the community would vote for a market update to amend this market with an ethereum oracle.

  2. I have tried to update these sections in the proposal in this message. However I cannot clearly see how to settlementDataProperty (would have to find and read the relevant vega source code) and I’m not sure how dataSourceSpecForTradingTermination relates to dataSourceSpecForSettlementData relate, but it doesn’t seem right that both have a time based condition. I’d assume the latter would need to include some kind of internal vega condition to pick the settlement price?

Hey @X25519 when do you plan on submitting this as a formal proposal?

In case you do and want to use a verified settlement price, the docs has been updated and can be found here

So as an example, if this was the settings for the market, you can see there is no way to settle the market since the price is required to be above and below 0.

"dataSourceSpecForSettlementData": {
                                "external": {
                                    "oracle": {
                                        "signers": [
                                            {
                                                "pubKey": {
                                                    "key": "{YOUR_PUBLIC_KEY}"
                                                }
                                            }
                                        ],
                                        "filters": [
                                            {
                                                "key": {
                                                    "name": "prices.{whatever value makes sense to you e.g. BTC}.value",
                                                    "type": "TYPE_INTEGER",
                                                    "numberDecimalPlaces": "2"
                                                },
                                                "conditions": [
                                                    {
                                                        "operator": "OPERATOR_GREATER_THAN",
                                                        "value": "0"
                                                    },
                                                    {
                                                        "operator": "OPERATOR_LESS_THAN",
                                                        "value": "0"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            },



After the market has been terminated an updateMarket proposal should be made and it should be changed to the following as an example if the agreed upon price at termination was 29000,50.

As you can see it is very important to keep track of “numberDecimalPlaces”: “2”, so in the example you would only allow for the market to accept a settlement price of 2900050 which using "numberDecimalPlaces": "2" would mean 29000,50:

"dataSourceSpecForSettlementData": {
                                "external": {
                                    "oracle": {
                                        "signers": [
                                            {
                                                "pubKey": {
                                                    "key": "{YOUR_PUBLIC_KEY}"
                                                }
                                            }
                                        ],
                                        "filters": [
                                            {
                                                "key": {
                                                    "name": "prices.{whatever value makes sense to you e.g. BTC}.value",
                                                    "type": "TYPE_INTEGER",
                                                    "numberDecimalPlaces": "2"
                                                },
                                                "conditions": [
                                                    {
                                                        "operator": "OPERATOR_EQUALS",
                                                        "value": "2900050"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                }
                            },

The market would then be able to be settled by the specified key at the agreed upon price.

You can see the instructions in the doc’s

@X25519 Do you still plan to submit the proposal for the formal votation?

@davidella It may make sense to modify the proposal settlement setup to follow that of the proposal for the Doge market and also Doge/USDT proposal on chain.

Hey,

Now that Vega can ingest chainlink oracles, you can use the BTC/ETH chainlink oracle for the market.

It would also be cool to see a perps version

1 Like