From ce69f70a8fee24dc6bce36345049110b5c1e6885 Mon Sep 17 00:00:00 2001 From: candida-d <62548908+candida-d@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:29:31 +0100 Subject: [PATCH 1/7] proposal enhancements --- docs/api/building-blocks.md | 48 +-- docs/api/overview.md | 3 +- docs/api/public-endpoints.md | 9 +- docs/api/using-the-apis.md | 21 +- docs/concepts/trading-on-vega/fees.md | 7 + docs/tutorials/index.md | 5 +- docs/tutorials/proposals/_batch-sample.md | 2 - .../proposals/asset-transfer-proposal.md | 1 + docs/tutorials/proposals/freeform-proposal.md | 2 + .../proposals/market-state-proposal.md | 2 + .../proposals/network-parameter-proposal.md | 2 + .../proposals/new-market-proposal.md | 4 +- .../proposals/new-perpetuals-market.md | 6 +- docs/tutorials/proposals/new-spot-market.md | 14 +- .../new-successor-market-proposal.md | 2 + .../proposals/referral-program-proposal.md | 2 + .../proposals/update-asset-proposal.md | 9 +- .../proposals/update-market-proposal.md | 2 + .../tutorials/proposals/update-spot-market.md | 307 ++++++++++++++++++ .../volume-discount-program-proposal.md | 2 + docs/tutorials/using-data-sources.md | 132 +++++--- .../tutorials/proposals/_batch-sample.md | 2 - .../proposals/asset-transfer-proposal.md | 2 + .../tutorials/proposals/freeform-proposal.md | 2 + .../proposals/market-state-proposal.md | 2 + .../proposals/network-parameter-proposal.md | 2 + .../proposals/new-market-proposal.md | 4 +- .../proposals/new-perpetuals-market.md | 4 +- .../new-successor-market-proposal.md | 2 + .../proposals/referral-program-proposal.md | 2 + .../proposals/update-asset-proposal.md | 4 +- .../proposals/update-market-proposal.md | 2 + .../volume-discount-program-proposal.md | 2 + 33 files changed, 514 insertions(+), 98 deletions(-) create mode 100644 docs/tutorials/proposals/update-spot-market.md diff --git a/docs/api/building-blocks.md b/docs/api/building-blocks.md index 0bdcb1d2e..0885d3224 100644 --- a/docs/api/building-blocks.md +++ b/docs/api/building-blocks.md @@ -1,5 +1,5 @@ --- -title: Building blocks +title: Basic endpoints sidebar_position: 4 hide_title: false description: Building blocks of data and their APIs. @@ -8,6 +8,29 @@ vega_network: TESTNET While there are hundreds of available endpoints, the categories below cover the basics to get you started with understanding what you need to interact with Vega. +## Markets +Markets use accounts, are created with proposals, and allow parties to place orders with assets. + +| Description | Documentation | Call | +| ----------- | ----------- | ----------- | +| See all markets on the network | [List markets](../api/rest/data-v2/trading-data-service-list-markets.api.mdx) | `GET /api/v2/markets` +| Get information about a single market using the market's ID |[Market](../api/rest/data-v2/trading-data-service-get-market.api.mdx) | `GET /api/v2/market/:marketId` +| List the latest data for every market | [Markets data](../api/rest/data-v2/trading-data-service-list-latest-market-data.api.mdx) | `GET /api/v2/markets/data` +||| +| Understanding the concepts: market lifecycle | [Market lifecycle](../concepts/trading-on-vega/market-lifecycle.md) | + +## Orders and positions +An order is an instruction to buy or sell on a specific market, and it can go long or short on the market's price. Placing an order does not guarantee it gets filled, but if it is filled, it will result in a position, which will require collateral to use for margin to keep that position open. + +| Description | Documentation | Call | +| ----------- | ----------- | ----------- | +| Get information about an order using its ID | [Order](../api/rest/data-v2/trading-data-service-get-order.api.mdx) | `GET /api/v2/order/:orderId` | +| Get a list of orders that have been filtered based on information you provide |[List orders](../api/rest/data-v2/trading-data-service-list-orders.api.mdx) | `GET /api/v2/orders` +| Get a list of all positions for a specific party ID | [List positions](../api/rest/data-v2/trading-data-service-list-all-positions.api.mdx) | `GET /api/v2/positions` +| Get a paginated list of all trades, optionally filtered by party, market, or order | [List trades](/api/rest/data-v2/trading-data-service-list-trades.api.mdx) | `GET /api/v2/trades` +||| +| Understand the concepts: orders | [Orders](../concepts/trading-on-vega/orders.md) | + ## Parties A party is a single user, defined as a Vega public key. As one person or entity can have many public keys, this is a unique identifier as far as an individual key's actions. Party ID and public key (pubkey) are all names for the same thing. @@ -55,29 +78,6 @@ Vega relies on accounts to ensure funds are never lost or double spent. The amou ||| | Understanding the concepts: accounts | [Accounts](../concepts/assets/accounts.md) | -## Markets -Markets have accounts, are created with proposals, and allow parties to place orders with assets. - -| Description | Documentation | Call | -| ----------- | ----------- | ----------- | -| See all markets on the network | [List markets](../api/rest/data-v2/trading-data-service-list-markets.api.mdx) | `GET /api/v2/markets` -| Get information about a single market using the market's ID |[Market](../api/rest/data-v2/trading-data-service-get-market.api.mdx) | `GET /api/v2/market/:marketId` -| List the latest data for every market | [Markets data](../api/rest/data-v2/trading-data-service-list-latest-market-data.api.mdx) | `GET /api/v2/markets/data` -||| -| Understanding the concepts: market lifecycle | [Market lifecycle](../concepts/trading-on-vega/market-lifecycle.md) | - -## Orders and positions -An order is an instruction to buy or sell on a specific market, and it can go long or short on the market's price. Placing an order does not guarantee it gets filled, but if it is filled, it will result in a position, which will require collateral to use for margin to keep that position open. - -| Description | Documentation | Call | -| ----------- | ----------- | ----------- | -| Get information about an order using its ID | [Order](../api/rest/data-v2/trading-data-service-get-order.api.mdx) | `GET /api/v2/order/:orderId` | -| Get a list of orders that have been filtered based on information you provide |[List orders](../api/rest/data-v2/trading-data-service-list-orders.api.mdx) | `GET /api/v2/orders` -| Get a list of all positions for a specific party ID | [List positions](../api/rest/data-v2/trading-data-service-list-all-positions.api.mdx) | `GET /api/v2/positions` -| Get a paginated list of all trades, optionally filtered by party, market, or order | [List trades](/api/rest/data-v2/trading-data-service-list-trades.api.mdx) | `GET /api/v2/trades` -||| -| Understand the concepts: orders | [Orders](../concepts/trading-on-vega/orders.md) | - ## Governance proposals and voting Governance proposals used to add new assets and markets, as well as to suggest changes to assets, markets, and network parameters, as well as off-chain suggestions. VEGA tokens need to be associated to the Vega public key that wants to take part in governance. diff --git a/docs/api/overview.md b/docs/api/overview.md index edadd7c93..c28dd31cf 100644 --- a/docs/api/overview.md +++ b/docs/api/overview.md @@ -47,9 +47,10 @@ To access the Vega network, the wallet needs to be configured with the location If you have a client that you want use to send a transaction using the Vega wallet API, it will construct the transaction in JSON and pass it to the wallet. The wallet performs a client-side proof-of-work calculation, signs the transaction and forwards it to a node on the network before it is added to a block. It is also possible to have the wallet sign a transaction without sending it, if needed. Alternatively, you can build the signer into your client, though you'll need to account for the PoW calculations. :::note Go deeper +* **[Overview: Transactions for trading](./trading-transactions.md)**: See the commonly used transactions for trading. * **[Guide: How to build and send transactions](../tutorials/build-send-transactions.md)**: See how to build and send transactions using the Vega Wallet. -* **[Concept: Transactions](./../concepts/vega-chain/transactions.md)**: Learn about the concepts of transactions, commands, validation, and ordering. * **[API: Commands](./grpc/vega/commands/v1/commands.proto)** See a full list of transaction types. +* **[Concept: Transactions](./../concepts/vega-chain/transactions.md)**: Learn about the concepts of transactions, commands, validation, and ordering. ::: ### Transaction hashes diff --git a/docs/api/public-endpoints.md b/docs/api/public-endpoints.md index 952bd431e..a94030dcb 100644 --- a/docs/api/public-endpoints.md +++ b/docs/api/public-endpoints.md @@ -1,8 +1,8 @@ --- sidebar_position: 5 -title: Public endpoints +title: Public API servers hide_title: false -description: Vega's APIs are served over public endpoints. +description: Vega's APIs are served over public addresses. vega_network: TESTNET --- @@ -11,6 +11,7 @@ import DataNodes from '@site/src/components/DataNodes'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +## Servers for Vega APIs Due to the distributed nature of Vega, most of the APIs are served from a data node, and a few from a core node. This means there is no single API server, and users will need to choose a node to connect to. This differs from centralised services, as you can't connect to an API server run by a single company, nor does it require a specific access token. When you want to perform an action on the network you'll need to sign the message containing the transaction details with a [wallet app](../tools/vega-wallet/index.md) or a signer library. @@ -23,10 +24,10 @@ Below, find a list of all the known public servers available for this network, a [Data nodes](../concepts/vega-chain/data-nodes.md): Find out what a data node is, and if setting one up for yourself is right for you. ::: -## Node API endpoints: Fairground +## Node API servers: Fairground -## Node API endpoints: Validator testnet +## Node API servers: Validator testnet diff --git a/docs/api/using-the-apis.md b/docs/api/using-the-apis.md index a7f1a9db9..19216338b 100644 --- a/docs/api/using-the-apis.md +++ b/docs/api/using-the-apis.md @@ -12,7 +12,9 @@ import EthAddresses from '@site/src/components/EthAddresses'; ## Connecting to the APIs -As most of the APIs are designed to be used for trading-related queries, the best place to try them out is on the testnet network, also known as Fairground. The public endpoints differ between testnet and mainnet, as do the network configurations your Vega-compatible wallet needs in order to connect. See the [public endpoints page](./public-endpoints.md) for details. +As most of the APIs are designed to be used for trading-related queries, the best place to try them out is on the testnet network, also known as Fairground. + +The public endpoints differ between testnet and mainnet, as do the network configurations your Vega-compatible wallet needs in order to connect. See the [public endpoints page](./public-endpoints.md) for details. To use the Vega APIs, a developer will need access to a network-compatible instance of the relevant software, depending on their goals: core node, data node, and/or Vega Wallet. @@ -27,7 +29,7 @@ Some rate limiting is implemented with default limitations on the APIs. For the specifics on WebSocket connections, see [WebSocket streams](./websocket.md) page. -To prevent abuse of the APIs provided by data nodes, there are limitations to the rate of API requests that can be enabled by data node operators. Rate limiting is applied on a per-remote-IP-address basis. +Data node operators can limit the rate of API requests. Rate limiting is applied on a per-remote-IP-address basis. Each IP address that connects to a data node is assigned a bucket of tokens. That bucket has a maximum capacity, and begins full of tokens. Each API request costs one token, which is removed from the bucket when the call is made. The data node adds a number of tokens every second (the rate of the limiter) to the bucket up to its maximum capacity. @@ -50,7 +52,9 @@ If a client continues to make requests despite having no tokens available, the r * REST: `HTTP 429 StatusTooManyRequests for HTTP APIs` * gRPC: `14 Unavailable` -Each unsuccessful response will deduct a token from a separate bucket with the same refill rate and capacity as the requests bucket. Exhausting the supply of tokens in this second bucket will result in the client's IP address being banned for a period of time determined by the data node operators, with 10 minutes as the default. +Each unsuccessful response will deduct a token from a separate bucket with the same refill rate and capacity as the requests bucket. + +Exhausting the supply of tokens in this second bucket will result in the client's IP address being banned for a period of time determined by the data node operators, with 10 minutes as the default. If banned, the response will be `HTTP 403 Forbidden for HTTP APIs`. @@ -59,16 +63,16 @@ Read more about rate limiting in the [rate limiting README β†—](https://github.c ## Formatting and field conventions ### Strings vs numbers format -When using an API, in many cases the field is described as requiring a number but the data type is a string. Numerical fields are passed in string format so that there is no loss of precision, or risk of integer overflow for large numbers. +Often when an API requires a number, it uses the `string` data type. Numerical fields are passed in string format so that there is no loss of precision, or risk of integer overflow for large numbers. ### Decimal precision The APIs don't provide or accept decimal points in numbers or strings, so the decimal precision must be calculated and the number represented in integers, depending on what decimal precision the number needs. -* For quotes and prices, use the *market decimal places* to calculate, which can be found by [querying for a market's parameters](../api/rest/data-v2/trading-data-service-get-market.api.mdx) and using `decimalPlaces` -* For fees, margin, and liquidity, use the *settlement asset decimal places* to calculate, which can be found by [querying an asset's parameters](../api/rest/data-v2/trading-data-service-get-asset.api.mdx) and using `decimals` +* For quotes and prices, use the *market decimal places* to calculate, which can be found by [querying for a market's parameters](../api/rest/data-v2/trading-data-service-get-market.api.mdx) and using `decimalPlaces`. +* For fees, margin, and liquidity, use the *settlement asset decimal places* to calculate, which can be found by [querying an asset's parameters](../api/rest/data-v2/trading-data-service-get-asset.api.mdx) and using `decimals`. ### Timestamps -Unless otherwise specified, response timestamps, are encoded as a Unix timestamp, which is counted from midnight on 1 January, 1970. Requests that require timestamps will also need to be submitted in Unix time. Whether it's a nanosecond, second, or other, is signposted in the tutorial or API reference documentation. +Unless otherwise specified, response timestamps are encoded as a Unix timestamp, which is counted from midnight on 1 January, 1970. Requests that require timestamps will also need to be submitted in Unix time. Whether it's a nanosecond, second, or other, is signposted in the tutorial or API reference documentation. ## Available frameworks @@ -90,12 +94,13 @@ REST is easy to get started with, and Vega supports nearly all the functionality Try out queries and learn the structure with the [GraphQL playground β†—](https://api.testnet.vega.xyz/graphql/) -## Vega Wallet integration + ## Asset bridges Vega uses ERC-20 assets from Ethereum and Arbitrum, and to facilitate inter-chain interactions between Vega and other chains, those assets are then transferred through a series of smart contract bridges. These bridges let participants use ERC-20 and other assets on the (non-Ethereum) Vega chain. diff --git a/docs/concepts/trading-on-vega/fees.md b/docs/concepts/trading-on-vega/fees.md index 6186e56c2..300adb0d2 100644 --- a/docs/concepts/trading-on-vega/fees.md +++ b/docs/concepts/trading-on-vega/fees.md @@ -25,6 +25,13 @@ The amount a trader pays in fees for each order is the same regardless of how ma During a market's opening auction, no fees are collected. If a market is in a price monitoring auction, each side of a matched trade contributes 50% of the infrastructure and liquidity fees. Maker fees are not collected. +### Asset fees are paid in +Derivatives markets' fees are charged in the market's settlement asset. + +Spot markets' fees are charged in the market's quote asset. + +The aggressor *buying* the base asset for the quote asset pays more in their trade to cover the fees. The aggressor *selling* the base asset has the fees deducted from the quote asset amount they receive. + ### Fee distribution and breakdown Fees are calculated when a trade is filled, and paid in the market's settlement currency. The fees due are taken from the collateral in the trader's general account. diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md index b67725d40..68ec237b6 100644 --- a/docs/tutorials/index.md +++ b/docs/tutorials/index.md @@ -32,10 +32,11 @@ Take a look at the tutorials for help with using the Vega software. | πŸ›οΈ [Propose a new futures market](./proposals/new-market-proposal.md) | How to propose a new futures market | | πŸ’Ή [Propose a new spot market](./proposals/new-spot-market.md) | How to propose a new spot market | | β‡’ [Propose a new successor futures market](./proposals/new-successor-market-proposal.md) | How to propose a new successor futures market | -| πŸ›’ [Propose a change to a market](./proposals/update-market-proposal.md) | How to propose an update to market parameters | +| πŸ›’ [Propose changing a futures market](./proposals/update-market-proposal.md) | How to propose changing futures market parameters | +| πŸ›’ [Propose changing a spot market](./proposals/update-spot-market.md) | How to propose changing spot market parameters | | πŸͺ™ [Propose a new asset](./proposals/new-asset-proposal.md) | How to propose a new asset | | πŸŒ‰ [Update the asset bridge](./proposals/update-asset-bridge.md) | How to add the asset to the bridge after proposing it | -| πŸ’± [Propose a change to an asset](./proposals/update-asset-proposal.md) | How to propose an update to an asset | +| πŸ’± [Propose changing an asset](./proposals/update-asset-proposal.md) | How to propose changing an asset's parameters | | πŸ’‘ [Create a freeform proposal](./proposals/freeform-proposal.md) | How to create a freeform proposal | ## Community-created projects diff --git a/docs/tutorials/proposals/_batch-sample.md b/docs/tutorials/proposals/_batch-sample.md index 2e4c05d65..ead88eb37 100644 --- a/docs/tutorials/proposals/_batch-sample.md +++ b/docs/tutorials/proposals/_batch-sample.md @@ -1,5 +1,3 @@ - -## Submitting proposals in a batch If you want to submit this proposal as part of a larger batch of proposals, follow this sample structure: ``` diff --git a/docs/tutorials/proposals/asset-transfer-proposal.md b/docs/tutorials/proposals/asset-transfer-proposal.md index f141727bf..e6778445b 100644 --- a/docs/tutorials/proposals/asset-transfer-proposal.md +++ b/docs/tutorials/proposals/asset-transfer-proposal.md @@ -102,6 +102,7 @@ You will need to define the dispatch strategy, which includes the metric, the le "distributionStrategy": "DISTRIBUTION_STRATEGY_PRO_RATA" ``` +## Submitting proposals in a batch ## Templates and submitting diff --git a/docs/tutorials/proposals/freeform-proposal.md b/docs/tutorials/proposals/freeform-proposal.md index 802477fee..89d223f65 100644 --- a/docs/tutorials/proposals/freeform-proposal.md +++ b/docs/tutorials/proposals/freeform-proposal.md @@ -36,6 +36,8 @@ You will need: + +## Submitting proposals in a batch ## Templates and submitting diff --git a/docs/tutorials/proposals/market-state-proposal.md b/docs/tutorials/proposals/market-state-proposal.md index 11c93058b..7b74c5262 100644 --- a/docs/tutorials/proposals/market-state-proposal.md +++ b/docs/tutorials/proposals/market-state-proposal.md @@ -41,6 +41,8 @@ You will need: | `closingTimestamp` | Timestamp (Unix time in seconds) when voting closes for this proposal. The chosen time must be between and after the proposal submission time. (int64 as string) | | `enactmentTimestamp ` | Timestamp (Unix time in seconds) when proposal gets enacted (if passed). The chosen time must be between and after `closingTimestamp`. (int64 as string) | +## Submitting proposals in a batch + ## Suspend a market diff --git a/docs/tutorials/proposals/network-parameter-proposal.md b/docs/tutorials/proposals/network-parameter-proposal.md index 43386a780..b2494c48c 100644 --- a/docs/tutorials/proposals/network-parameter-proposal.md +++ b/docs/tutorials/proposals/network-parameter-proposal.md @@ -65,6 +65,8 @@ For example, a proposal to change the `rewards.activityStreak.benefitTiers` netw }" ``` +## Submitting proposals in a batch + diff --git a/docs/tutorials/proposals/new-market-proposal.md b/docs/tutorials/proposals/new-market-proposal.md index 8a5a7e473..239340486 100644 --- a/docs/tutorials/proposals/new-market-proposal.md +++ b/docs/tutorials/proposals/new-market-proposal.md @@ -97,7 +97,7 @@ An instrument contains the following properties: | `dataSourceSpecForSettlementData` | This defines the data source that will be used to identify the settlement price when the market expires. | prices.ORANGES.value | | `dataSourceSpecForTradingTermination` | The fields that define the data source used for terminating trading on the market. | vegaprotocol.builtin.timestamp | | `dataSourceSpecBinding` | The fields describe how specific information provided by the data source is used. For example, they can identify the specific name of the settlement price output, or the specific name of the trading termination property. | -| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. | A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. | +| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. A minimum of 10 is recommended. | 10 | For easy reading, the data source filters are separated out - see [Data source bindings](#data-source-bindings) below to see the fields for specifying data. @@ -225,6 +225,8 @@ Set up the liquidation strategy to minimise the impact of distressed traders on | `fullDisposalSize` | Size of the position that the network will try to close in a single attempt | 1 | | `maxFractionConsumed` | Maximum fraction of the order book's total volume, within the liquidity bounds, that the network can use to close its position. Range 0 through 1 | 0.05 | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/docs/tutorials/proposals/new-perpetuals-market.md b/docs/tutorials/proposals/new-perpetuals-market.md index f3216271c..dc5380e52 100644 --- a/docs/tutorials/proposals/new-perpetuals-market.md +++ b/docs/tutorials/proposals/new-perpetuals-market.md @@ -84,7 +84,7 @@ An instrument contains the following properties: | [`dataSourceSpecForSettlementData`](#data-source-for-settlement-data) | This defines the Ethereum data source, the method, normalisers, required confirmations, etc, that will be used to identify the settlement price when the market expires. | | | [`dataSourceSpecForSettlementSchedule`](#data-source-for-settlement-schedule) | This defines how the market will source data for funding, and how often to source it. | | | [`dataSourceSpecBinding`](#data-source-bindings) | The fields describe how specific information provided by the data source is used. For example, they are used to set the settlement data property and the settlement schedule property. | -| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. | A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. | +| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. A minimum of 10 is recommended. | 10 | ### Data source for settlement schedule The periodic settlements scheduled with the fields below determine how often the market's funding payments occur. It's recommended that funding payments are be less frequent than auction extensions for [price monitoring](#price-monitoring). Very frequent funding payments may lead to quick price changes in the market that participants may not have time to react to. Setting longer funding payment triggers allow for more time. @@ -127,7 +127,7 @@ Data source specs include the following properties under `ethOracle`: | `sourceChainId` | Describes the chain ID of the data source. This chain must already be enabled in network parameters and supported by validators. | :::info Submitting data -Learn how to find and submit data in the [submitting data sources tutorial](../using-data-sources.md). +Learn how to find and submit data in the [submitting data sources tutorial](../using-data-sources.md). This includes examples using Pyth and Ethereum data. ::: ### Liquidity monitoring @@ -225,6 +225,8 @@ The liquidity parameters set the requirements that liquidity providers on the ma | `liquidityFeeSettings` | Optional setting for how the liquidity fee factor is determined. See [liquidity fees](../../concepts/liquidity/rewards-penalties.md#determining-the-liquidity-fee-percentage) for more. | `METHOD_MARGINAL_COST` (default) `METHOD_CONSTANT`, `METHOD_WEIGHTED_AVERAGE` | | `feeConstant` | For the fee setting `METHOD_CONSTANT`, a constant fee factor needs to be provided. | 0.00005 | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/docs/tutorials/proposals/new-spot-market.md b/docs/tutorials/proposals/new-spot-market.md index 7edb3b679..a81d3639c 100644 --- a/docs/tutorials/proposals/new-spot-market.md +++ b/docs/tutorials/proposals/new-spot-market.md @@ -61,7 +61,7 @@ An instrument contains the following properties: | `baseAsset` | ?????? Settlement asset requires the ID of the asset that the market will be margined and settled in. You can get a list of supported assets by querying REST, GraphQL, or gRPC, and then selecting the asset ID. | | -| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. | A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. | +| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. A minimum of 10 is recommended. | 10| **Decimal places** need to be defined for both order sizes and the market. A market cannot specify more decimal places than its settlement asset supports. The values for these fields cannot be changed, even through governance. @@ -121,6 +121,9 @@ The risk model uses the following properties: | `param: r` | Annualised growth rate of the risk-free asset, it's used for discounting of future cash flows. Use 0.0 unless otherwise required.

