Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.79.0 #11748

Merged
merged 141 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
e6e4b39
feat: reward scaling
ze97286 Aug 29, 2024
a12618e
Merge branch 'develop' into reward_scaling
ze97286 Sep 2, 2024
b37940e
chore: renumber AC codes
cdummett Sep 2, 2024
7cd606e
feat: add FT to check opening auction price
Jiajia-Cui Sep 4, 2024
c628e44
Merge branch 'develop' into reward_scaling
ze97286 Sep 5, 2024
343e616
Merge branch 'develop' into opening-auction-price-checking
Jiajia-Cui Sep 5, 2024
e25a351
feat: add type to loss socialisation event
EVODelavega Sep 5, 2024
78fe013
test: add unit tests for subscriber, fix migration by adding trigger
EVODelavega Aug 29, 2024
b05d565
chore: update changelog
EVODelavega Sep 3, 2024
7653656
test: add checks for funding payments and loss socialisation to integ…
EVODelavega Sep 2, 2024
0041905
chore: fix linter issue
EVODelavega Sep 3, 2024
2985b37
Merge pull request #11625 from vegaprotocol/11512-funding-payments
EVODelavega Sep 5, 2024
f999954
Merge branch 'develop' into opening-auction-price-checking
Jiajia-Cui Sep 5, 2024
b73aec7
Merge branch 'develop' into reward_scaling
ze97286 Sep 5, 2024
395b8a4
Merge pull request #11611 from vegaprotocol/reward_scaling
jeremyletang Sep 5, 2024
55fcc71
Merge branch 'develop' into opening-auction-price-checking
Jiajia-Cui Sep 6, 2024
c49691c
feat: add support for eligible keys
ze97286 Sep 6, 2024
ace37b7
Merge pull request #11651 from vegaprotocol/opening-auction-price-che…
Jiajia-Cui Sep 6, 2024
970c9b1
Merge branch 'develop' into eligible_keys
ze97286 Sep 6, 2024
83ee334
Merge pull request #11628 from vegaprotocol/eligible_keys
ze97286 Sep 6, 2024
f0dc5a7
feat: add fee fields to position entity
EVODelavega Sep 5, 2024
1f48f02
feat: track funding payment amount separately
EVODelavega Sep 3, 2024
bcd48f9
feat: add SQL support to Int type, add new fields to schema
EVODelavega Sep 6, 2024
3dd5245
fix: use decimal for all fields
EVODelavega Sep 5, 2024
f53e208
test: fix types in position test
EVODelavega Sep 5, 2024
ba936ee
chore: add missing header
EVODelavega Sep 5, 2024
ac73a65
Merge pull request #11661 from vegaprotocol/11519-positions-include-fees
EVODelavega Sep 6, 2024
fd06a97
fix: remove reference to public from query
EVODelavega Sep 6, 2024
8566286
Merge pull request #11662 from vegaprotocol/volume-discount-stats-fix
ze97286 Sep 7, 2024
7ae496c
fix: remove unneeded check for market length in GetPartyStats
ze97286 Sep 9, 2024
5ccec76
fix: Delay the final termination of a transfer to the following epoch
ze97286 Sep 9, 2024
2d3dd42
Merge pull request #11664 from vegaprotocol/fix_GetPartyStats
ze97286 Sep 9, 2024
ac760f3
Merge branch 'develop' into fix_rewards_last_epoch
ze97286 Sep 9, 2024
873fb3f
Merge pull request #11666 from vegaprotocol/fix_rewards_last_epoch
ze97286 Sep 9, 2024
ea8279a
fix: market-depth for AMM's when stepping over fair-price adds volume…
wwestgarth Sep 10, 2024
311e11f
Merge pull request #11668 from vegaprotocol/stop-amm-md-looking-crossed
wwestgarth Sep 10, 2024
34baa66
fix: add missing fees in gql bindings
jeremyletang Sep 11, 2024
30f651a
Merge pull request #11673 from vegaprotocol/fix/11672
jeremyletang Sep 11, 2024
9910cd9
fix: check for empty tier slices and use int for slice indexes
EVODelavega Sep 11, 2024
1faa950
Merge pull request #11675 from vegaprotocol/fix-underflow
jeremyletang Sep 11, 2024
8e1bb4d
feat: set max program window lenghts to 200
jeremyletang Sep 10, 2024
b31dff0
Merge pull request #11670 from vegaprotocol/feature/windowLenght-prog…
jeremyletang Sep 12, 2024
9c6f432
fix: check for nil values before dereferencing
EVODelavega Sep 12, 2024
2a7b888
Merge pull request #11677 from vegaprotocol/nil-ptr-fix
jeremyletang Sep 12, 2024
457aaf8
test: add coverage for HVMR rebate
EVODelavega Sep 12, 2024
7da43c8
test: remove redundant changes of netparams and tags
EVODelavega Sep 12, 2024
e252be2
chore: add missing AC codes
cdummett Sep 12, 2024
8c77171
test: add coverage for 0095-HVMR-001 through 0095-HVMR-005
EVODelavega Sep 12, 2024
3fd0317
chore: mark unit tests correctly
EVODelavega Sep 12, 2024
fde7f78
feat: add fee factor tests
cdummett Sep 12, 2024
2f119c3
Merge pull request #11678 from vegaprotocol/HVMR-coverage
EVODelavega Sep 12, 2024
aed34a0
fix: correct calculation of party market fees
ze97286 Sep 12, 2024
191396f
chore: add capping of the rebate to show actual value
ze97286 Sep 13, 2024
71adf92
Merge pull request #11680 from vegaprotocol/fix_rewards_last_epoch
jeremyletang Sep 13, 2024
9399e15
fix: handle PK conflicts for funding payments
EVODelavega Sep 13, 2024
2a9ed77
fix: typo in query
EVODelavega Sep 13, 2024
3ed0bf2
Merge pull request #11682 from vegaprotocol/11681-funding-fix
jeremyletang Sep 13, 2024
6011c39
fix: potential division by zero in notional reward metric evaluation …
ze97286 Sep 16, 2024
7573960
Merge pull request #11688 from vegaprotocol/11687
jeremyletang Sep 16, 2024
4d67353
fix: set max window length to 200
EVODelavega Sep 16, 2024
913fb42
Merge pull request #11689 from vegaprotocol/window-length-fix
jeremyletang Sep 16, 2024
ed09c32
feat: add validation when loading tendermint pubkey
jeremyletang Sep 17, 2024
605bb60
Merge pull request #11693 from vegaprotocol/feature/add-tendermint-pu…
jeremyletang Sep 17, 2024
9d038a2
fix: add resolver for high volume maker fee
ze97286 Sep 17, 2024
28205c0
Merge pull request #11694 from vegaprotocol/11672
jeremyletang Sep 17, 2024
be24096
chore: add graphql binding for estimate fees API
jeremyletang Sep 17, 2024
3a48987
Merge pull request #11697 from vegaprotocol/fix/11696
jeremyletang Sep 17, 2024
907189c
fix: recalculate stats when the program is updated
EVODelavega Sep 18, 2024
64c91f8
fix: update tests
EVODelavega Sep 18, 2024
d447626
feat: add tests for rebate program enactment
cdummett Sep 20, 2024
fe7d1e7
feat: add tests for discount program enactment
cdummett Sep 20, 2024
2afc66d
feat: add tests for referral program enactment
cdummett Sep 20, 2024
fbbe990
fix: calculate stats when no previous program was active, update unit…
EVODelavega Sep 20, 2024
cb16e84
feat: allow AMM's with zero volume price levels
wwestgarth Sep 23, 2024
a5b81a8
fix: make the linter happy, fix a lifecycle unit test
EVODelavega Sep 23, 2024
d025a29
Merge pull request #11701 from vegaprotocol/11642-spare-amms
wwestgarth Sep 23, 2024
8a6123f
fix: return a better error if Arbitrum bridge is missing from validat…
wwestgarth Sep 20, 2024
604858c
Merge pull request #11702 from vegaprotocol/11684-check-evm-bridge-co…
wwestgarth Sep 23, 2024
3a9358e
Merge branch 'develop' into 11699-update-factors
jeremyletang Sep 23, 2024
7887a8a
Merge pull request #11700 from vegaprotocol/11699-update-factors
EVODelavega Sep 23, 2024
9111d9c
fix: include most recent candles in the API response
EVODelavega Sep 23, 2024
285b0d5
chore: remove debug statements
EVODelavega Sep 23, 2024
2c65a87
fix: use current price in datanode lower curve estimate
wwestgarth Sep 24, 2024
7f0cc6b
fix: early exit if there are no expand-by-levels in datanode AMM mark…
wwestgarth Sep 24, 2024
d7e4fde
Merge pull request #11703 from vegaprotocol/fix-missing-candles
jeremyletang Sep 24, 2024
04e017d
Merge branch 'develop' into 11705-datanode-panics
jeremyletang Sep 24, 2024
c31bc64
Merge pull request #11706 from vegaprotocol/11705-datanode-panics
jeremyletang Sep 24, 2024
35c14ad
feat: add check on data node startup that DB schema version is what i…
wwestgarth Sep 25, 2024
79ae7ba
chore: add AC code to AMM test 035
wwestgarth Sep 25, 2024
023e6c4
feat: implement rejecting parties from a closed team, by updating the…
jeremyletang Sep 25, 2024
68f214e
Merge pull request #11710 from vegaprotocol/feature/remove-referee-fr…
jeremyletang Sep 26, 2024
6cf3625
fix: unmarshal referral prog discount factors properly when loading f…
wwestgarth Sep 26, 2024
62066e8
Merge pull request #11712 from vegaprotocol/fix-ref-discount-factors-…
jeremyletang Sep 26, 2024
24b2955
feat: buy back auctions
ze97286 Sep 26, 2024
1c9c82c
Merge pull request #11686 from vegaprotocol/bb_auctions
ze97286 Sep 27, 2024
6232158
feat: cache AMM best-price and volume to help performance
wwestgarth Sep 27, 2024
5ab27fb
Merge pull request #11716 from vegaprotocol/amm-cache-best-prices
wwestgarth Sep 27, 2024
41f9c6f
fix: init pool cache in snapshot path, and write a snapshot test
wwestgarth Sep 30, 2024
6418019
Merge pull request #11719 from vegaprotocol/fix-amm-snapshot
wwestgarth Sep 30, 2024
02a0ae1
fix: allow nil initial time in time trigger + add pap to market data …
ze97286 Oct 1, 2024
e4d0ad6
Merge pull request #11723 from vegaprotocol/bb_api
ze97286 Oct 1, 2024
5f5ca99
feat: combine AMM uncrossing orders to increase performance an reduce…
wwestgarth Oct 1, 2024
2cbe43a
fix: avoid trading across discontinuity at and AMMs base price
wwestgarth Oct 1, 2024
7949197
Merge pull request #11725 from vegaprotocol/11715-split-at-discontinu…
jeremyletang Oct 1, 2024
0f99c0a
Merge branch 'develop' into amm-combine-expanded-for-uncross
jeremyletang Oct 1, 2024
0e458e3
Merge pull request #11727 from vegaprotocol/amm-combine-expanded-for-…
jeremyletang Oct 1, 2024
bf12d16
fix: remove subscription from main map when channel is closed on firs…
EVODelavega Sep 25, 2024
ad55a00
fix: close non-nil channel
EVODelavega Oct 1, 2024
d486186
docs: add integration test docs
EVODelavega Sep 6, 2024
1939883
docs: add governance and oracle documentation
EVODelavega Sep 6, 2024
daa4aa2
test: add fees and funding payments to positions plugin, fix bug with…
EVODelavega Sep 10, 2024
5abcd2f
test: add fee support and docs
EVODelavega Sep 10, 2024
40b5ab5
chore: update loss socialisation event interface
EVODelavega Sep 24, 2024
d365b99
Merge pull request #11709 from vegaprotocol/candle-panic
jeremyletang Oct 2, 2024
cb2a62a
Merge branch 'develop' into integration-docs
jeremyletang Oct 2, 2024
a623d5a
Merge pull request #11707 from vegaprotocol/integration-docs
jeremyletang Oct 2, 2024
6fe07a5
fix: handle pap expiry correctly
ze97286 Oct 2, 2024
ac9993d
Merge pull request #11729 from vegaprotocol/fix_expiry
ze97286 Oct 2, 2024
8abe15c
fix: break out of correct loop when slow subscribers
wwestgarth Oct 3, 2024
ba1d73a
Merge pull request #11730 from vegaprotocol/candle-thing
jeremyletang Oct 7, 2024
1344c3e
fix: rework candle service, use mutex
EVODelavega Oct 7, 2024
c8ad7c5
fix: ignore when the candle was updated, always re-send the current c…
EVODelavega Oct 8, 2024
7ba8322
fix: ensure the last candle is a non-zero candle generated to fill th…
EVODelavega Oct 8, 2024
85a3438
Merge pull request #11735 from vegaprotocol/candle-missing
jeremyletang Oct 9, 2024
4527359
fix: when uncrossing after auction refine approximately expanded AMMs…
wwestgarth Oct 9, 2024
2a40697
Merge pull request #11736 from vegaprotocol/11715-amm-crossing
jeremyletang Oct 9, 2024
8391227
fix: division by zero fix
EVODelavega Oct 7, 2024
df52e26
Merge pull request #11734 from vegaprotocol/division-by-zero
EVODelavega Oct 9, 2024
ac37af8
feat: implement an allow list on market for the sell side
voltaireChocolatine Oct 4, 2024
260cc2e
Merge pull request #11731 from Nebula-DEX/feature/locked-sell
jeremyletang Oct 17, 2024
67acf67
feat: allow AMM base price to be automatically amended by an oracle p…
wwestgarth Oct 21, 2024
0bea846
Merge pull request #11740 from vegaprotocol/base-price-oracle
wwestgarth Oct 21, 2024
fe322e8
feat: add staking staking from collateral asset
jeremyletang Oct 15, 2024
678f5c8
feat: add test for vesting
jeremyletang Oct 18, 2024
caca053
chore: add tests for banking
jeremyletang Oct 18, 2024
cad4951
chore: add tests for banking
jeremyletang Oct 18, 2024
ef17f31
chore: Apply suggestions from code review
jeremyletang Oct 19, 2024
8e4733b
fix: include new lock-for-staking account as an allowable account in …
wwestgarth Oct 22, 2024
cc1cdaf
fix: avoid paying fee with staking related transfers
jeremyletang Oct 22, 2024
1e3d406
Merge pull request #11743 from vegaprotocol/feature/staking-from-coll…
jeremyletang Oct 22, 2024
1d5115e
chore: release v0.79.0
jeremyletang Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 35 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Unreleased 0.79.0
## Unreleased 0.80.0

