From 347a3b24776502bf6846e282a4e2e115fe40d35e Mon Sep 17 00:00:00 2001 From: JeanKa Date: Tue, 24 Oct 2023 15:55:26 +0200 Subject: [PATCH 1/5] bump mangrove core version (#1561) --- CHANGELOG.md | 2 +- package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a43b3749b..36d5fb0e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Next version -- bump: mangrove-core to v1.5.12 +- bump: mangrove-core to v1.5.13 # 1.4.29 diff --git a/package.json b/package.json index 4748995bd..74fa925fc 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ }, "dependencies": { "@ethersproject/experimental": "^5.7.0", - "@mangrovedao/mangrove-core": "^1.5.12", + "@mangrovedao/mangrove-core": "^1.5.13", "@mangrovedao/reliable-event-subscriber": "1.1.29", "@types/object-inspect": "^1.8.1", "@types/triple-beam": "^1.3.2", diff --git a/yarn.lock b/yarn.lock index 9a55417f0..1be6c3771 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1135,10 +1135,10 @@ __metadata: languageName: node linkType: hard -"@mangrovedao/mangrove-core@npm:^1.5.12": - version: 1.5.12 - resolution: "@mangrovedao/mangrove-core@npm:1.5.12" - checksum: 915d2a61c362ad718b3cb9caf6fe7b4f86f8cddb44a0b1a126a9e975d74f0acb1b3863435cb92b44261c98e1a08f789c62b6a55e6252d0aece9c5625a1b65e8b +"@mangrovedao/mangrove-core@npm:^1.5.13": + version: 1.5.13 + resolution: "@mangrovedao/mangrove-core@npm:1.5.13" + checksum: d87ff00f99f3379dc53803be8f4c155f0c18242035176f013f64c8001c9d153c82e5306ffa355fd2e3e73db0693c2cb8a98416eedd8bd47c5a7c818a8c660974 languageName: node linkType: hard @@ -1152,7 +1152,7 @@ __metadata: "@ethersproject/experimental": ^5.7.0 "@ethersproject/hardware-wallets": ^5.7.0 "@ethersproject/providers": ^5.7.2 - "@mangrovedao/mangrove-core": ^1.5.12 + "@mangrovedao/mangrove-core": ^1.5.13 "@mangrovedao/reliable-event-subscriber": 1.1.29 "@typechain/ethers-v5": ^10.2.0 "@types/big.js": ^6.1.6 From 568123f0e20834dbe1557472bbdd5c0506cc9258 Mon Sep 17 00:00:00 2001 From: Mangrove Automation Bot <134297173+mangrove-automation@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:25:09 +0200 Subject: [PATCH 2/5] Merge publish/v1.4.30 to master Published by GitHub user: jkrivine --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d5fb0e5..d812b1406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Next version +# 1.4.30 + - bump: mangrove-core to v1.5.13 # 1.4.29 diff --git a/package.json b/package.json index 74fa925fc..45ea1dbe9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mangrovedao/mangrove.js", - "version": "1.4.29", + "version": "1.4.30", "author": "Mangrove DAO", "description": "A Typescript SDK for the Mangrove Protocol.", "license": "(BSD-2-Clause OR BSD-3-Clause)", From 2cb7b37cce795e3891f426f187cdf0092e0bf3ee Mon Sep 17 00:00:00 2001 From: lnist <16150076+lnist@users.noreply.github.com> Date: Wed, 10 Jan 2024 13:52:10 +0100 Subject: [PATCH 3/5] chore(release): Update changelog --- CHANGELOG.md | 155 +++++++++++---------------------------------------- 1 file changed, 34 insertions(+), 121 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a7c59a43..35f9decb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,126 +1,39 @@ # Next version -- fix: Verify stepSize value for geometric kandel - -# 2.0.0-20 - -- Bump @mangrovedao/mangrove-deployments to v1.0.3 -- feat: Round up, down, or to nearest depending on scenario -- fix!: Rename getRequiredOutboundForGas to getRequiredOutboundForGasreq - -# 2.0.0-19 - -- Add Sepolia support by bumping the following packages: - - @mangrovedao/mangrove-core to v2.0.3 - - @mangrovedao/mangrove-strats to v1.0.2 - - @mangrovedao/context-addresses to v1.0.1 - - @mangrovedao/mangrove-deployments to v1.0.2 - -# 2.0.0-18 - -- feat: Add 'Market.updateRestingOrder' function which allows updating resting orders posted by 'MangroveOrder' - -# 2.0.0-17 - -- fix: Correctly match any contract deployment of the same major version as the contract package version - -# 2.0.0-16 - -- Change @mangrovedao/mangrove-core dependency from 'next' to '^2.0.2' -- Change @mangrovedao/mangrove-strats dependency from 'next' to '^1.0.1' -- Change @mangrovedao/mangrove-deployments and @mangrovedao/context-addresses dependencies from 'next' to '^1.0.0' -- Update licenses: All code is now licensed under the MIT License. - -# 2.0.0-15 - -- fix!: rename offer_gasbase on offer structures to gasbase -- fix!: align return value of kandelInstance.getOffers() with new structure -- fix!: rename populateGeneralChunk to populateGeneralChunks -- feat: expose lastLiveBidIndex from Kandel distribution. -- feat: return offset and price ratio from Kandel status. -- fix: wrong price ratio from offset calculation in Kandel fixed. - -# 2.0.0-14 - -- fix: increaseAllowance will not fail if allowance becomes larger than 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff. -- fix: increaseAllowance will consider large values infinite like other approval functions. -- fix: all token approval functions now cap the allowance to 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff. - -# 2.0.0-13 - -- fix: Calculate default offer provision for MangroveOrder based on a gasprice factor if provision is not provided. -- fix: Export entire configuration instead of only address and token configuration. -- feat: Thread tickSpacing through code to be able to use it in tick/price calculations. -- fix: Change tick and tickSpacing to be number type -- feat!: Rename tick parameters of 'Market.simulateGas' and 'Semibook.simulateMarketOrder' to 'maxTick'. -- fix: Semibook now maintains consistency. After the upgrade to Mangrove v2, the cache could become inconsistent as it was not ensuring that added offers were an extension of the prefix held in the case. -- feat: Semibook cache now holds complete tick bins: If one offer with a given tick is in the cache, all offers with that tick is in the cache. -- feat!: The 'maxOffers' option in 'CacheContentOptions' has been replaced with a new option: 'targetNumberOfTicks'. When loading from chain, the cache will load until at least this number of ticks is in the cache. The default is 'Semibook.DEFAULT_TARGET_NUMBER_OF_TICKS'. -- feat!: A new default value 'Semibook.DEFAULT_CHUNK_SIZE' has been introduced for 'CacheContentOptions.chunkSize'. -- feat!: Mangrove and Semibook configs are now cached on 'connect' and (for Semibook) updated by events. The methods to read configs are no longer async and naming has been made consistent: 'Mangrove.config()', 'Market.config()', and 'Semibook.config()'. -- feat: Two missing global config fields have been added: 'maxRecursionDepth' and 'maxGasreqForFailingOffers'. -- feat!: All order book events now carry the relevant data for the event. And events that are not related to offers do not carry offer data. -- feat: The market order simulation used to estimate volumes and gas has been updated to match Mangrove v2's market order logic. -- feat!: 'Market.estimateVolume' now also estimates fees and returns it in a new 'estimatedFee' field. The existing 'estimatedVolume' field is exclusive of fees and thus represents the true amount the taker can expect to receive/pay. -- feat: Add 'Market.retractRestingOrder' method for retracting resting orders posted by 'MangroveOrder'. - -# 2.0.0-12 - -- fix: lazy load ol keys mapping - -# 2.0.0-11 - -- feat: `Market.Key` type introduced to identify markets (base, quote, tick spacing) in the API. -- feat!: `Mangrove.openMarkets` no longer connects to all markets, but returns a list of `Market.Key`s, optionally with the relevant offer list configuration attached to each. This is identical to the previous `Mangrove.openMarketsData` which has been removed. -- feat!: Use of `Big(ish)` for `tickSpacing` in a few places has been replaced by `BigNumber(ish)` for consistency with the rest of the API. - -# 2.0.0-10 - -# 2.0.0-9 - -- feat!: `MgvToken` has been renamed to `Token`. -- feat!: Removed `configuration.tokens.fetchDecimalsFromAddress`. Instead, use `Token.createTokenFromAddress` and read the decimals from that token. -- feat!: `Mangrove.toUnits|fromUnits` no longer accepts a token name/symbol as this was ambiguous. Instead, use `Token.createToken` and call `toUnits|fromUnits` on that. -- feat!: Static token configuration getters and setters have been removed from `Mangrove` and `Token`. Instead, use the methods on `configuration.token`. -- feat!: `Mangrove.getTokenAndAddress` has been removed. Instead, use `Mangrove.tokenFromAddress` and read the address from there. -- feat!: Remove `Mangrove.tokenFromConfig`. Use `Mangrove.token` instead. -- feat!/fix: Token `name` was misused: Sometimes it was assumed to be a symbol and sometimes an ID. It has therefore been replaced by `id` and `symbol` in all relevant places. Configuration files have been converted to use the token instance ID's from the context-addresses package to avoid ambiguity among (1) different tokens with the same symbol and (2) multiple token instances such as `USDC` (Circle issued) and `USDC.e` (bridged from Ethereum). - - Default token IDs can be registered for a symbol and network. And if there is only one ID for a given symbol on a network, it will be considered the default. `Mangrove.token()` will create an instance of the default token ID if found. -- feat!: `Mangrove.getNameFromAddress` has been removed: It was ambiguous (multiple names could be registered) and only used for resolving tokens which can now be done with the new `configuration.tokens.getTokenIdFromAddress()` function. -- feat!: The `Mangrove.openMarkets` function now uses `Token` instead of a bespoke token data struct. -- feat: `Mangrove.market` and `Market.connect` now accept either symbol, token ID, or `Token` for base and quote. -- feat: Added `displayName` and `displayedAsPriceDecimals` to `Token`. -- feat!: `Token.getDecimals` now throws an error instead of returning undefined if the decimals are not on record. - -# 2.0.0-8 - -# 2.0.0-7 - -# 2.0.0-6 - -# 2.0.0-5 - -- feat: Add usage of Geometric Kandel's call-data-reducing function - -# 2.0.0-4 - -- fix: For prereleases of contract packages, include deployments of earlier prereleases of those packages. - -# 2.0.0-3 - -- feat: Re-enable Kandel -- fix: Various fixes after initial upgrade. - -# 2.0.0-2 - -- feat: Use addresses from mangrove-deployments and context-addresses -- bump: mangrove-core to 2.0.0-4 -- bump: mangrove-strats to 0.0.2-4 - -# 2.0.0-1 - -- feat: Upgrade to new mangrove-core and mangrove-strats. Details to be added for production release. -- issue: Kandel is disabled for now. +- Cross-cutting + - Update licenses: All code is now licensed under the MIT License. + - feat!: Use the new Mangrove core protocol and strats from the new @mangrovedao/mangrove-core and @mangrovedao/mangrove-strats packages. See their changelogs for details. + - feat!: Make consequential changes to APIs to match those changes (not all changes mentioned) + - feat: Read addresses from @mangrovedao/mangrove-deployments and @mangrovedao/mangrove-context-addresses + - feat!: Round prices/ticks/volumes etc. according to maker or taker scenario due to precision of tick based core. +- Core + - feat!: Introduce Density class to wrapping floating point density from core protocol. + - feat!: Remove pivotId since it is no longer needed. + - Allowance + - fix: increaseAllowance will not fail if allowance becomes larger than 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff. + - fix: increaseAllowance will consider large values infinite like other approval functions. + - fix: all token approval functions now cap the allowance to 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff. + - fix!: rename offer_gasbase on offer structures to gasbase + - feat: The market order simulation used to estimate volumes and gas has been updated to match Mangrove v2's market order logic. + - feat!: The 'maxOffers' option in 'CacheContentOptions' has been replaced with a new option: 'targetNumberOfTicks'. When loading from chain, the cache will load until at least this number of ticks is in the cache. The default is 'Semibook.DEFAULT_TARGET_NUMBER_OF_TICKS'. + - feat!: A new default value 'Semibook.DEFAULT_CHUNK_SIZE' has been introduced for 'CacheContentOptions.chunkSize'. + - feat!: Mangrove and Semibook configs are now cached on 'connect' and (for Semibook) updated by events. The methods to read configs are no longer async and naming has been made consistent: 'Mangrove.config()', 'Market.config()', and 'Semibook.config()'. + - feat!: 'Market.estimateVolume' now also estimates fees and returns it in a new 'estimatedFee' field. The existing 'estimatedVolume' field is exclusive of fees and thus represents the true amount the taker can expect to receive/pay. + - feat!: 'Mangrove.openMarkets' no longer connects to all markets, but returns a list of 'Market.Key's, optionally with the relevant offer list configuration attached to each. This is identical to the previous 'Mangrove.openMarketsData' which has been removed. +- feat!: 'MgvToken' has been renamed to 'Token'. +- feat!: 'Mangrove.toUnits|fromUnits' no longer accepts a token name/symbol as this was ambiguous. Instead, use 'Token.createToken' and call 'toUnits|fromUnits' on that. +- feat!: Token 'name' was misused: Sometimes it was assumed to be a symbol and sometimes an ID. It has therefore been replaced by 'id' and 'symbol' in all relevant places. Configuration files have been converted to use the token instance ID's from the context-addresses package to avoid ambiguity among (1) different tokens with the same symbol and (2) multiple token instances such as 'USDC' (Circle issued) and 'USDC.e' (bridged from Ethereum). + - Default token IDs can be registered for a symbol and network. And if there is only one ID for a given symbol on a network, it will be considered the default. 'Mangrove.token()` will create an instance of the default token ID if found. +- MangroveOrder + - feat: Add 'Market.updateRestingOrder' function which allows updating resting orders posted by 'MangroveOrder' + - feat: Add 'Market.retractRestingOrder' function for retracting resting orders posted by 'MangroveOrder'. + - feat: Calculate default offer provision for MangroveOrder based on a gasprice factor if provision is not provided. + - feat: Allow 'offerId' to be passed in to re-use an existing offer. +- Kandel + - feat!: Introduce GeometricKandel classes + - feat!: Introduce 'populateGeometricDistribution' to populate geometric distribution respectively using reduced call data. + - feat!: Introduce 'populateGeneralDistribution' to populate arbitrary non-geometric distribution. + - feat!: Allow distribution parameters to be either price- or tick-based. # 1.4.30 From f7b4446ce371dca28db3b303c1c6d38c007d13ed Mon Sep 17 00:00:00 2001 From: Lasse <16150076+lnist@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:53:29 +0100 Subject: [PATCH 4/5] fix(release): Fix changelog (#1716) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35f9decb1..ebc6ed716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ - feat!: 'MgvToken' has been renamed to 'Token'. - feat!: 'Mangrove.toUnits|fromUnits' no longer accepts a token name/symbol as this was ambiguous. Instead, use 'Token.createToken' and call 'toUnits|fromUnits' on that. - feat!: Token 'name' was misused: Sometimes it was assumed to be a symbol and sometimes an ID. It has therefore been replaced by 'id' and 'symbol' in all relevant places. Configuration files have been converted to use the token instance ID's from the context-addresses package to avoid ambiguity among (1) different tokens with the same symbol and (2) multiple token instances such as 'USDC' (Circle issued) and 'USDC.e' (bridged from Ethereum). - - Default token IDs can be registered for a symbol and network. And if there is only one ID for a given symbol on a network, it will be considered the default. 'Mangrove.token()` will create an instance of the default token ID if found. + - Default token IDs can be registered for a symbol and network. And if there is only one ID for a given symbol on a network, it will be considered the default. 'Mangrove.token()' will create an instance of the default token ID if found. - MangroveOrder - feat: Add 'Market.updateRestingOrder' function which allows updating resting orders posted by 'MangroveOrder' - feat: Add 'Market.retractRestingOrder' function for retracting resting orders posted by 'MangroveOrder'. From 2eb3f76f120831a48c577d930fcffc7d55d75c51 Mon Sep 17 00:00:00 2001 From: Lasse <16150076+lnist@users.noreply.github.com> Date: Thu, 11 Jan 2024 11:14:27 +0100 Subject: [PATCH 5/5] chore: Publish npm package v2.0.0 (#1717) Published by GitHub user: lnist Co-authored-by: Mangrove Automation Bot --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc6ed716..63e385407 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Next version +# 2.0.0 + - Cross-cutting - Update licenses: All code is now licensed under the MIT License. - feat!: Use the new Mangrove core protocol and strats from the new @mangrovedao/mangrove-core and @mangrovedao/mangrove-strats packages. See their changelogs for details. diff --git a/package.json b/package.json index 0dd5caa65..5855588ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mangrovedao/mangrove.js", - "version": "2.0.0-20", + "version": "2.0.0", "author": "Mangrove DAO", "description": "A Typescript SDK for the Mangrove Protocol.", "license": "MIT",