Accepted values: any real number | 0.0 | | `param: sigma` | Annualised historic volatility of the underlying asset.

Accepted values: any strictly non-negative real number; suggested value: asset dependent, should be derived from the historical time-series of prices. | 0.8 (converts to 80%) | +## Submitting proposals in a batch + + ## Templates and submitting In the tabs below you'll see: @@ -148,11 +151,10 @@ In the tabs below you'll see: "changes": { "instrument": { "name": "Bitcoin / Tether USD (Spot)", - "code": "BTC/USDT", + "code": "BTC/USDT spot", "spot": { "baseAsset": "b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25", "quoteAsset": "948970482946248f0d04dd271d063cd44458822c67609d230e072d6d51d60956", - "name": "BTC/USDT" } }, "tickSize": "10", @@ -234,11 +236,10 @@ In the tabs below you'll see: "changes": { "instrument": { "name": "Bitcoin / Tether USD (Spot)", - "code": "BTC/USDT", + "code": "BTC/USDT spot", "spot": { "baseAsset": "b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25", "quoteAsset": "948970482946248f0d04dd271d063cd44458822c67609d230e072d6d51d60956", - "name": "BTC/USDT" } }, "tickSize": "10", @@ -321,11 +322,10 @@ vegawallet.exe transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KE \"sizeDecimalPlaces\": \"5\",^ \"instrument\": {^ \"name\": \"Bitcoin / Tether USD (Spot)\",^ - \"code\": \"BTC/USDT\",^ + \"code\": \"BTC/USDT spot\",^ \"spot\": {^ \"baseAsset\": \"b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25\",^ \"quoteAsset\": \"b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25\",^ - \"name\": \"BTC/USDT\",^ \"metadata\": [^ \"enactment:2024-04-23T15:14:03Z\",^ ],^ diff --git a/docs/tutorials/proposals/new-successor-market-proposal.md b/docs/tutorials/proposals/new-successor-market-proposal.md index b7cba90fa..6b3e627dd 100644 --- a/docs/tutorials/proposals/new-successor-market-proposal.md +++ b/docs/tutorials/proposals/new-successor-market-proposal.md @@ -46,6 +46,8 @@ The following `successor` parameters need to be used if you are proposing a mark * Parent market ID: Required to define the proposal as for a successor market * Insurance pool fraction: Required percentage of the parent market's insurance pool, up to 100%, can be earmarked for transfer to the successor market. It is submitted as a number between and including 0 and 1, which represents the factor for the percentage. +## Submitting proposals in a batch + ## Templates and submitting diff --git a/docs/tutorials/proposals/referral-program-proposal.md b/docs/tutorials/proposals/referral-program-proposal.md index d15d224f2..561d9a3df 100644 --- a/docs/tutorials/proposals/referral-program-proposal.md +++ b/docs/tutorials/proposals/referral-program-proposal.md @@ -58,6 +58,8 @@ To end an existing program early, set your proposal up with the exact same param | `minimumStakedTokens` | Required number of VEGA tokens a referrer must have associated to their Vega key to receive the reward multiplier | Integer greater than 0 | | `referralRewardMultiplier` | Multiplier applied when calculating referral rewards due to the referrer, if they meet the criteria | Whole number, decimals allowed, greater than or equal to 1 | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/docs/tutorials/proposals/update-asset-proposal.md b/docs/tutorials/proposals/update-asset-proposal.md index 9fb2f8029..1bb40335b 100644 --- a/docs/tutorials/proposals/update-asset-proposal.md +++ b/docs/tutorials/proposals/update-asset-proposal.md @@ -27,7 +27,8 @@ import Batch from './_batch-sample.md'; Some of the properties of an asset can be changed through governance. Those fields are: withdrawal and deposit limits, and the asset's quantum. -The underlying contract, asset name and symbol cannot be changed. +## Locked fields +The underlying contract, asset name and symbol cannot be changed. They are not included in the [proposal templates](#templates-and-submitting). ## Requirements @@ -41,17 +42,19 @@ After a new asset vote passes, the change has to be submitted to the asset bridg ## Anatomy of an update asset proposal The key inputs on an update asset proposal are as follows. -In addition to the parameters you want to change, you must include the existing parameters from the original new asset proposal, even if they are not being changed. +In addition to the parameters you want to change, you must include the existing editable parameters from the original new asset proposal, even if they are not being changed. **Rationale** requires a title and a description. They are free-text fields that describe the purpose of the proposal. Within the description, include links with more information about your proposal (such as to the IPFS content or forum post) that voters can reference to learn more about the asset proposal. Formatting your rationale with markdown makes it easier to read when it's displayed. | Field | Description | Example | | ----------- | ----------- | ----------- | -| `asset ID` | Unique Vega ID for the asset (string) | | +| `asset ID` | Unique Vega ID for the asset to be changed. (string) | | | `quantum` | The minimum economically meaningful amount of the asset (string). This should be the amount of the asset roughly equal to 1 USD. It is used in a number of ways by the protocol but only requires precision to an order of magnitude level. For example, if one BTC = 26,583 USD, then in this case a quantum of 1 / 25,000 or 0.00004 is sufficient. Converted to asset decimals it would be 40000000000000. | 1000000000000000000 | | `withdrawThreshold` | The maximum you can withdraw instantly. All withdrawals over the threshold will be delayed by the withdrawal delay, which can be seen on the ERC-20 bridge per asset. Setting this to 1 means all withdrawals will be subject to the delay. It's measured in asset decimals, so 1 is the smallest increment of the market's asset. | 1 | | `lifetimeLimit` | The lifetime deposit limit per public key, in asset decimals. Users are able to opt out of this functionality using the `exempt_depositor` write function on the ERC20 contract if they wish to. Suggested value: equivalent of 10,000 USD | 10000000000000000000000 | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/docs/tutorials/proposals/update-market-proposal.md b/docs/tutorials/proposals/update-market-proposal.md index 69ce37e3a..fe00af243 100644 --- a/docs/tutorials/proposals/update-market-proposal.md +++ b/docs/tutorials/proposals/update-market-proposal.md @@ -56,6 +56,8 @@ Note that some network parameters may differ, such as the limits on how long the | `closingTimestamp` | Timestamp (Unix time in seconds) when voting closes for this proposal. The chosen time must be between and after the proposal submission time. (int64 as string) | | `enactmentTimestamp ` | Timestamp (Unix time in seconds) when proposal gets enacted (if passed). The chosen time must be between and after `closingTimestamp`. (int64 as string) | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/docs/tutorials/proposals/update-spot-market.md b/docs/tutorials/proposals/update-spot-market.md new file mode 100644 index 000000000..a456e0e43 --- /dev/null +++ b/docs/tutorials/proposals/update-spot-market.md @@ -0,0 +1,307 @@ +--- +sidebar_position: 2 +title: Change a spot market +hide_title: true +vega_network: TESTNET +toc: true +keywords: + - proposal + - governance +--- + +import NetworkParameter from '@site/src/components/NetworkParameter'; +import JSONInstructions from './_json-instructions.md'; +import TerminalInstructions from './_terminal-instructions.md'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import Batch from './_batch-sample.md'; + +# Propose changes to spot market +Propose changes to an existing spot market. + +## Requirements + +You will need: +* A connected [Vega wallet](../../tools/vega-wallet/index.md), with your wallet name and public key to hand +* A minimum of whichever is larger, associated with that public key: () or () +* A minimum equity-like share in the market of +* Familiarity with [market governance](../../concepts/governance/market.md) on Vega + +## Anatomy of an update spot market proposal + +The update spot market proposal requires the same fields as a new spot market proposal, except the locked fields below. See the descriptions in the [new spot market proposal tutorial](new-spot-market.md#anatomy-of-a-market-proposal) for more on each field. + +In addition to the parameters you want to change, you must include all existing editable parameters from the original new market proposal, even if they are not being changed. + +### Locked fields + +The following fields cannot be changed. They are not included in the [proposal templates](#templates-and-submitting). + +- `sizeDecimalPlaces` +- `priceDecimalPlaces` +- `name` +- `code` +- `baseAsset` +- `quoteAsset` + +### Thresholds + +Note that some network parameters may differ, such as the limits on how long the voting period can last, as follows. + +| Field | Description | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `closingTimestamp` | Timestamp (Unix time in seconds) when voting closes for this proposal. The chosen time must be between and after the proposal submission time. (int64 as string) | +| `enactmentTimestamp ` | Timestamp (Unix time in seconds) when proposal gets enacted (if passed). The chosen time must be between and after `closingTimestamp`. (int64 as string) | + +## Submitting proposals in a batch + + + +## Templates and submitting +In the tabs below you'll see: + +* Annotated example describing what each field is for +* JSON example that can be submitted with the [governance dApp β†—](https://governance.fairground.wtf/proposals/propose/raw) +* Command line examples for different operating systems + +**Replace the example data with the relevant details before submitting.** + + + + + +```json +{ +"proposalSubmission": { + "rationale": { + "description": "Propose a change to the spot market for Bitcoin and USDT", + "title": "Change Bitcoin/USDT spot market" + } + "terms": { + "closingTimestamp": "1683626590", + "enactmentTimestamp": "1683626600", + "updateSpotMarket": { + "marketId: "123", + "changes": { + "tickSize": "10", + "metadata": [ + "base:BTC", + "quote:USDT", + "class:fx/crypto", + "spot", + "sector:defi", + ], + + "priceMonitoringParameters": { + "triggers": [ + { + "horizon": "21600", + "probability": "0.9999999", + "auctionExtension": "86400" + }, + { + "horizon": "4320", + "probability": "0.9999999", + "auctionExtension": "3600" + }, + { + "horizon": "1440", + "probability": "0.9999999", + "auctionExtension": "1800" + }, + { + "horizon": "360", + "probability": "0.9999999", + "auctionExtension": "300" + } + ] + }, + "targetStakeParameters": { + "timeWindow": "3600", + "scalingFactor": 0.05 + }, + "sizeDecimalPlaces": "4", + "slaParams": { + "priceRange": "0.03", + "commitmentMinTimeFraction": "0.75", + "performanceHysteresisEpochs": "1", + "slaCompetitionFactor": "0.8" + }, + "liquidityFeeSettings": { + "method": "METHOD_MARGINAL_COST" + }, + "logNormal": { + "riskAversionParameter": 1e-06, + "tau": 3.995e-06, + "params": { + "sigma": 1.0 + } + } + } + } + }, + } +} +``` + + + + +``` +./vegawallet transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KEY --network NETWORK_NAME '{ +"proposalSubmission": { + "rationale": { + "description": "Propose a spot market for Bitcoin and USDT", + "title": "Bitcoin/USDT spot market" + } + "terms": { + "closingTimestamp": "1683626590", + "enactmentTimestamp": "1683626600", + "updateSpotMarket": { + "marketId: "123", + "changes": { + "tickSize": "10", + "metadata": [ + "base:BTC", + "quote:USDT", + "class:fx/crypto", + "spot", + "sector:defi", + ], + + "priceMonitoringParameters": { + "triggers": [ + { + "horizon": "21600", + "probability": "0.9999999", + "auctionExtension": "86400" + }, + { + "horizon": "4320", + "probability": "0.9999999", + "auctionExtension": "3600" + }, + { + "horizon": "1440", + "probability": "0.9999999", + "auctionExtension": "1800" + }, + { + "horizon": "360", + "probability": "0.9999999", + "auctionExtension": "300" + } + ] + }, + "targetStakeParameters": { + "timeWindow": "3600", + "scalingFactor": 0.05 + }, + "sizeDecimalPlaces": "4", + "slaParams": { + "priceRange": "0.03", + "commitmentMinTimeFraction": "0.75", + "performanceHysteresisEpochs": "1", + "slaCompetitionFactor": "0.8" + }, + "liquidityFeeSettings": { + "method": "METHOD_MARGINAL_COST" + }, + "logNormal": { + "riskAversionParameter": 1e-06, + "tau": 3.995e-06, + "params": { + "sigma": 1.0 + } + } + } + } + }, + } +} +``` + + + + +``` +vegawallet.exe transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KEY --network NETWORK_NAME ^ +"{^ +\"proposalSubmission\": {^ + \"rationale\": {^ + \"title\": \"Add Lorem Ipsum market\",^ + \"description\": \"An example proposal to add Lorem Ipsum market\"^ + },^ + \"terms\": {^ + \"updateSpotMarket\": {^ + \"changes\": {^ + \"sizeDecimalPlaces\": \"5\",^ + \"metadata\": [^ + \"enactment:2024-04-23T15:14:03Z\",^ + ],^ + \"priceMonitoringParameters\": {^ + \"triggers\": [^ + {^ + \"horizon\": \"59000\",^ + \"probability\": \"0.0009099\",^ + \"auctionExtension\": \"3600\"^ + }^ + {^ + \"horizon\": \"88200\",^ + \"probability\": \"0.0000999\",^ + \"auctionExtension\": \"3600\"^ + }^ + ]^ + },^ + \"logNormal\": {^ + \"tau\": 3.995e-06,^ + \"riskAversionParameter\": 1e-06,^ + \"params\": {^ + \"sigma\": 1.0^ + }^ + },^ + \"liquiditySlaParameters\": {^ + \"priceRange\": \"0.03\",^ + \"commitmentMinTimeFraction\": \"0.75\",^ + \"performanceHysteresisEpochs\": \"1\",^ + \"slaCompetitionFactor\": \"0.8\"^ + },^ + \"liquidityFeeSettings\": {^ + \"method\": \"METHOD_CONSTANT\",^ + \"feeConstant\": \"0.00005\"^ + },^ + \"liquidityMonitoringParameters\": {^ + \"targetStakeParameters\": {^ + \"timeWindow\": \"3600\",^ + \"scalingFactor\": \"0.05\"^ + }^ + },^ + \"tickSize\": \"1\"^ + }^ + },^ + \"closingTimestamp\": 1713795243,^ + \"enactmentTimestamp\": 1713881643^ + }^ +}^ +}^ +}^ +}" +``` + + + +## Voting +All proposals are voted on by the community. + + + +To vote, community members need, at a minimum, the larger of or associated to their Vega key. + +Your proposal will need [participation](../../concepts/governance/lifecycle.md#how-the-outcome-is-calculated) of and a majority of , so having community support is essential. + +Proposers who invite feedback, engage with comments, and make revisions to meet the needs of the community are more likely to be successful. + +## Enactment +If successful, the proposal will be enacted at the time you specify in the `enactmentTimestamp` field. \ No newline at end of file diff --git a/docs/tutorials/proposals/volume-discount-program-proposal.md b/docs/tutorials/proposals/volume-discount-program-proposal.md index b5ede12f7..95560e1de 100644 --- a/docs/tutorials/proposals/volume-discount-program-proposal.md +++ b/docs/tutorials/proposals/volume-discount-program-proposal.md @@ -47,6 +47,8 @@ To end an existing program early, set your proposal up with the exact same param | `minimumRunningNotionalTakerVolume` | The notional volume of aggressive trades that a trader is required to have across the aggregation window, to access the discount in this tier | Integer greater than or equal to 1 | | `volumeDiscountFactor` | Proportion of each trader's fees to be discounted, will be converted to a percentage | Must be greater than or equal to 0 and less than / equal to | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/docs/tutorials/using-data-sources.md b/docs/tutorials/using-data-sources.md index 53aef8d4d..4e8c1863d 100644 --- a/docs/tutorials/using-data-sources.md +++ b/docs/tutorials/using-data-sources.md @@ -27,63 +27,117 @@ The **binding** tells the market which field contains the value. The **spec** de ## EVM data sources Settlement data can be sourced from smart contracts and EVM chains that support Ethereum RPC calls. +Data sources that use Ethereum RPC calls cause the Vega network validators to read the result from the specified smart contract and submit the result to Vega. When the data is verified by enough validators, this price is accepted on to the network. + +This is unlike the other two Oracle types ([Open Oracle signed messages](#open-oracle-signed-messages) & [JSON signed message data](#json-signed-message-data)),which both rely on a third party submitting data to the network. + + +### Using a Pyth price feed +Vega supports using Pyth price feeds, with data published to the Gnosis chain or other EVM chains. + +When considering a market to propose, check the [Pyth price feed IDs β†—](https://pyth.network/developers/price-feed-ids) to determine if Pyth provides the required price data feed. + +The following spec would read from the Gnosis contract at `0x28...17b43` to pull data from the Pyth price feed `0xe6...5b43` every 60 seconds, and fetch the Bitcoin price value from the returned object. + +You can use the snippet for contract and ABI details in your proposal. As long as the contract doesn't change, the ABI, which is managed by Pyth, also won’t change. + +```json +"dataSourceSpecForSettlementData": { + "external": { + "ethOracle": { + "address": "0x2880ab155794e7179c9ee2e38200202908c17b43", + "abi": "[{\n \"inputs\" : [\n {\n \"internalType\" : \"bytes32\",\n \"name\" : \"id\",\n \"type\" : \"bytes32\"\n }\n ],\n \"name\" : \"getPrice\",\n \"outputs\" : [\n {\n \"components\" : [\n {\n \"internalType\" : \"int64\",\n \"name\" : \"price\",\n \"type\" : \"int64\"\n },\n {\n \"internalType\" : \"uint64\",\n \"name\" : \"conf\",\n \"type\" : \"uint64\"\n },\n {\n \"internalType\" : \"int32\",\n \"name\" : \"expo\",\n \"type\" : \"int32\"\n },\n {\n \"internalType\" : \"uint256\",\n \"name\" : \"publishTime\",\n \"type\" : \"uint256\"\n }\n ],\n \"internalType\" : \"struct PythStructs.Price\",\n \"name\" : \"price\",\n \"type\" : \"tuple\"\n }\n ],\n \"stateMutability\" : \"view\",\n \"type\" : \"function\"\n }]", + "method": "getPrice", + "args": [ + "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43" + ], + "trigger": { + "timeTrigger": { + "every": "60" + } + }, + "requiredConfirmations": "3", + "filters": [ + { + "key": { + "name": "btc.price", + "type": "TYPE_INTEGER", + "numberDecimalPlaces": "8" + }, + "conditions": [{ + "operator": "OPERATOR_GREATER_THAN", + "value": "0" + }] + } + ], + "normalisers": [{ + "name": "btc.price", + "expression": "$[0].price" + }], + "sourceChainId": "100" + } + } +} +``` +### Using an Ethereum price feed The following spec would read from the Ethereum contract at `0x1b4...e43` every 30 seconds, and fetch the Bitcoin price value from the returned object: ```javascript "dataSourceSpecForSettlementData": { - "external": { - "ethOracle": { - "sourceChainId": "1", - "address": "0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43", - "abi": "[{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - "method": "latestRoundData", - "normalisers": [{ - "name": "btc.price", - "expression": "$[0]" - }], - "requiredConfirmations": 3, - "trigger": { - "timeTrigger": { - "every": 30 - } + "external": { + "ethOracle": { + "sourceChainId": "1", + "address": "0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43", + "abi": "[{\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + "method": "latestRoundData", + "normalisers": [{ + "name": "btc.price", + "expression": "$[0]" + }], + "requiredConfirmations": 3, + "trigger": { + "timeTrigger": { + "every": 30 + } + }, + "filters": [{ + "key": { + "name": "btc.price", + "type": "TYPE_INTEGER", + "numberDecimalPlaces": 8 }, - "filters": [{ - "key": { - "name": "btc.price", - "type": "TYPE_INTEGER", - "numberDecimalPlaces": 8 - }, - "conditions": [ - { - "operator": "OPERATOR_GREATER_THAN_OR_EQUAL", - "value": "0" - } - ] - } - ] - } - } + "conditions": [{ + "operator": "OPERATOR_GREATER_THAN_OR_EQUAL", + "value": "0" + }] + }] + } + } } ``` -This will cause the network validators to read the result from the specified smart contract and submit the result to Vega. When the data is verified by enough validators, this price is accepted on to the network. +### ABI +The `address` field in the specification tells the spec above which address to interact with on the chain. -This is unlike the other two Oracle types ([Open Oracle signed messages](#open-oracle-signed-messages) & [JSON signed message data](#json-signed-message-data)),which both rely on a third party submitting data to the network. +The `abi` ([Application Binary Interface β†—](https://docs.soliditylang.org/en/develop/abi-spec.html#json) & `method` field on the specs above tell the settlement spec **how** to interact with it. -### ABI -The `address` field in the specification tells the spec above which address to interact with on the chain. The `abi` ([Application Binary Interface](https://docs.soliditylang.org/en/develop/abi-spec.html#json) & `method` field on the spec above tells the settlement spec **how** to interact with it. EVM oracle settlement specifications use the JSON ABI of the smart contract to describe the method on the contract that will be called to fetch the data. The ABI will contain the function name, details of any paramters required, and the format of the response. +EVM oracle settlement specifications use the JSON ABI of the smart contract to describe the method on the contract that will be called to fetch the data. The ABI will contain the function name, details of any parameters required, and the format of the response. + +Examples: + +You can see the Pyth data feed ABI on [Gnosisscan β†—](https://gnosisscan.io/address/0x2880ab155794e7179c9ee2e38200202908c17b43#readProxyContract). When defining the data source spec, you can populate the `abi` field with the full ABI, and then set the `method` to `getPrice`. -For example, the [Chainlink BTC/USD oracle](https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd) has its JSON ABI [published on Etherscan](https://etherscan.io/address/0xf4030086522a5beea4988f8ca5b36dbc97bee88c#code). When defining the data source spec, you can populate the `abi` field with the full ABI, and then set the `method` to `latestRoundData`. +The [Chainlink BTC/USD oracle β†—](https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd) has its JSON ABI [published on Etherscan β†—](https://etherscan.io/address/0xf4030086522a5beea4988f8ca5b36dbc97bee88c#code). When defining the data source spec, you can populate the `abi` field with the full ABI, and then set the `method` to `latestRoundData`. :::note Shrinking the ABI -When populating the `abi` field on your data source spec, you can remove the methods and other fields that are not required by the oracle. We've done that in the sample data source above - only the `latestRoundData` method and its inputs and outputs are in the `abi` field. +When populating the `abi` field on your data source spec, you can remove the methods and other fields that are not required by the oracle. ::: ### Time trigger -As it says above, with EVM data source specs the validators will read the specified smart contract and method detailed in the ABI. The `trigger` instructs the validators when to do this. In the smple above, it will be called every 30 seconds. +As it says above, with EVM data source specs the validators will read the specified smart contract and method detailed in the ABI. The `trigger` instructs the validators when to do this. ### Normaliser -A [JSONPath](https://datatracker.ietf.org/wg/jsonpath/about/) expression use to extract data from the JSON returned from the method call. In the spec above, `expression` is set to `$[0]`, which returns the first item in an array. `$` would return the complete result. +A [JSONPath](https://datatracker.ietf.org/wg/jsonpath/about/) expression use to extract data from the JSON returned from the method call. In the examples above, `expression` is set to `$[0]`, which returns the first item in an array. `$` would return the complete result. ## Open Oracle signed messages Vega's data sourcing framework supports signed ABI-encoded [Open Oracle β†—](https://github.com/compound-finance/open-oracle) or JSON messages. ABI-encoded signed messages can be verified to have come from the public key that signed them, which allows markets on Vega to use pricing data sourced from Ethereum. diff --git a/versioned_docs/version-v0.75/tutorials/proposals/_batch-sample.md b/versioned_docs/version-v0.75/tutorials/proposals/_batch-sample.md index 2e4c05d65..ead88eb37 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/_batch-sample.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/_batch-sample.md @@ -1,5 +1,3 @@ - -## Submitting proposals in a batch If you want to submit this proposal as part of a larger batch of proposals, follow this sample structure: ``` diff --git a/versioned_docs/version-v0.75/tutorials/proposals/asset-transfer-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/asset-transfer-proposal.md index b8053628c..83e1559bb 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/asset-transfer-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/asset-transfer-proposal.md @@ -102,6 +102,8 @@ You will need to define the dispatch strategy, which includes the metric, the le "distributionStrategy": "DISTRIBUTION_STRATEGY_PRO_RATA" ``` +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/freeform-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/freeform-proposal.md index 445effa23..72f260f5c 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/freeform-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/freeform-proposal.md @@ -36,6 +36,8 @@ You will need: You should also share your proposal idea in the [_Freeform Proposals_ forum section β†—](https://community.vega.xyz/c/governance/free-form-proposals/31) before submitting it to the network. +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/market-state-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/market-state-proposal.md index 89fd85408..a8a1c18c0 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/market-state-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/market-state-proposal.md @@ -41,6 +41,8 @@ You will need: | `closingTimestamp` | Timestamp (Unix time in seconds) when voting closes for this proposal. The chosen time must be between and after the proposal submission time. (int64 as string) | | `enactmentTimestamp ` | Timestamp (Unix time in seconds) when proposal gets enacted (if passed). The chosen time must be between and after `closingTimestamp`. (int64 as string) | +## Submitting proposals in a batch + ## Suspend a market diff --git a/versioned_docs/version-v0.75/tutorials/proposals/network-parameter-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/network-parameter-proposal.md index 76433c1d2..0666cfa77 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/network-parameter-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/network-parameter-proposal.md @@ -65,6 +65,8 @@ For example, a proposal to change the `rewards.activityStreak.benefitTiers` netw }" ``` +## Submitting proposals in a batch + diff --git a/versioned_docs/version-v0.75/tutorials/proposals/new-market-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/new-market-proposal.md index 0f5c1d7d6..eab7f6015 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/new-market-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/new-market-proposal.md @@ -97,7 +97,7 @@ An instrument contains the following properties: | `dataSourceSpecForSettlementData` | This defines the data source that will be used to identify the settlement price when the market expires. | prices.ORANGES.value | | `dataSourceSpecForTradingTermination` | The fields that define the data source used for terminating trading on the market. | vegaprotocol.builtin.timestamp | | `dataSourceSpecBinding` | The fields describe how specific information provided by the data source is used. For example, they can identify the specific name of the settlement price output, or the specific name of the trading termination property. | -| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. | A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. | +| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. A minimum of 10 is recommended. | 10 | For easy reading, the data source filters are separated out - see [Data source bindings](#data-source-bindings) below to see the fields for specifying data. @@ -235,6 +235,8 @@ After the market has terminated, update the price by: 1. Submitting an [update market proposal](./update-market-proposal.md#submitting-a-verified-settlement-price) with the verified price 2. Sending the [settlement transaction](../using-data-sources.md#1-define-your-json-structure). +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/new-perpetuals-market.md b/versioned_docs/version-v0.75/tutorials/proposals/new-perpetuals-market.md index 14c5bc61d..e648b5fe4 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/new-perpetuals-market.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/new-perpetuals-market.md @@ -84,7 +84,7 @@ An instrument contains the following properties: | [`dataSourceSpecForSettlementData`](#data-source-for-settlement-data) | This defines the Ethereum data source, the method, normalisers, required confirmations, etc, that will be used to identify the settlement price when the market expires. | | | [`dataSourceSpecForSettlementSchedule`](#data-source-for-settlement-schedule) | This defines how the market will source data for funding, and how often to source it. | | | [`dataSourceSpecBinding`](#data-source-bindings) | The fields describe how specific information provided by the data source is used. For example, they are used to set the settlement data property and the settlement schedule property. | -| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. | A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. | +| `tickSize` | Sets the smallest possible change in the price in the market. Tick size is in relation to the market `decimalPlaces`, as an integer. If a BTCUSDT market is configured with 5 mdp, tick size 1 would make the smallest tick size 0.00001. Tick size can help manage a market with 'too many' decimal places, or an asset's value dropping dramatically. A value of 2000 with 5 `decimalPlaces` is a scaled tick size of 0.02. A minimum of 10 is recommended. | 10 | ### Data source for settlement schedule The periodic settlements scheduled with the fields below determine how often the market's funding payments occur. It's recommended that funding payments are be less frequent than auction extensions for [price monitoring](#price-monitoring). Very frequent funding payments may lead to quick price changes in the market that participants may not have time to react to. Setting longer funding payment triggers allow for more time. @@ -225,6 +225,8 @@ The liquidity parameters set the requirements that liquidity providers on the ma | `liquidityFeeSettings` | Optional setting for how the liquidity fee factor is determined. See [liquidity fees](../../concepts/liquidity/rewards-penalties.md#determining-the-liquidity-fee-percentage) for more. | `METHOD_MARGINAL_COST` (default) `METHOD_CONSTANT`, `METHOD_WEIGHTED_AVERAGE` | | `feeConstant` | For the fee setting `METHOD_CONSTANT`, a constant fee factor needs to be provided. | 0.00005 | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/new-successor-market-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/new-successor-market-proposal.md index 5b7c2f897..5e6812737 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/new-successor-market-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/new-successor-market-proposal.md @@ -46,6 +46,8 @@ The following `successor` parameters need to be used if you are proposing a mark * Parent market ID: Required to define the proposal as for a successor market * Insurance pool fraction: Required percentage of the parent market's insurance pool, up to 100%, can be earmarked for transfer to the successor market. It is submitted as a number between and including 0 and 1, which represents the factor for the percentage. +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/referral-program-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/referral-program-proposal.md index 9f7239e4f..d92ed72ac 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/referral-program-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/referral-program-proposal.md @@ -58,6 +58,8 @@ To end an existing program early, set your proposal up with the exact same param | `minimumStakedTokens` | Required number of VEGA tokens a referrer must have associated to their Vega key to receive the reward multiplier | Integer greater than 0 | | `referralRewardMultiplier` | Multiplier applied when calculating referral rewards due to the referrer, if they meet the criteria | Whole number, decimals allowed, greater than or equal to 1 | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/update-asset-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/update-asset-proposal.md index 56a76209b..671d0201e 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/update-asset-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/update-asset-proposal.md @@ -41,7 +41,7 @@ After a new asset vote passes, the change has to be submitted to the asset bridg ## Anatomy of an update asset proposal The key inputs on an update asset proposal are as follows. -In addition to the parameters you want to change, you must include the existing parameters from the original new asset proposal, even if they are not being changed. +In addition to the parameters you want to change, you must include the existing editable parameters from the original new asset proposal, even if they are not being changed. **Rationale** requires a title and a description. They are free-text fields that describe the purpose of the proposal. Within the description, include links with more information about your proposal (such as to the IPFS content or forum post) that voters can reference to learn more about the asset proposal. Formatting your rationale with markdown makes it easier to read when it's displayed. @@ -52,6 +52,8 @@ In addition to the parameters you want to change, you must include the existing | `withdrawThreshold` | The maximum you can withdraw instantly. All withdrawals over the threshold will be delayed by the withdrawal delay, which can be seen on the ERC-20 bridge per asset. Setting this to 1 means all withdrawals will be subject to the delay. It's measured in asset decimals, so 1 is the smallest increment of the market's asset. | 1 | | `lifetimeLimit` | The lifetime deposit limit per public key, in asset decimals. Users are able to opt out of this functionality using the `exempt_depositor` write function on the ERC20 contract if they wish to. Suggested value: equivalent of 10,000 USD | 10000000000000000000000 | +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/update-market-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/update-market-proposal.md index e9618a438..477cf6a31 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/update-market-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/update-market-proposal.md @@ -65,6 +65,8 @@ Under `dataSourceSpecForSettlementData`: Once the proposal passes the governance vote, the nominated Vega key (`dataSourceSpecForSettlementData` -> `signers` -> `pubkey`) will need to [submit the price to the network](../using-data-sources.md#submitting-JSON-data). +## Submitting proposals in a batch + ## Templates and submitting diff --git a/versioned_docs/version-v0.75/tutorials/proposals/volume-discount-program-proposal.md b/versioned_docs/version-v0.75/tutorials/proposals/volume-discount-program-proposal.md index ff539f681..91e4e2f98 100644 --- a/versioned_docs/version-v0.75/tutorials/proposals/volume-discount-program-proposal.md +++ b/versioned_docs/version-v0.75/tutorials/proposals/volume-discount-program-proposal.md @@ -47,6 +47,8 @@ To end an existing program early, set your proposal up with the exact same param | `minimumRunningNotionalTakerVolume` | The notional volume of aggressive trades that a trader is required to have across the aggregation window, to access the discount in this tier | Integer greater than or equal to 1 | | `volumeDiscountFactor` | Proportion of each trader's fees to be discounted, will be converted to a percentage | Must be greater than or equal to 0 and less than / equal to | +## Submitting proposals in a batch + ## Templates and submitting From 55cc90452e3ec47975901cf2fff2e3d53831d16b Mon Sep 17 00:00:00 2001 From: candida-d <62548908+candida-d@users.noreply.github.com> Date: Tue, 23 Apr 2024 18:30:09 +0100 Subject: [PATCH 2/7] update overview --- docs/api/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/overview.md b/docs/api/overview.md index c28dd31cf..1dac2ed26 100644 --- a/docs/api/overview.md +++ b/docs/api/overview.md @@ -47,7 +47,7 @@ To access the Vega network, the wallet needs to be configured with the location If you have a client that you want use to send a transaction using the Vega wallet API, it will construct the transaction in JSON and pass it to the wallet. The wallet performs a client-side proof-of-work calculation, signs the transaction and forwards it to a node on the network before it is added to a block. It is also possible to have the wallet sign a transaction without sending it, if needed. Alternatively, you can build the signer into your client, though you'll need to account for the PoW calculations. :::note Go deeper -* **[Overview: Transactions for trading](./trading-transactions.md)**: See the commonly used transactions for trading. + * **[Guide: How to build and send transactions](../tutorials/build-send-transactions.md)**: See how to build and send transactions using the Vega Wallet. * **[API: Commands](./grpc/vega/commands/v1/commands.proto)** See a full list of transaction types. * **[Concept: Transactions](./../concepts/vega-chain/transactions.md)**: Learn about the concepts of transactions, commands, validation, and ordering. From 6c8b2a9c6d728e754a2b9c9c54b91940e0154018 Mon Sep 17 00:00:00 2001 From: candida-d <62548908+candida-d@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:55:50 +0100 Subject: [PATCH 3/7] remove link --- docs/api/overview.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api/overview.md b/docs/api/overview.md index 1dac2ed26..e6949cfdb 100644 --- a/docs/api/overview.md +++ b/docs/api/overview.md @@ -47,7 +47,6 @@ To access the Vega network, the wallet needs to be configured with the location If you have a client that you want use to send a transaction using the Vega wallet API, it will construct the transaction in JSON and pass it to the wallet. The wallet performs a client-side proof-of-work calculation, signs the transaction and forwards it to a node on the network before it is added to a block. It is also possible to have the wallet sign a transaction without sending it, if needed. Alternatively, you can build the signer into your client, though you'll need to account for the PoW calculations. :::note Go deeper - * **[Guide: How to build and send transactions](../tutorials/build-send-transactions.md)**: See how to build and send transactions using the Vega Wallet. * **[API: Commands](./grpc/vega/commands/v1/commands.proto)** See a full list of transaction types. * **[Concept: Transactions](./../concepts/vega-chain/transactions.md)**: Learn about the concepts of transactions, commands, validation, and ordering. From 716cfd1ab3507aa3498ccf9ef4c96e1c8a979861 Mon Sep 17 00:00:00 2001 From: candida-d <62548908+candida-d@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:07:21 +0100 Subject: [PATCH 4/7] update using data sources --- docs/tutorials/using-data-sources.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/using-data-sources.md b/docs/tutorials/using-data-sources.md index 4e8c1863d..4aa90d76a 100644 --- a/docs/tutorials/using-data-sources.md +++ b/docs/tutorials/using-data-sources.md @@ -29,17 +29,16 @@ Settlement data can be sourced from smart contracts and EVM chains that support Data sources that use Ethereum RPC calls cause the Vega network validators to read the result from the specified smart contract and submit the result to Vega. When the data is verified by enough validators, this price is accepted on to the network. -This is unlike the other two Oracle types ([Open Oracle signed messages](#open-oracle-signed-messages) & [JSON signed message data](#json-signed-message-data)),which both rely on a third party submitting data to the network. - +Read on for examples and guidance on [ABIs](#abi), [normalisers](#normaliser) and [time trigger](#time-trigger). ### Using a Pyth price feed -Vega supports using Pyth price feeds, with data published to the Gnosis chain or other EVM chains. +Vega supports using Pyth price feeds, with data published to Gnosis or other EVM chains. When considering a market to propose, check the [Pyth price feed IDs β†—](https://pyth.network/developers/price-feed-ids) to determine if Pyth provides the required price data feed. The following spec would read from the Gnosis contract at `0x28...17b43` to pull data from the Pyth price feed `0xe6...5b43` every 60 seconds, and fetch the Bitcoin price value from the returned object. -You can use the snippet for contract and ABI details in your proposal. As long as the contract doesn't change, the ABI, which is managed by Pyth, also won’t change. +You can use the below snippet for contract and ABI details in your proposal. The ABI won't change as long as the contract, which is managed by Pyth, doesn't change. ```json "dataSourceSpecForSettlementData": { From 4ef7facd007fb81cc3d76854d54e1e70719e5162 Mon Sep 17 00:00:00 2001 From: candida-d <62548908+candida-d@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:05:01 +0100 Subject: [PATCH 5/7] fix json --- docs/tutorials/proposals/new-spot-market.md | 20 +-- .../tutorials/proposals/update-spot-market.md | 164 +++++++++--------- 2 files changed, 95 insertions(+), 89 deletions(-) diff --git a/docs/tutorials/proposals/new-spot-market.md b/docs/tutorials/proposals/new-spot-market.md index a81d3639c..548b70f05 100644 --- a/docs/tutorials/proposals/new-spot-market.md +++ b/docs/tutorials/proposals/new-spot-market.md @@ -143,7 +143,7 @@ In the tabs below you'll see: "rationale": { "description": "Propose a spot market for Bitcoin and USDT", "title": "Bitcoin/USDT spot market" - } + }, "terms": { "closingTimestamp": "1683626590", "enactmentTimestamp": "1683626600", @@ -154,7 +154,7 @@ In the tabs below you'll see: "code": "BTC/USDT spot", "spot": { "baseAsset": "b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25", - "quoteAsset": "948970482946248f0d04dd271d063cd44458822c67609d230e072d6d51d60956", + "quoteAsset": "948970482946248f0d04dd271d063cd44458822c67609d230e072d6d51d60956" } }, "tickSize": "10", @@ -164,7 +164,7 @@ In the tabs below you'll see: "quote:USDT", "class:fx/crypto", "spot", - "sector:defi", + "sector:defi" ], "priceMonitoringParameters": { @@ -214,7 +214,7 @@ In the tabs below you'll see: } } } - }, + } } } ``` @@ -228,7 +228,7 @@ In the tabs below you'll see: "rationale": { "description": "Propose a spot market for Bitcoin and USDT", "title": "Bitcoin/USDT spot market" - } + }, "terms": { "closingTimestamp": "1683626590", "enactmentTimestamp": "1683626600", @@ -239,7 +239,7 @@ In the tabs below you'll see: "code": "BTC/USDT spot", "spot": { "baseAsset": "b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25", - "quoteAsset": "948970482946248f0d04dd271d063cd44458822c67609d230e072d6d51d60956", + "quoteAsset": "948970482946248f0d04dd271d063cd44458822c67609d230e072d6d51d60956" } }, "tickSize": "10", @@ -249,7 +249,7 @@ In the tabs below you'll see: "quote:USDT", "class:fx/crypto", "spot", - "sector:defi", + "sector:defi" ], "priceMonitoringParameters": { @@ -299,7 +299,7 @@ In the tabs below you'll see: } } } - }, + } } } ``` @@ -325,9 +325,9 @@ vegawallet.exe transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KE \"code\": \"BTC/USDT spot\",^ \"spot\": {^ \"baseAsset\": \"b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25\",^ - \"quoteAsset\": \"b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25\",^ + \"quoteAsset\": \"b335cd4ba8a9c5b387b66117e5ee6dbd5a03fb7c74ee4a1d012589aafd45eb25\"^ \"metadata\": [^ - \"enactment:2024-04-23T15:14:03Z\",^ + \"enactment:2024-04-23T15:14:03Z\"^ ],^ \"priceMonitoringParameters\": {^ \"triggers\": [^ diff --git a/docs/tutorials/proposals/update-spot-market.md b/docs/tutorials/proposals/update-spot-market.md index a456e0e43..b02f19e3a 100644 --- a/docs/tutorials/proposals/update-spot-market.md +++ b/docs/tutorials/proposals/update-spot-market.md @@ -39,8 +39,6 @@ The following fields cannot be changed. They are not included in the [proposal t - `sizeDecimalPlaces` - `priceDecimalPlaces` -- `name` -- `code` - `baseAsset` - `quoteAsset` @@ -76,22 +74,25 @@ In the tabs below you'll see: "rationale": { "description": "Propose a change to the spot market for Bitcoin and USDT", "title": "Change Bitcoin/USDT spot market" - } + }, "terms": { "closingTimestamp": "1683626590", "enactmentTimestamp": "1683626600", "updateSpotMarket": { - "marketId: "123", + "marketId": "123", "changes": { + "instrument": { + "code": "BTC/USDT", + "name": "BTC/USDT" + }, "tickSize": "10", "metadata": [ "base:BTC", "quote:USDT", "class:fx/crypto", "spot", - "sector:defi", + "sector:defi" ], - "priceMonitoringParameters": { "triggers": [ { @@ -120,7 +121,6 @@ In the tabs below you'll see: "timeWindow": "3600", "scalingFactor": 0.05 }, - "sizeDecimalPlaces": "4", "slaParams": { "priceRange": "0.03", "commitmentMinTimeFraction": "0.75", @@ -139,7 +139,7 @@ In the tabs below you'll see: } } } - }, + } } } ``` @@ -148,76 +148,79 @@ In the tabs below you'll see: ``` -./vegawallet transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KEY --network NETWORK_NAME '{ -"proposalSubmission": { - "rationale": { - "description": "Propose a spot market for Bitcoin and USDT", - "title": "Bitcoin/USDT spot market" - } - "terms": { - "closingTimestamp": "1683626590", - "enactmentTimestamp": "1683626600", - "updateSpotMarket": { - "marketId: "123", - "changes": { - "tickSize": "10", - "metadata": [ - "base:BTC", - "quote:USDT", - "class:fx/crypto", - "spot", - "sector:defi", - ], - - "priceMonitoringParameters": { - "triggers": [ - { - "horizon": "21600", - "probability": "0.9999999", - "auctionExtension": "86400" - }, - { - "horizon": "4320", - "probability": "0.9999999", - "auctionExtension": "3600" - }, - { - "horizon": "1440", - "probability": "0.9999999", - "auctionExtension": "1800" - }, - { - "horizon": "360", - "probability": "0.9999999", - "auctionExtension": "300" +./vegawallet transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KEY --network NETWORK_NAME ' +{ + "proposalSubmission": { + "rationale": { + "description": "Propose a spot market for Bitcoin and USDT", + "title": "Bitcoin/USDT spot market", + "terms": { + "closingTimestamp": "1683626590", + "enactmentTimestamp": "1683626600", + "updateSpotMarket": { + "marketId": "123", + "changes": { + "instrument": { + "code": "BTC/USDT", + "name": "BTC/USDT" + }, + "tickSize": "10", + "metadata": [ + "base:BTC", + "quote:USDT", + "class:fx/crypto", + "spot", + "sector:defi" + ], + "priceMonitoringParameters": { + "triggers": [ + { + "horizon": "21600", + "probability": "0.9999999", + "auctionExtension": "86400" + }, + { + "horizon": "4320", + "probability": "0.9999999", + "auctionExtension": "3600" + }, + { + "horizon": "1440", + "probability": "0.9999999", + "auctionExtension": "1800" + }, + { + "horizon": "360", + "probability": "0.9999999", + "auctionExtension": "300" + } + ] + }, + "targetStakeParameters": { + "timeWindow": "3600", + "scalingFactor": 0.05 + }, + "slaParams": { + "priceRange": "0.03", + "commitmentMinTimeFraction": "0.75", + "performanceHysteresisEpochs": "1", + "slaCompetitionFactor": "0.8" + }, + "liquidityFeeSettings": { + "method": "METHOD_MARGINAL_COST" + }, + "logNormal": { + "riskAversionParameter": 0.000001, + "tau": 0.000003995, + "params": { + "sigma": 1 + } + } + } + } } - ] - }, - "targetStakeParameters": { - "timeWindow": "3600", - "scalingFactor": 0.05 - }, - "sizeDecimalPlaces": "4", - "slaParams": { - "priceRange": "0.03", - "commitmentMinTimeFraction": "0.75", - "performanceHysteresisEpochs": "1", - "slaCompetitionFactor": "0.8" - }, - "liquidityFeeSettings": { - "method": "METHOD_MARGINAL_COST" - }, - "logNormal": { - "riskAversionParameter": 1e-06, - "tau": 3.995e-06, - "params": { - "sigma": 1.0 - } } - } } - }, - } } ```
@@ -234,10 +237,14 @@ vegawallet.exe transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KE },^ \"terms\": {^ \"updateSpotMarket\": {^ + \"marketId\": \"123\", \"changes\": {^ - \"sizeDecimalPlaces\": \"5\",^ + \"instrument\": {^ + \"code\": \"BTC/USDT\",^ + \"name\": \"BTC/USDT\"^ + },^ \"metadata\": [^ - \"enactment:2024-04-23T15:14:03Z\",^ + \"enactment:2024-04-23T15:14:03Z\"^ ],^ \"priceMonitoringParameters\": {^ \"triggers\": [^ @@ -284,8 +291,7 @@ vegawallet.exe transaction send --wallet YOUR_WALLETNAME --pubkey YOUR_PUBLIC_KE }^ }^ }^ -}^ -}" +" ```
From 5d24a35cb60248471218714e453aecd2200f530e Mon Sep 17 00:00:00 2001 From: candida-d <62548908+candida-d@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:02:39 +0100 Subject: [PATCH 6/7] new reward metric --- docs/tutorials/assets-tokens/transferring-assets.md | 2 +- docs/tutorials/proposals/asset-transfer-proposal.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/assets-tokens/transferring-assets.md b/docs/tutorials/assets-tokens/transferring-assets.md index e297ff14f..2769c4e17 100644 --- a/docs/tutorials/assets-tokens/transferring-assets.md +++ b/docs/tutorials/assets-tokens/transferring-assets.md @@ -157,7 +157,7 @@ You will need to define the dispatch strategy, which includes the metric, the l | Dispatch strategy field | Description | Accepted values | | ----------- | ----------- | ----------- | | `assetForMetric` | Asset that's used to evaluate how someone performs, such as the settlement asset for the market(s) relevant to the reward | Any asset enabled on Vega | -| `metric` | Specific reward category the transfer is funding | DISPATCH_METRIC_MAKER_FEES_PAID; DISPATCH_METRIC_MAKER_FEES_RECEIVED; DISPATCH_METRIC_LP_FEES_RECEIVED; DISPATCH_METRIC_MARKET_VALUE; DISPATCH_METRIC_AVERAGE_POSITION; DISPATCH_METRIC_RELATIVE_RETURN; DISPATCH_METRIC_RETURN_VOLATILITY; DISPATCH_METRIC_VALIDATOR_RANKING | +| `metric` | Specific reward category the transfer is funding | DISPATCH_METRIC_MAKER_FEES_PAID; DISPATCH_METRIC_MAKER_FEES_RECEIVED; DISPATCH_METRIC_LP_FEES_RECEIVED; DISPATCH_METRIC_MARKET_VALUE; DISPATCH_METRIC_AVERAGE_POSITION; DISPATCH_METRIC_RELATIVE_RETURN; DISPATCH_METRIC_RETURN_VOLATILITY; DISPATCH_METRIC_REALISED_RETURN; DISPATCH_METRIC_VALIDATOR_RANKING | | `markets` | Optional: Used to choose which market(s) are in scope | Any trading market's ID | | `stakingRequirement` | Optional: Sets a minimum number of VEGA tokens that need to be staked for a party to be considered eligible for the reward | Number, if omitted it defaults to 0 | | `notionalTimeWeightedAveragePositionRequirement` | Optional: Sets a minimum notional TWAP required for a party to be considered eligible to receive rewards | Defaults to 0 | diff --git a/docs/tutorials/proposals/asset-transfer-proposal.md b/docs/tutorials/proposals/asset-transfer-proposal.md index e6778445b..ff75fbc6b 100644 --- a/docs/tutorials/proposals/asset-transfer-proposal.md +++ b/docs/tutorials/proposals/asset-transfer-proposal.md @@ -66,7 +66,7 @@ You will need to define the dispatch strategy, which includes the metric, the le | Dispatch strategy field | Description | Accepted values | | ----------- | ----------- | ----------- | | `assetForMetric` | Asset that's used to evaluate how someone performs. Use the settlement asset for the market(s) relevant to the reward. Not required for market creation and validator ranking rewards | Any asset enabled on Vega | -| `metric` | Specific reward category the transfer is funding | DISPATCH_METRIC_MAKER_FEES_PAID; DISPATCH_METRIC_MAKER_FEES_RECEIVED; DISPATCH_METRIC_LP_FEES_RECEIVED; DISPATCH_METRIC_MARKET_VALUE; DISPATCH_METRIC_AVERAGE_POSITION; DISPATCH_METRIC_RELATIVE_RETURN; DISPATCH_METRIC_RETURN_VOLATILITY; DISPATCH_METRIC_VALIDATOR_RANKING | +| `metric` | Specific reward category the transfer is funding | DISPATCH_METRIC_MAKER_FEES_PAID; DISPATCH_METRIC_MAKER_FEES_RECEIVED; DISPATCH_METRIC_LP_FEES_RECEIVED; DISPATCH_METRIC_MARKET_VALUE; DISPATCH_METRIC_AVERAGE_POSITION; DISPATCH_METRIC_RELATIVE_RETURN; DISPATCH_METRIC_RETURN_VOLATILITY; DISPATCH_METRIC_REALISED_RETURN; DISPATCH_METRIC_VALIDATOR_RANKING | | `markets` | Optional: Used to choose which market(s) are in scope. If left blank, all markets that are settled in the asset are included | Any trading market's ID | | `stakingRequirement` | Optional: Sets a minimum number of VEGA tokens that need to be staked for a party to be considered eligible for the reward | Number, if omitted it defaults to 0 | | `notionalTimeWeightedAveragePositionRequirement` | Optional: Sets a minimum notional TWAP, measured for the asset metric, that's required for a party to be considered eligible to receive rewards | Defaults to 0 | From 7a0f6babb673d42e7ab9e1a6a3a547fd4f175d9e Mon Sep 17 00:00:00 2001 From: candida-d <62548908+candida-d@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:56:32 +0100 Subject: [PATCH 7/7] tidy up formatting Co-authored-by: Edd --- docs/tutorials/using-data-sources.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/using-data-sources.md b/docs/tutorials/using-data-sources.md index 4aa90d76a..2a78f2b03 100644 --- a/docs/tutorials/using-data-sources.md +++ b/docs/tutorials/using-data-sources.md @@ -53,8 +53,8 @@ You can use the below snippet for contract and ABI details in your proposal. The "trigger": { "timeTrigger": { "every": "60" - } - }, + } + }, "requiredConfirmations": "3", "filters": [ {