### 🚨 Breaking changes

Expand All @@ -19,6 +19,33 @@
- [](https://github.com/vegaprotocol/vega/issues/xxx)


## 0.79.0

### 🛠 Improvements

- [11644](https://github.com/vegaprotocol/vega/issues/11644) - `liveOnly` flag has been added to the `AMM` API to show only active `AMMs`.
- [11519](https://github.com/vegaprotocol/vega/issues/11519) - Add fees to position API types.
- [11714](https://github.com/vegaprotocol/vega/issues/11714) - Improve `AMM` performance by caching best prices and volumes.
- [11642](https://github.com/vegaprotocol/vega/issues/11642) - `AMMs` with empty price levels are now allowed.
- [11685](https://github.com/vegaprotocol/vega/issues/11685) - Automated purchase support added.
- [11732](https://github.com/vegaprotocol/vega/issues/11732) - `AMMs` can now have their base price automatically updated by a market's data source.
- [11685](https://github.com/vegaprotocol/vega/issues/11685) - Automated purchase support added.
- [11726](https://github.com/vegaprotocol/vega/issues/11726) - Combined `AMM` uncrossing orders for better performance when uncrossing the book.
- [11711](https://github.com/vegaprotocol/vega/issues/11711) - Manage closed team membership by updating the allow list.
- [11722](https://github.com/vegaprotocol/vega/issues/11722) - Expose active protocol automated purchase identifier in market data API.
- [11744](https://github.com/vegaprotocol/vega/issues/11744) - Staking from collateral bridged assets.

### 🐛 Fixes

- [11672](https://github.com/vegaprotocol/vega/issues/11672) - Add missing fees in GraphQL bindings.
- [11681](https://github.com/vegaprotocol/vega/issues/11681) - Account for conflicts inserting funding payment records.
- [11715](https://github.com/vegaprotocol/vega/issues/11715) - Trade across an `AMMs` base price in two steps since the curves either side will be different.
- [11684](https://github.com/vegaprotocol/vega/issues/11684) - Better error when `Arbitrum` bridge details are missing from validator configuration.
- [11696](https://github.com/vegaprotocol/vega/issues/11696) - Add binding for estimate fees API.
- [11699](https://github.com/vegaprotocol/vega/issues/11699) - Update factors of programs when they are updated.
- [11724](https://github.com/vegaprotocol/vega/issues/11724) - Allow nil initial time in time trigger.
- [11733](https://github.com/vegaprotocol/vega/issues/11733) - Fix division by zero.

## 0.78.2

### 🛠 Improvements
Expand All @@ -33,8 +60,10 @@
- [11650](https://github.com/vegaprotocol/vega/issues/11650) - Add include sub accounts flag to `listPositions`.
- [11641](https://github.com/vegaprotocol/vega/issues/11641) - Panic with pegged orders.
- [11646](https://github.com/vegaprotocol/vega/issues/11646) - Add tier numbers to API.


- [11665](https://github.com/vegaprotocol/vega/issues/11665) - Delay the final termination of a transfer to the following epoch.
- [11679](https://github.com/vegaprotocol/vega/issues/11679) - Fix calculation of fees in party `stats`.
- [11665](https://github.com/vegaprotocol/vega/issues/11665) - Delay the final termination of a transfer to the following epoch.
- [11687](https://github.com/vegaprotocol/vega/issues/11687) - Fix potential division by zero in notional reward metric evaluation.
## 0.78.1

### 🐛 Fixes
Expand Down Expand Up @@ -65,7 +94,10 @@
- [11533](https://github.com/vegaprotocol/vega/issues/11533) - Suppose per party fee discounts in fee estimation.
- [11577](https://github.com/vegaprotocol/vega/issues/11577) - Add API for party discounts and rewards.
- [10716](https://github.com/vegaprotocol/vega/issues/10716) - Set Tendermint defaults during init.
- [11612](https://github.com/vegaprotocol/vega/issues/11612) - Reward scaling support.
- [11624](https://github.com/vegaprotocol/vega/issues/11624) - prevent creation of rewards with no payout, but with high computational cost.
- [11512](https://github.com/vegaprotocol/vega/issues/11512) - Add loss socialisation amounts to funding payment API.
- [11627](https://github.com/vegaprotocol/vega/issues/11627) - Add eligible keys filter to reward transfers.

### 🐛 Fixes

Expand All @@ -78,7 +110,6 @@
- [11568](https://github.com/vegaprotocol/vega/issues/11568) - order book shape on closing `AMM` no longer panics.
- [11540](https://github.com/vegaprotocol/vega/issues/11540) - Fix spam check for spots to use not double count quantum.
- [11542](https://github.com/vegaprotocol/vega/issues/11542) - Fix non determinism in lottery ranking.
- [11616](https://github.com/vegaprotocol/vega/issues/11616) - `AMM` tradable volume now calculated purely in positions to prevent loss of precision.
- [11544](https://github.com/vegaprotocol/vega/issues/11544) - Fix empty candles stream.
- [11583](https://github.com/vegaprotocol/vega/issues/11583) - Rough bound on price interval when matching with `AMMs` is now looser and calculated in the `AMM` engine.
- [11633](https://github.com/vegaprotocol/vega/issues/11633) - Use bridge deployment heights from network parameter when starting network from genesis.
Expand All @@ -89,7 +120,6 @@
- [11607](https://github.com/vegaprotocol/vega/issues/11607) - Wire rank lottery distribution to team reward payout.
- [959](https://github.com/vegaprotocol/core-test-coverage/issues/959) - Include `ELS` for `AMM` sub keys to the parent key `ELS`.
- [11592](https://github.com/vegaprotocol/vega/issues/11592) - Fix the order of calls at end of epoch between rebate engine and market tracker.
- [10907](https://github.com/vegaprotocol/vega/issues/10907) - Fix position API distressed status not getting updated once the party has been closed out.


## 0.77.5
Expand Down
6 changes: 6 additions & 0 deletions cmd/data-node/commands/start/node_pre.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ func (l *NodeCommand) persistentPre([]string) (err error) {
return fmt.Errorf("failed to apply data retention policies:%w", err)
}

// check that the schema version matches the latest migration, because if it doesn't queries might fail if rows/tables
// it expects to exist don't
if err := sqlstore.CheckSchemaVersionsSynced(l.Log, conf.SQLStore.ConnectionConfig, sqlstore.EmbedMigrations); err != nil {
return err
}

preLog.Info("Enabling SQL stores")

l.transactionalConnectionSource, err = sqlstore.NewTransactionalConnectionSource(l.ctx, preLog, l.conf.SQLStore.ConnectionConfig)
Expand Down
7 changes: 7 additions & 0 deletions cmd/vega/commands/nodewallet/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package nodewallet

import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -137,6 +138,12 @@ func (opts *importCmd) Execute(_ []string) error {
}
}

// validate the key is base64
_, err := base64.StdEncoding.DecodeString(tendermintPubkey)
if err != nil {
return fmt.Errorf("tendermint pubkey must be base64 encoded: %w", err)
}

data, err = nodewallets.ImportTendermintPubkey(vegaPaths, registryPass, tendermintPubkey, opts.Force)
if err != nil {
return fmt.Errorf("couldn't import Tendermint pubkey: %w", err)
Expand Down
28 changes: 23 additions & 5 deletions commands/amend_amm.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,26 @@ func checkAmendAMM(cmd *commandspb.AmendAMM) Errors {
}
}

if cmd.MinimumPriceChangeTrigger != nil {
if minPriceChange, err := num.DecimalFromString(*cmd.MinimumPriceChangeTrigger); err != nil {
errs.AddForProperty("submit_amm.mimimum_price_change_trigger", ErrIsNotValid)
} else if minPriceChange.LessThan(num.DecimalZero()) {
errs.AddForProperty("submit_amm.proposed_fee", ErrMustBePositiveOrZero)
}
}

if cmd.ConcentratedLiquidityParameters != nil {
var haveLower, haveUpper, emptyBase bool
hasUpdate = true
var base, lowerBound, upperBound *big.Int
if base, _ = big.NewInt(0).SetString(cmd.ConcentratedLiquidityParameters.Base, 10); base == nil {
if len(cmd.ConcentratedLiquidityParameters.Base) == 0 {
emptyBase = true
} else if base, _ = big.NewInt(0).SetString(cmd.ConcentratedLiquidityParameters.Base, 10); base == nil {
errs.FinalAddForProperty("amend_amm.concentrated_liquidity_parameters.base", ErrIsNotValidNumber)
} else if base.Cmp(big.NewInt(0)) <= 0 {
errs.AddForProperty("amend_amm.concentrated_liquidity_parameters.base", ErrMustBePositive)
}

var haveLower, haveUpper bool
if cmd.ConcentratedLiquidityParameters.LowerBound != nil {
haveLower = true
if lowerBound, _ = big.NewInt(0).SetString(*cmd.ConcentratedLiquidityParameters.LowerBound, 10); lowerBound == nil {
Expand Down Expand Up @@ -124,11 +134,19 @@ func checkAmendAMM(cmd *commandspb.AmendAMM) Errors {
}

if len(cmd.SlippageTolerance) <= 0 {
errs.AddForProperty("submit_amm.slippage_tolerance", ErrIsRequired)
errs.AddForProperty("amend_amm.slippage_tolerance", ErrIsRequired)
} else if slippageTolerance, err := num.DecimalFromString(cmd.SlippageTolerance); err != nil {
errs.AddForProperty("submit_amm.slippage_tolerance", ErrIsNotValidNumber)
errs.AddForProperty("amend_amm.slippage_tolerance", ErrIsNotValidNumber)
} else if slippageTolerance.LessThan(num.DecimalZero()) {
errs.AddForProperty("submit_amm.slippage_tolerance", ErrMustBePositive)
errs.AddForProperty("amend_amm.slippage_tolerance", ErrMustBePositive)
}

if cmd.ConcentratedLiquidityParameters.DataSourceId == nil && emptyBase {
errs.AddForProperty("amend_amm.concentrated_liquidity_parameters.base", ErrIsRequired)
}

if cmd.ConcentratedLiquidityParameters.DataSourceId != nil && !IsVegaID(*cmd.ConcentratedLiquidityParameters.DataSourceId) {
errs.AddForProperty("amend_amm.data_source_id", ErrShouldBeAValidVegaID)
}
}

Expand Down
2 changes: 1 addition & 1 deletion commands/amend_amm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestCheckAmendAMM(t *testing.T) {
Base: "",
},
},
errStr: "amend_amm.concentrated_liquidity_parameters.base (is not a valid number)",
errStr: "amend_amm.concentrated_liquidity_parameters.base (is required)",
},
{
submission: commandspb.AmendAMM{
Expand Down
1 change: 1 addition & 0 deletions commands/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
ErrMustBeLessThan150 = errors.New("must be less than 150")
ErrMustBeAtMost1M = errors.New("must be at most 1000000")
ErrMustBeAtMost100 = errors.New("must be at most 100")
ErrMustBeAtMost200 = errors.New("must be at most 200")
ErrMustBeAtMost2048 = errors.New("must be at most 2048")
ErrMustBeWithinRange7 = errors.New("must be between -7 and 7")
ErrIsNotValid = errors.New("is not a valid value")
Expand Down
Loading
Loading