Skip to content

feat(kandel): Split Geometric Kandel from core kandel and allow usage… #679

feat(kandel): Split Geometric Kandel from core kandel and allow usage…

feat(kandel): Split Geometric Kandel from core kandel and allow usage… #679

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / Test Report succeeded Nov 24, 2023 in 0s

Test Report βœ…

Tests passed successfully

βœ…Β coverage-tests-report.json

619 tests were completed in 173s with 619 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/integration/cleaner.integration.test.ts 4βœ… 2s
test/integration/kandel/coreKandelInstance.integration.test.ts 59βœ… 12s
test/integration/kandel/farm.integration.test.ts 6βœ… 64ms
test/integration/kandel/geometricKandelInstance.integration.test.ts 20βœ… 8s
test/integration/kandel/geometricKandelLib.integration.test.ts 32βœ… 248ms
test/integration/kandel/seeder.integration.test.ts 9βœ… 311ms
test/integration/mangrove.integration.test.ts 5βœ… 8s
test/integration/mangroveToyENS.integration.test.ts 2βœ… 42s
test/integration/market.integration.test.ts 48βœ… 8s
test/integration/mgvtoken.integration.test.ts 12βœ… 464ms
test/integration/offermaker.integration.test.ts 16βœ… 2s
test/integration/restingOrder.integration.test.ts 8βœ… 2s
test/integration/semibook.integration.test.ts 44βœ… 9s
test/unit/configuration.unit.test.ts 4βœ… 3ms
test/unit/densityLib.unit.test.ts 5βœ… 180ms
test/unit/kandel/generalKandelDistribution.unit.test.ts 5βœ… 1ms
test/unit/kandel/generalKandelDistributionGenerator.unit.test.ts 44βœ… 550ms
test/unit/kandel/generalKandelDistributionHelper.unit.test.ts 12βœ… 4ms
test/unit/kandel/geometricKandel/geometricKandelDistribution.unit.test.ts 4βœ… 11ms
test/unit/kandel/geometricKandel/geometricKandelDistributionHelper.unit.test.ts 11βœ… 22ms
test/unit/kandel/geometricKandel/geometricKandelStatus.unit.test.ts 9βœ… 437ms
test/unit/kandel/kandelConfiguration.unit.test.ts 14βœ… 2ms
test/unit/kandel/kandelDistribution.unit.test.ts 6βœ… 1ms
test/unit/kandel/kandelDistributionHelper.unit.test.ts 17βœ… 6ms
test/unit/liquidityProvider.unit.test.ts 25βœ… 25ms
test/unit/market.unit.test.ts 21βœ… 17ms
test/unit/prettyPrint.unit.test.ts 3βœ… 16ms
test/unit/semibook.unit.test.ts 27βœ… 5ms
test/unit/tickLib.unit.test.ts 43βœ… 73ms
test/unit/tickPriceHelper.unit.test.ts 68βœ… 270ms
test/unit/trade.unit.test.ts 24βœ… 71ms
test/unit/tradeEventManagement.unit.test.ts 8βœ… 33ms
test/unit/unitCalculations.unit.test.ts 4βœ… 1ms

βœ…Β test/integration/cleaner.integration.test.ts

Cleaner integration tests suite
  βœ… clean asks book, offer is successfully taken, therefore cannot clean it
  βœ… clean failing offers collects bounty
  βœ… clean using different takers funds
  βœ… clean via callStatic for failing offers returns bounty

βœ…Β test/integration/kandel/coreKandelInstance.integration.test.ts

CoreKandelInstance integration tests suite onAave=false
  βœ… approve approves(full=false) tokens for deposit base=1 quote=undefined
  βœ… approve approves(full=false) tokens for deposit base=3 quote=4
  βœ… approve approves(full=false) tokens for deposit base=undefined quote=2
  βœ… approve approves(full=false) tokens for deposit base=undefined quote=undefined
  βœ… approve approves(full=true) tokens for deposit base=1 quote=undefined
  βœ… approve approves(full=true) tokens for deposit base=3 quote=4
  βœ… approve approves(full=true) tokens for deposit base=undefined quote=2
  βœ… approve approves(full=true) tokens for deposit base=undefined quote=undefined
  βœ… approve does not approve if already approved
  βœ… getMinimumVolume agrees with seeder on asks
  βœ… getMinimumVolume agrees with seeder on bids
  βœ… has expected immutable data from chain
  βœ… populateChunks can populate some offers inChunks=false
  βœ… populateChunks can populate some offers inChunks=true
  βœ… retractAndWithdraw can withdraw all offers and amounts inChunks=false
  βœ… retractAndWithdraw can withdraw all offers and amounts inChunks=true
  βœ… retractAndWithdraw can withdraw expected offers and amounts to other address
  βœ… retractOffers can withdraw all offers inChunks=false
  βœ… retractOffers can withdraw all offers inChunks=true
  βœ… retractOffers can withdraw select offers inChunks=false
  βœ… retractOffers can withdraw select offers inChunks=true
CoreKandelInstance integration tests suite onAave=true
  βœ… approve approves(full=false) tokens for deposit base=1 quote=undefined
  βœ… approve approves(full=false) tokens for deposit base=3 quote=4
  βœ… approve approves(full=false) tokens for deposit base=undefined quote=2
  βœ… approve approves(full=false) tokens for deposit base=undefined quote=undefined
  βœ… approve approves(full=true) tokens for deposit base=1 quote=undefined
  βœ… approve approves(full=true) tokens for deposit base=3 quote=4
  βœ… approve approves(full=true) tokens for deposit base=undefined quote=2
  βœ… approve approves(full=true) tokens for deposit base=undefined quote=undefined
  βœ… approve does not approve if already approved
  βœ… getMinimumVolume agrees with seeder on asks
  βœ… getMinimumVolume agrees with seeder on bids
  βœ… has expected immutable data from chain
  βœ… populateChunks can populate some offers inChunks=false
  βœ… populateChunks can populate some offers inChunks=true
  βœ… retractAndWithdraw can withdraw all offers and amounts inChunks=false
  βœ… retractAndWithdraw can withdraw all offers and amounts inChunks=true
  βœ… retractAndWithdraw can withdraw expected offers and amounts to other address
  βœ… retractOffers can withdraw all offers inChunks=false
  βœ… retractOffers can withdraw all offers inChunks=true
  βœ… retractOffers can withdraw select offers inChunks=false
  βœ… retractOffers can withdraw select offers inChunks=true
CoreKandelInstance integration tests suite router-agnostic
  βœ… calculateDistributionWithUniformlyChangedVolume creates new distribution with decreased volumes for all live offers
  βœ… can set gasprice
  βœ… can set gasreq
  βœ… deposit can deposit to Kandel
  βœ… fundOnMangrove adds funds
  βœ… getLockedProvisionFromOffers gets the locked provision
  βœ… getMissingProvisionFromOffers gets the additional needed provision for a higher gasprice
  βœ… getMissingProvisionFromOffers gets the additional needed provision for a larger distribution
  βœ… getRequiredProvision can get provision for gaspriceFactor=3 gasprice=2000 gasreq=42000
  βœ… getRequiredProvision can get provision for gaspriceFactor=undefined gasprice=undefined gasreq=undefined
  βœ… getRequiredProvision can get provision with overrides
  βœ… pending, volume, reserve correct after populate with deposit
  βœ… pending, volume, reserve correct after populate without deposit
  βœ… populate throws if pricePoints parameters do not match
  βœ… populate throws if stepSize parameters do not match
  βœ… withdraw can withdraw all amounts
  βœ… withdraw can withdraw specific amounts to recipient

βœ…Β test/integration/kandel/farm.integration.test.ts

KandelFarm integration tests suite
  βœ… getKandels retrieves aave kandel instances
  βœ… getKandels retrieves all base kandel instances using olKey
  βœ… getKandels retrieves all kandel instances
  βœ… getKandels retrieves all market kandel instances using offerList
  βœ… getKandels retrieves non-aave kandel instances
  βœ… getKandels retrieves owned kandel instances

βœ…Β test/integration/kandel/geometricKandelInstance.integration.test.ts

GeometricKandelInstance integration tests suite onAave=false
  βœ… calculateMinimumDistribution can be deployed with a factor of 1
  βœ… calculateMinimumDistribution cannot be deployed with factor=0.5 or gasreq=undefined
  βœ… calculateMinimumDistribution cannot be deployed with factor=undefined or gasreq=-100000
GeometricKandelInstance integration tests suite onAave=true
  βœ… calculateMinimumDistribution can be deployed with a factor of 1
  βœ… calculateMinimumDistribution cannot be deployed with factor=0.5 or gasreq=undefined
  βœ… calculateMinimumDistribution cannot be deployed with factor=undefined or gasreq=-100000
GeometricKandelInstance integration tests suite router-agnostic
  βœ… calculateUniformDistributionFromMinPrice can heal multiple offers
  βœ… calculateUniformDistributionFromMinPrice with 0 available throws
  βœ… can go through life-cycle with numbers as Bigish
  βœ… createDistributionWithOffers can be used to heal an offer
  βœ… getMinimumVolumeForIndex for ask and bid
  βœ… getOfferStatuses retrieves status
  βœ… getOfferStatuses retrieves status
  βœ… populate can be called with non-1 stepSize
  βœ… populate can be with new distribution
  βœ… populate populates a market, deposits and sets parameters inChunks=false
  βœ… populate populates a market, deposits and sets parameters inChunks=true
  βœ… populate through geometric gasSave, reducedCallData, and general with same result
  βœ… populate throws if offset parameters do not match
  βœ… populate throws if ratio parameters do not match

βœ…Β test/integration/kandel/geometricKandelLib.integration.test.ts

GeometricKandelLib integration test suite
  βœ… same exception on both askGives and bidGives undefined
  βœ… stub agrees with static calls - test 001
  βœ… stub agrees with static calls - test 002
  βœ… stub agrees with static calls - test 003
  βœ… stub agrees with static calls - test 004
  βœ… stub agrees with static calls - test 005
  βœ… stub agrees with static calls - test 006
  βœ… stub agrees with static calls - test 007
  βœ… stub agrees with static calls - test 008
  βœ… stub agrees with static calls - test 009
  βœ… stub agrees with static calls - test 010
  βœ… stub agrees with static calls - test 011
  βœ… stub agrees with static calls - test 012
  βœ… stub agrees with static calls - test 013
  βœ… stub agrees with static calls - test 014
  βœ… stub agrees with static calls - test 015
  βœ… stub agrees with static calls - test 016
  βœ… stub agrees with static calls - test 017
  βœ… stub agrees with static calls - test 018
  βœ… stub agrees with static calls - test 019
  βœ… stub agrees with static calls - test 020
  βœ… stub agrees with static calls - test 021
  βœ… stub agrees with static calls - test 022
  βœ… stub agrees with static calls - test 023
  βœ… stub agrees with static calls - test 024
  βœ… stub agrees with static calls - test 025
  βœ… stub agrees with static calls - test 026
  βœ… stub agrees with static calls - test 027
  βœ… stub agrees with static calls - test 028
  βœ… stub agrees with static calls - test 029
  βœ… stub agrees with static calls - test 030
  βœ… stub agrees with static calls - test 031

βœ…Β test/integration/kandel/seeder.integration.test.ts

KandelSeeder integration tests suite
  βœ… minimumVolume uses config and calculates correct value offerType=asks onAave=false
  βœ… minimumVolume uses config and calculates correct value offerType=asks onAave=true
  βœ… minimumVolume uses config and calculates correct value offerType=bids onAave=false
  βœ… minimumVolume uses config and calculates correct value offerType=bids onAave=true
  βœ… sow deploys kandel and returns instance onAave:false liquiditySharing:false
  βœ… sow deploys kandel and returns instance onAave:false liquiditySharing:true
  βœ… sow deploys kandel and returns instance onAave:true liquiditySharing:false
  βœ… sow deploys kandel and returns instance onAave:true liquiditySharing:true
  βœ… sow deploys kandel with overridden gasprice for provision calculation

βœ…Β test/integration/mangrove.integration.test.ts

Mangrove integration tests suite calculateOLKeyHash
  βœ… agrees with hash generated by events
Mangrove integration tests suite getMarkets
  βœ… gets correct market info and updates with cashness
  βœ… has reverse lookup of address
  βœ… updates with mgvReader
Mangrove integration tests suite node utils
  βœ… can deal a test token

βœ…Β test/integration/mangroveToyENS.integration.test.ts

Mangrove functionality watch local addresses
  βœ… can start watching after ToyENS has been created
  βœ… can start watching before ToyENS has been created

βœ…Β test/integration/market.integration.test.ts

Market integration tests suite
  βœ… buying uses best price, with forceRoutingToMangroveOrder:false
  βœ… buying uses best price, with no forceRoutingToMangroveOrder
  βœ… crudely simulates market buy
  βœ… get minimum volume
  βœ… getOfferProvision agrees with calculateOfferProvision for asks with gasprice=10000 
  βœ… getOfferProvision agrees with calculateOfferProvision for asks with gasprice=undefined 
  βœ… getOfferProvision agrees with calculateOfferProvision for bids with gasprice=10000 
  βœ… getOfferProvision agrees with calculateOfferProvision for bids with gasprice=undefined 
  βœ… gets config
  βœ… gets OB
  βœ… max gasreq is added to gas estimates
  βœ… max gasreq returns a BigNumber, even if the book is empty
  βœ… mgvIntegrationTestUtils can post offers for asks
  βœ… mgvIntegrationTestUtils can post offers for bids
  βœ… returns correct data when taking offers
  βœ… selling uses best price
  βœ… subscribes
  βœ… updates OB
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=false with gasLowerBound=42 and gasLimit=6500000
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=false with gasLowerBound=42 and gasLimit=undefined
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=false with gasLowerBound=7000000 and gasLimit=6500000
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=false with gasLowerBound=7000000 and gasLimit=undefined
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=false with gasLowerBound=undefined and gasLimit=6500000
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=false with gasLowerBound=undefined and gasLimit=undefined
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=true with gasLowerBound=42 and gasLimit=6500000
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=true with gasLowerBound=42 and gasLimit=undefined
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=true with gasLowerBound=7000000 and gasLimit=6500000
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=true with gasLowerBound=7000000 and gasLimit=undefined
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=true with gasLowerBound=undefined and gasLimit=6500000
  βœ… uses expected gasLimit and forceRoutingToMangroveOrder=true with gasLowerBound=undefined and gasLimit=undefined
Market integration tests suite estimateVolumeTest
  βœ… return estimate value for buy
  βœ… return estimate value for sell
  βœ… return estimate value for sell
Market integration tests suite getMissingProvision
  βœ… can miss some provision
Market integration tests suite getOutboundInbound
  βœ… returns base as inbound and quote as outbound, when bids
  βœ… returns base as outbound and quote as inbound, when asks
  βœ… returns this.base as inbound and this.quote as outbound, when bids
  βœ… returns this.base as outbound and this.quote as inbound, when asks
Market integration tests suite isActive
  βœ… returns false, when asks and bids both not active
  βœ… returns false, when asks is active and bids is not active
  βœ… returns false, when asks is not active and bids is active
  βœ… returns true, when asks and bids are active
Market integration tests suite isLive
  βœ… returns false, when gives is less than 1
  βœ… returns true, when gives is positive
Market integration tests suite offerInfo
  βœ… return offer from ba semi book
  βœ… returns asks offer info
  βœ… returns bids offer info
Market integration tests suite Readonly mode
  βœ… can read book updates in readonly mode

βœ…Β test/integration/mgvtoken.integration.test.ts

MGV Token integration tests suite
  βœ… allowanceInfinite is false if allowance is 2^200 
  βœ… allowanceInfinite is true if allowance is 2^200 + 1 
  βœ… allowanceInfinite is true if infinite allowance 
  βœ… approve can be set to 0
  βœ… approve sets approved amount
  βœ… approveIfHigher sets when higher but not when lower
  βœ… approveIfNotInfinite creates approval TX only if finite
  βœ… converts
  βœ… get token from address
  βœ… has checksum addresses
  βœ… increaseApproval increases except when at max
  βœ… reads allowance and sets

βœ…Β test/integration/offermaker.integration.test.ts

OfferMaker integration test suite
  βœ… checks allowance for EOA provider
  βœ… checks allowance for onchain logic
  βœ… checks provision for EOA provider
  βœ… checks provision for onchain logic
  βœ… checks provision for onchain logic by calling provisionOf
  βœ… gets missing provision for eoa logic
  βœ… gets missing provision for onchain logic
OfferMaker integration test suite After setup
  βœ… approves signer for base transfer
  βœ… cancels offer
  βœ… fails, when trying to cancel a non-existing offer
  βœ… fails, when trying to create an offer on a closed market
  βœ… fails, when trying to push new offer without sufficient provision
  βœ… fails, when trying to update on a closed market
  βœ… OfferMaker updates offer
  βœ… pushes a new offer
  βœ… withdraws

βœ…Β test/integration/restingOrder.integration.test.ts

RestingOrder Resting order integration tests suite
  βœ… no resting order params, with forceRoutingToMangroveOrder:true
  βœ… no resting order params, with forceRoutingToMangroveOrder:true
  βœ… resting order with deadline and custom gasreq
  βœ… resting order, using existing offer
  βœ… simple resting order, with forceRoutingToMangroveOrder:false
  βœ… simple resting order, with forceRoutingToMangroveOrder:true
  βœ… simple resting order, with no forceRoutingToMangroveOrder
RestingOrder RestingOrder connectivity
  βœ… deploys and connects

βœ…Β test/integration/semibook.integration.test.ts

Semibook integration tests suite estimateVolume estimateVolume({to: buy}) - cache tests
  βœ… returns all given as residue when cache and offer list is empty
  βœ… returns correct estimate and residue when cache is empty and offer list is not
  βœ… returns correct estimate and residue when cache is partial and insufficient while offer list is sufficient
  βœ… returns correct estimate and residue when cache is partial and offer list is insufficient
Semibook integration tests suite estimateVolume estimateVolume({to: buy}) - calculation tests
  βœ… estimates all available volume when offer list has 1 offer with insufficient volume
  βœ… estimates all available volume when offer list has multiple offers with insufficient volume
  βœ… estimates volume and no residue when offer list has 1 offer with sufficient volume
  βœ… estimates volume and no residue when offer list has multiple offers which together have sufficient volume
  βœ… returns zero when given is zero
Semibook integration tests suite estimateVolume estimateVolume({to: sell}) - cache tests
  βœ… returns all given as residue when cache and offer list is empty
  βœ… returns correct estimate and residue when cache is empty and offer list is not
  βœ… returns correct estimate and residue when cache is partial and insufficient while offer list is sufficient
  βœ… returns correct estimate and residue when cache is partial and offer list is insufficient
Semibook integration tests suite estimateVolume estimateVolume({to: sell}) - calculation tests
  βœ… estimates all available volume when offer list has 1 offer with insufficient volume
  βœ… estimates all available volume when offer list has multiple offers with insufficient volume
  βœ… estimates volume and no residue when offer list has 1 offer with sufficient volume
  βœ… estimates volume and no residue when offer list has multiple offers which together have sufficient volume
  βœ… returns zero when given is zero
Semibook integration tests suite getBestInCache
  βœ… returns offer id 1, because cache gets synced even though market is created before offer
  βœ… returns offer id 1, because market made after offer
Semibook integration tests suite getConfig
  βœ… returns the config of a block as Mangrove.LocalConfig, when given blocknumber
  βœ… returns the config of a block, when given blocknumber
  βœ… returns the config of the latest block as Mangrove.LocalConfig, when given no blocknumber
  βœ… returns the config of the latest block as Mangrove.RawConfig, when given no blocknumber
Semibook integration tests suite getMaxGasReq
  βœ… finds max gasreq on both asks and bids side of market
  βœ… returns `undefined` when the semibook is empty
Semibook integration tests suite getMinimumVolume
  βœ… gets 1 unit if density is 0
  βœ… gets minimum volume
Semibook integration tests suite initialization options Option.desiredPrice
  βœ… does not fail if offer list is empty
  βœ… fetches all offers if all have a better price
  βœ… fetches only one chunk if no offers have a better price
  βœ… stops fetching when a chunk with a worse price has been fetched
Semibook integration tests suite initialization options Option.desiredVolume {to: buy}
  βœ… does not fail if offer list is empty
  βœ… fetches all offers if offer list has insufficient volume
  βœ… fetches only one chunk if it has sufficient volume
  βœ… stops fetching when sufficient volume has been fetched
Semibook integration tests suite initialization options Option.desiredVolume {to: sell}
  βœ… does not fail if offer list is empty
  βœ… fetches all offers if offer list has insufficient volume
  βœ… fetches only one chunk if it has sufficient volume
  βœ… stops fetching when sufficient volume has been fetched
Semibook integration tests suite offerInfo
  βœ… returns offer from cache, when offer is in cache
  βœ… returns offer from cache, when offer is in cache
  βœ… returns offer from contract, when offer is not in cache
  βœ… returns offer from contract, when offer is not in cache

βœ…Β test/unit/configuration.unit.test.ts

Configuration unit tests suite
  βœ… Adding token config does not affect existing config
  βœ… Can add token config of unknown token
  βœ… can read mangroveOrder config
  βœ… Reset of configuration reverts additions and changes

βœ…Β test/unit/densityLib.unit.test.ts

Density unit test suite
  βœ… test_density_convert_auto
  βœ… test_density_manual
  βœ… test_density_multiply_auto
  βœ… test_multiply_manual
  βœ… test_paramsTo96X32

βœ…Β test/unit/kandel/generalKandelDistribution.unit.test.ts

GeneralKandelDistribution unit tests suite chunkDistribution
  βœ… can chunk an even set
  βœ… can chunk an uneven set
  βœ… can have one extra offer due to boundary
  βœ… works with all asks
  βœ… works with all bids

βœ…Β test/unit/kandel/generalKandelDistributionGenerator.unit.test.ts

GeneralKandelDistributionGenerator unit tests suite uniformlyChangeVolume
  βœ… respects minimums
GeometricKandelDistributionGenerator unit tests suite calculateDistribution
  βœ… calculates expected price points when generating generateFromMid=false
  βœ… calculates expected price points when generating generateFromMid=true
  βœ… can calculate distribution with constant base generateFromMid=false
  βœ… can calculate distribution with constant base generateFromMid=true
  βœ… can calculate distribution with constant outbound
  βœ… can calculate distribution with constant quote
  βœ… can calculate distribution with fixed base/quote constantBase=false volume which follows geometric distribution
  βœ… can calculate distribution with fixed base/quote constantBase=true volume which follows geometric distribution
  βœ… throws on missing initials
GeometricKandelDistributionGenerator unit tests suite calculateDistribution calculateDistribution
  βœ… can calculate distribution with fixed base volume and fixed quote volume which follows geometric price distribution
  βœ… can calculate distribution with only asks
  βœ… can calculate distribution with only bids
  βœ… rounds off base and gives according to decimals
GeometricKandelDistributionGenerator unit tests suite calculateFirstOfferIndexAndFirstAskIndex
  βœ… calculates the right value for fromMid=0 min=1 mid=-10 offset=1 pricePoints=10
  βœ… calculates the right value for fromMid=0 min=2 mid=10 offset=1 pricePoints=2
  βœ… calculates the right value for fromMid=0 min=2 mid=2 offset=1 pricePoints=10
  βœ… calculates the right value for fromMid=0 min=2 mid=6 offset=1 pricePoints=10
  βœ… calculates the right value for fromMid=0 min=2 mid=6 offset=1 pricePoints=3
  βœ… calculates the right value for fromMid=0 min=2 mid=6 offset=1 pricePoints=4
  βœ… calculates the right value for fromMid=0 min=2 mid=7 offset=3 pricePoints=10
  βœ… calculates the right value for fromMid=1 min=1 mid=-10 offset=1 pricePoints=10
  βœ… calculates the right value for fromMid=1 min=2 mid=2 offset=1 pricePoints=10
  βœ… calculates the right value for fromMid=1 min=2 mid=6 offset=1 pricePoints=10
  βœ… calculates the right value for fromMid=1 min=2 mid=6 offset=1 pricePoints=3
  βœ… calculates the right value for fromMid=1 min=2 mid=6 offset=1 pricePoints=4
  βœ… calculates the right value for fromMid=1 min=2 mid=7 offset=3 pricePoints=10
GeometricKandelDistributionGenerator unit tests suite calculateGeometricDistributionParams
  βœ… generateFromMid=false has firstAskIndex higher than max has no asks
  βœ… generateFromMid=false has firstAskIndex higher than max has no asks
  βœ… midPrice higher than max has no asks
  βœ… midPrice higher than max has no asks generateFromMid=false
  βœ… midPrice higher than max has no asks generateFromMid=true
  βœ… passes on TickDistributionParams and calculated values
GeometricKandelDistributionGenerator unit tests suite calculateMinimumDistribution
  βœ… can have constant base
  βœ… can have constant gives
  βœ… can have constant quote
  βœ… throws if both constant
GeometricKandelDistributionGenerator unit tests suite getMinimumVolumeForIndex
  βœ… also can use dual to calculate minimum asks 0.01 100
  βœ… also can use dual to calculate minimum asks 0.1 100
  βœ… also can use dual to calculate minimum bids 0.01 100
  βœ… also can use dual to calculate minimum bids 0.1 100
GeometricKandelDistributionGenerator unit tests suite recalculateDistributionFromAvailable
  βœ… can set new constant base
  βœ… can set new constant gives
  βœ… can set new constant quote

βœ…Β test/unit/kandel/generalKandelDistributionHelper.unit.test.ts

GeneralKandelDistributionHelper unit tests suite chunkIndices
  βœ… can chunk
GeneralKandelDistributionHelper unit tests suite chunkIndicesAroundMiddle
  βœ… can chunk an even set
  βœ… can chunk an uneven set with middle=2
  βœ… can chunk an uneven set with middle=undefined
  βœ… works with middle=0
  βœ… works with middle=4
GeneralKandelDistributionHelper unit tests suite sortByIndex
  βœ… sorts
GeneralKandelDistributionHelper unit tests suite uniformlyChangeVolume
  βœ… can decrease uniformly, respects limits, prices, and rounding
  βœ… can increase and decrease also a single one baseDelta=-2 quoteDelta=undefined
  βœ… can increase and decrease also a single one baseDelta=2 quoteDelta=-2000
  βœ… can increase and decrease also a single one baseDelta=2 quoteDelta=2000
  βœ… can increase and decrease also a single one baseDelta=undefined quoteDelta=-2000

βœ…Β test/unit/kandel/geometricKandel/geometricKandelDistribution.unit.test.ts

GeometricKandelDistribution unit tests suite
  βœ… can retrieve the geometric params
GeometricKandelDistribution unit tests suite getPriceRatio
  βœ… agrees with helper's calculator for baseQuoteTickOffset=1
  βœ… agrees with helper's calculator for baseQuoteTickOffset=6931
  βœ… agrees with helper's calculator for baseQuoteTickOffset=789

βœ…Β test/unit/kandel/geometricKandel/geometricKandelDistributionHelper.unit.test.ts

GeometricKandelDistributionHelper unit tests suite calculateBaseQuoteTickOffset
  βœ… can calculate based on price ratio
  βœ… Fails if less than 1
GeometricKandelDistributionHelper unit tests suite getBaseQuoteTicksFromTick
  βœ… can get baseQuoteTicks from tick
GeometricKandelDistributionHelper unit tests suite getTickDistributionParams
  βœ… calculates sames parameters for all combinations of minPrice, maxPrice, ratio, and pricePoints, and the similar tick-based parameters 
  βœ… can get 2 pricePoints from minPrice and maxPrice
  βœ… fails if neither midBaseQuoteTick nor midPrice is given
  βœ… throws error if not enough parameters are given
  βœ… throws error if only 1 price point
  βœ… throws if max too high
  βœ… throws if min too low
  βœ… throws if min/max too close

βœ…Β test/unit/kandel/geometricKandel/geometricKandelStatus.unit.test.ts

GeometricKandelStatus unit tests suite getIndexOfPriceClosestToMid
  βœ… gets closest to mid on multiple
  βœ… gets offer if single
GeometricKandelStatus unit tests suite getOfferStatuses
  βœ… discards outliers even though price is near mid
  βœ… gets all as expected for initial distribution
  βœ… gets price and status with dead and crossed offers
  βœ… gets status with 1 dead near mid with stepSize=1 where dual is not dead
  βœ… gets status with 2 dead near mid with stepSize=1 where dual is dead
  βœ… gets status with 3 dead near mid with stepSize=2 where dual is dead for some
  βœ… gets status with 4 dead near mid with stepSize=2 where dual is dead

βœ…Β test/unit/kandel/kandelConfiguration.unit.test.ts

KandelConfiguration unit tests suite getConfigForBaseQuote
  βœ… inherits and overrides for market
  βœ… parses all expected valid
  βœ… throws on missing config 0 - aaveEnabled is not configured for pair TokenA/FailingConfig0 on network configTest.
  βœ… throws on missing config 1 - minimumBasePerOfferFactor is not configured for pair TokenA/FailingConfig1 on network configTest.
  βœ… throws on missing config 2 - minimumQuotePerOfferFactor is not configured for pair TokenA/FailingConfig2 on network configTest.
  βœ… throws on missing config 3 - stepSize is not configured for pair TokenA/FailingConfig3 on network configTest.
  βœ… throws on missing config 4 - baseQuoteTickOffset is not configured for pair TokenA/FailingConfig4 on network configTest.
KandelConfiguration unit tests suite getConfiguredMarketsForNetwork
  βœ… configTest
  βœ… maticmum
  βœ… unknown
KandelConfiguration unit tests suite getMostSpecificConfig
  βœ… does not fail on missing base
  βœ… does not fail on missing network
  βœ… does not fail on missing properties
  βœ… does not fail on missing quote

βœ…Β test/unit/kandel/kandelDistribution.unit.test.ts

KandelDistribution unit tests suite calculateConstantGivesPerOffer
  βœ… can calculate constant outbound
  βœ… can work without any available
  βœ… throws if 0 available
KandelDistribution unit tests suite getFirstLiveAskIndex
  βœ… is correct when no live asks
  βœ… is correct when some live asks
KandelDistribution unit tests suite getOfferedVolumeForDistribution
  βœ… sums up the base and quote volume of the distribution

βœ…Β test/unit/kandel/kandelDistributionHelper.unit.test.ts

KandelDistributionHelper unit tests suite calculateMinimumInitialGives
  βœ… returns higher than minimum if dual at some price would be below its minimum
  βœ… returns minimum if no prices affect it
  βœ… returns minimum on empty lists
KandelDistributionHelper unit tests suite chunkIndices
  βœ… can chunk
KandelDistributionHelper unit tests suite chunkIndicesAroundMiddle
  βœ… can chunk an even set
  βœ… can chunk an uneven set with middle=2
  βœ… can chunk an uneven set with middle=undefined
  βœ… works with middle=0
  βœ… works with middle=4
KandelDistributionHelper unit tests suite sortByIndex
  βœ… sorts
KandelDistributionHelper unit tests suite uniformlyDecrease
  βœ… can decrease but not total amount if limits prevent
  βœ… can decrease total amount if available, but respect limits
  βœ… can decrease uniformly if all sufficiently above limit
  βœ… can round result
  βœ… does not go beyond limit due to rounding up
KandelDistributionHelper unit tests suite uniformlyIncrease
  βœ… can increase uniformly
  βœ… can round result

βœ…Β test/unit/liquidityProvider.unit.test.ts

Liquidity provider unit tests suite
  βœ… normalizeOfferParams, ask tick = 0 price = 10 different decimals
  βœ… normalizeOfferParams, ask tick = 0 price = 10 different decimals
  βœ… normalizeOfferParams, ask tick = 0 same decimals
  βœ… normalizeOfferParams, ask with tick = -1 different decimals
  βœ… normalizeOfferParams, ask with tick = -1 different decimals
  βœ… normalizeOfferParams, ask with tick = -1 same decimals
  βœ… normalizeOfferParams, ask with tick = -1 same decimals
  βœ… normalizeOfferParams, ask with tick = 1 different decimals
  βœ… normalizeOfferParams, ask with tick = 1 different decimals
  βœ… normalizeOfferParams, ask with tick = 1 same decimals
  βœ… normalizeOfferParams, ask with tick = 1 same decimals
  βœ… normalizeOfferParams, bid tick = 0 different decimals
  βœ… normalizeOfferParams, bid tick = 0 same decimals
  βœ… normalizeOfferParams, with big gives and wants, as asks
  βœ… normalizeOfferParams, with gives and wants, as asks
  βœ… normalizeOfferParams, with gives and wants, as bids
  βœ… normalizeOfferParams, with gives, tick, asks and funding
  βœ… normalizeOfferParams, with gives, tick, bids and no funding
  βœ… normalizeOfferParams, with non-equal decimals gives, tick, bids and no funding
  βœ… normalizeOfferParams, with volume and price 1, as asks
  βœ… normalizeOfferParams, with volume and price 1, as bids
  βœ… normalizeOfferParams, with volume and price 2, as asks
  βœ… normalizeOfferParams, with volume and price 2, as asks
  βœ… normalizeOfferParams, with volume and price 2, as bids
  βœ… normalizeOfferParams, with volume and price 2, as bids

βœ…Β test/unit/market.unit.test.ts

Market unit tests suite getBaseQuoteVolumes
  βœ… returns gives as baseVolume and wants as quoteVolume
  βœ… returns gives as quoteVolume and wants as baseVolume
Market unit tests suite getDisplayDecimalsForPriceDifferences
  βœ… returns 7 decimals when difference is 1e-7
  βœ… returns 7 decimals when difference is 9e-7
  βœ… returns 7 decimals when difference is 9e-7
  βœ… returns no decimals for empty list
  βœ… returns no decimals for list with offers with same price
  βœ… returns no decimals for list with one offer
  βœ… returns no decimals when price differences are integers
  βœ… returns one decimal when difference is -0.1
  βœ… returns one decimal when difference is -0.9999999
  βœ… returns one decimal when difference is 0.1
  βœ… returns one decimal when difference is 0.9999999
  βœ… returns the decimals for the first difference when that is smallest
  βœ… returns the decimals for the last difference when that is smallest
Market unit tests suite getGivesForPrice
  βœ… returns wants divided by price
  βœ… returns wants multiplied by price
Market unit tests suite getGivesWantsForVolumeAtPrice
  βœ… return gives = volume && wants = volume*price for undefined type
  βœ… return gives = volume*price && wants = volume for undefined type
Market unit tests suite getWantsForPrice
  βœ… returns gives multiplied by price
  βœ… returns wants divided by price

βœ…Β test/unit/prettyPrint.unit.test.ts

PrettyPrint Unit test suite consoleOffers
  βœ… should use default filter
  βœ… should use given filter
PrettyPrint Unit test suite prettyPrint
  βœ… prints the offers using the given filter

βœ…Β test/unit/semibook.unit.test.ts

Semibook unit test suite getIsVolumeDesiredForAsks
  βœ… returns false, when desiredVolume is undefined
  βœ… returns false, when what is base and to is sell
  βœ… returns false, when what is quote and to is buy
  βœ… returns true, when what is base and to is buy
  βœ… returns true, when what is quote and to is sell
Semibook unit test suite getIsVolumeDesiredForBids
  βœ… returns false, when desiredVolume is undefined
  βœ… returns false, when what is base and to is buy 
  βœ… returns false, when what is quote and to is sell 
  βœ… returns true, when what is base and to is sell 
  βœ… returns true, when what is quote and to is buy 
Semibook unit test suite getOfferFromCacheOrFail
  βœ… returns offer when offer is in cache
  βœ… throws error when offer is not in cache
Semibook unit test suite insertOffer
  βœ… inserting offer exceeds maxOffer size, offer is not worst offer
  βœ… inserting offer exceeds maxOffer size, offer is worst offer
  βœ… inserts offer in empty book
  βœ… inserts offer in non empty book, offer is at a better tick, tick already exist
  βœ… inserts offer in non empty book, offer is at worse tick, tick already exist
  βœ… inserts offer in non empty book, offer is better
  βœ… inserts offer in non empty book, offer is in the middle
  βœ… inserts offer in non empty book, offer is in the middle at an already existing tick
  βœ… inserts offer in non empty book, offer is worse
Semibook unit test suite removeOffer
  βœ… removes last offer in book
  βœ… removes offer from empty book
  βœ… removes offer from non empty book, offer is best offer, does not have others at same tick
  βœ… removes offer from non empty book, offer is best offer, has others at same tick
  βœ… removes offer from non empty book, offer is worst offer, has others at same tick
  βœ… removes offer from non empty book, offer is worst offer, has others at same tick

βœ…Β test/unit/tickLib.unit.test.ts

TickLib unit test suite divExpUp
  βœ… a==0 then rem == 0, should return  (a >> e) + rem
  βœ… e<256 and a > 0 
  βœ… e>255 then rem == 1, should return  (a >> e) + rem
TickLib unit test suite floatLt
  βœ… returns false when exp_a < exp_b
  βœ… returns false when exp_a == exp_b and mantissa_a >= mantissa_b
  βœ… returns true when exp_a == exp_b and mantissa_a < mantissa_b
  βœ… returns true when exp_a > exp_b and mantissa_a < mantissa_b
TickLib unit test suite getTickFromPrice
  βœ… should return the correct tick for price, MAX_TICK
TickLib unit test suite inboundFromOutbound
  βœ… should return the correct value of inbound from outbound based on tick
TickLib unit test suite inboundFromOutboundUp
  βœ… should return the correct rounded up value of inbound from outbound based on tick
TickLib unit test suite inRange
  βœ… should return false if tick is outside the range
  βœ… should return true if tick is within the range
TickLib unit test suite nonNormalizedPriceFromTick
  βœ… Test with maximum tick
  βœ… Test with minimum tick
  βœ… Test with negative tick
  βœ… Test with positive tick
  βœ… Test with tick exceeding MAX_TICK
TickLib unit test suite normalizePrice
  βœ… should handle negative shift correctly
  βœ… should handle positive shift correctly
  βœ… should throw an error if exp is less than 0 after normalization
  βœ… should throw an error if mantissa is zero
TickLib unit test suite outboundFromInbound
  βœ… should return the correct value of outbound from inbound based on tick
TickLib unit test suite outboundFromInboundUp
  βœ… should return the correct rounded up value of outbound from inbound based on tick
TickLib unit test suite priceFromTick
  βœ… should return the correct price for tick, 0
  βœ… should return the correct price for tick, 1 
  βœ… should return the correct price for tick, MAX_TICK
  βœ… should return the correct price for tick, MIN_TICK
TickLib unit test suite priceFromVolumes
  βœ… should return the correct mantissa and exp for non-zero inboundAmt and outboundAmt
  βœ… should return the correct mantissa and exp when inboundAmt is 0
  βœ… should return the correct mantissa and exp when outboundAmt is 0
TickLib unit test suite priceToMantissaAndExponent
  βœ… should return the correct mantissa and exponent for price, MAX_TICK
  βœ… should return the correct mantissa and exponent for price, MIN_TICK
  βœ… should return the correct mantissa and exponent for price, tick = -1
  βœ… should return the correct mantissa and exponent for price, tick = -1000
  βœ… should return the correct mantissa and exponent for price, tick = 0
  βœ… should return the correct mantissa and exponent for price, tick = 1
  βœ… should return the correct mantissa and exponent for price, tick = 1000
TickLib unit test suite ratioFromTick
  βœ… test_ratioFromTick
TickLib unit test suite tickFromNormalizedPrice
  βœ… should return the correct tick for normalizedPrice
  βœ… should revert with mgv/tickFromRatio/tooHigh
  βœ… should revert with mgv/tickFromRatio/tooLow
TickLib unit test suite tickFromRatio
  βœ… should return the correct tick for price
TickLib unit test suite tickFromVolumes
  βœ… should return tick 

βœ…Β test/unit/tickPriceHelper.unit.test.ts

TickPriceHelper unit tests suite
  βœ… manual calculation
  βœ… manual calculation inverse decimals
TickPriceHelper unit tests suite inboundFromOutbound
  βœ… inboundFromOutbound ba=asks base=1 quote=2 price=2
  βœ… inboundFromOutbound ba=asks base=1 quote=2 price=2
  βœ… inboundFromOutbound ba=asks base=2 quote=1 price=0.5
  βœ… inboundFromOutbound ba=asks base=2 quote=1 price=0.5
  βœ… inboundFromOutbound ba=asks base=6 quote=3 price=0.5
  βœ… inboundFromOutbound ba=asks base=6 quote=3 price=0.5
  βœ… inboundFromOutbound ba=bids base=1 quote=2 price=2
  βœ… inboundFromOutbound ba=bids base=1 quote=2 price=2
  βœ… inboundFromOutbound ba=bids base=2 quote=1 price=0.5
  βœ… inboundFromOutbound ba=bids base=2 quote=1 price=0.5
  βœ… inboundFromOutbound ba=bids base=6 quote=3 price=0.5
  βœ… inboundFromOutbound ba=bids base=6 quote=3 price=0.5
  βœ… outboundFromInbound ba=asks base=1 quote=2 price=2
  βœ… outboundFromInbound ba=asks base=1 quote=2 price=2
  βœ… outboundFromInbound ba=asks base=2 quote=1 price=0.5
  βœ… outboundFromInbound ba=asks base=2 quote=1 price=0.5
  βœ… outboundFromInbound ba=asks base=6 quote=3 price=0.5
  βœ… outboundFromInbound ba=asks base=6 quote=3 price=0.5
  βœ… outboundFromInbound ba=bids base=1 quote=2 price=2
  βœ… outboundFromInbound ba=bids base=1 quote=2 price=2
  βœ… outboundFromInbound ba=bids base=2 quote=1 price=0.5
  βœ… outboundFromInbound ba=bids base=2 quote=1 price=0.5
  βœ… outboundFromInbound ba=bids base=6 quote=3 price=0.5
  βœ… outboundFromInbound ba=bids base=6 quote=3 price=0.5
TickPriceHelper unit tests suite priceFromTick
  βœ… returns price=1 for tick 0 with base decimals: 6, quote decimals: 6 (asks semibook)
  βœ… returns price=1 for tick 0 with base decimals: 6, quote decimals: 6 (bids semibook)
  βœ… returns price=1.00000396574 for tick 414486 with base decimals: 18, quote decimals: 0 (bids semibook)
  βœ… returns price=1.000096 for tick -414487 with base decimals: 0, quote decimals: 18 (bids semibook)
  βœ… returns price=100 for tick 0 with base decimals: 2, quote decimals: 0 (asks semibook)
  βœ… returns price=100 for tick 0 with base decimals: 2, quote decimals: 0 (bids semibook)
  βœ… returns price=1838.53469156 for tick -75171 with base decimals: 18, quote decimals: 18 (bids semibook)
  βœ… returns price=1838.534691561 for tick 75171 with base decimals: 18, quote decimals: 18 (asks semibook)
  βœ… returns price=1e-12 for tick 0 with base decimals: 6, quote decimals: 18 (asks semibook)
  βœ… returns price=1e-12 for tick 0 with base decimals: 6, quote decimals: 18 (bids semibook)
TickPriceHelper unit tests suite priceFromTick is inverse of tickFromPrice (up to tick-step)
  βœ… returns price=1 for tickFromPrice(..., tickFromPrice(..., 1))) with base decimals: 6, quote decimals: 6 for asks semibook
  βœ… returns price=1 for tickFromPrice(..., tickFromPrice(..., 1))) with base decimals: 6, quote decimals: 6 for bids semibook
  βœ… returns price=1.00000396574 for tickFromPrice(..., tickFromPrice(..., 1.00000396574))) with base decimals: 18, quote decimals: 0 for bids semibook
  βœ… returns price=1.000096 for tickFromPrice(..., tickFromPrice(..., 1.000096))) with base decimals: 0, quote decimals: 18 for bids semibook
  βœ… returns price=100 for tickFromPrice(..., tickFromPrice(..., 100))) with base decimals: 2, quote decimals: 0 for asks semibook
  βœ… returns price=100 for tickFromPrice(..., tickFromPrice(..., 100))) with base decimals: 2, quote decimals: 0 for bids semibook
  βœ… returns price=1838.53469156 for tickFromPrice(..., tickFromPrice(..., 1838.53469156))) with base decimals: 18, quote decimals: 18 for bids semibook
  βœ… returns price=1838.534691561 for tickFromPrice(..., tickFromPrice(..., 1838.534691561))) with base decimals: 18, quote decimals: 18 for asks semibook
  βœ… returns price=1e-12 for tickFromPrice(..., tickFromPrice(..., 1e-12))) with base decimals: 6, quote decimals: 18 for asks semibook
  βœ… returns price=1e-12 for tickFromPrice(..., tickFromPrice(..., 1e-12))) with base decimals: 6, quote decimals: 18 for bids semibook
TickPriceHelper unit tests suite tickFromPrice
  βœ… returns tick=-414487 for price 1.000096 with base decimals: 0, quote decimals: 18 (bids semibook)) 
  βœ… returns tick=-75171 for price 1838.53469156 with base decimals: 18, quote decimals: 18 (bids semibook)) 
  βœ… returns tick=0 for price 1 with base decimals: 6, quote decimals: 6 (asks semibook)) 
  βœ… returns tick=0 for price 1 with base decimals: 6, quote decimals: 6 (bids semibook)) 
  βœ… returns tick=0 for price 100 with base decimals: 2, quote decimals: 0 (asks semibook)) 
  βœ… returns tick=0 for price 100 with base decimals: 2, quote decimals: 0 (bids semibook)) 
  βœ… returns tick=0 for price 1e-12 with base decimals: 6, quote decimals: 18 (asks semibook)) 
  βœ… returns tick=0 for price 1e-12 with base decimals: 6, quote decimals: 18 (bids semibook)) 
  βœ… returns tick=414486 for price 1.00000396574 with base decimals: 18, quote decimals: 0 (bids semibook)) 
  βœ… returns tick=75171 for price 1838.534691561 with base decimals: 18, quote decimals: 18 (asks semibook)) 
TickPriceHelper unit tests suite tickFromPrice is inverse of priceFromTick (up to tick-step)
  βœ… returns tick=-414487 for priceFromTick(..., priceFromTick(..., -414487))) with base decimals: 0, quote decimals: 18 for bids semibook
  βœ… returns tick=-75171 for priceFromTick(..., priceFromTick(..., -75171))) with base decimals: 18, quote decimals: 18 for bids semibook
  βœ… returns tick=0 for priceFromTick(..., priceFromTick(..., 0))) with base decimals: 2, quote decimals: 0 for asks semibook
  βœ… returns tick=0 for priceFromTick(..., priceFromTick(..., 0))) with base decimals: 2, quote decimals: 0 for bids semibook
  βœ… returns tick=0 for priceFromTick(..., priceFromTick(..., 0))) with base decimals: 6, quote decimals: 18 for asks semibook
  βœ… returns tick=0 for priceFromTick(..., priceFromTick(..., 0))) with base decimals: 6, quote decimals: 18 for bids semibook
  βœ… returns tick=0 for priceFromTick(..., priceFromTick(..., 0))) with base decimals: 6, quote decimals: 6 for asks semibook
  βœ… returns tick=0 for priceFromTick(..., priceFromTick(..., 0))) with base decimals: 6, quote decimals: 6 for bids semibook
  βœ… returns tick=414486 for priceFromTick(..., priceFromTick(..., 414486))) with base decimals: 18, quote decimals: 0 for bids semibook
  βœ… returns tick=75171 for priceFromTick(..., priceFromTick(..., 75171))) with base decimals: 18, quote decimals: 18 for asks semibook
TickPriceHelper unit tests suite tickFromVolumes
  βœ… returns tick=0 for inboundVolume=1, outboundVolume=1 with base decimals: 6, quote decimals: 6 (asks semibook)
  βœ… returns tick=0 for inboundVolume=1, outboundVolume=1 with base decimals: 6, quote decimals: 6 (bids semibook)

βœ…Β test/unit/trade.unit.test.ts

Trade unit tests suite comparePrices
  βœ… returns false, when price = referencePrice and compare is β€œgtβ€œ
  βœ… returns false, when price = referencePrice and compare is β€œltβ€œ
  βœ… returns false, when price > referencePrice and compare is β€œgtβ€œ
  βœ… returns false, when price > referencePrice and compare is β€œltβ€œ
  βœ… returns true, when price < referencePrice and compare is β€œgtβ€œ
  βœ… returns true, when price < referencePrice and compare is β€œltβ€œ
Trade unit tests suite getParamsForBuy
  βœ… returns fillVolume as fillVolume, tick as tick and fillWants as fillWants, when params has tick, fillVolume and fillWants 
  βœ… returns fillVolume as fillVolume, tick as tick and fillWants as true, when params has fillVolume and tick, but no fillWants 
  βœ… returns fillVolume as gives, tick as TickLib.fromVolume(gives,wants) and fillWants as fillWants, when params has gives, wants and fillWants 
  βœ… returns fillVolume as total, tick as tick(price) and fillWants false, when params has price!=null and total
  βœ… returns fillVolume as volume, tick as -1*tick(price) and fillWants true, when params has price!=null and volume
Trade unit tests suite getParamsForSell
  βœ… returns fillVolume as fillVolume, tick as tick and fillWants false, when params has wants and gives, but no fillWants
  βœ… returns fillVolume as gives, tick as TickLib.fromVolume(gives,wants) and fillWants as fillWants, when params has gives, wants and fillWants 
  βœ… returns fillVolume as total, tick as tick(price) and fillWants true, when params has price!=null and total
  βœ… returns fillVolume as volume, tick as tick(price) and fillWants false, when params has price!=null and volume
  βœ… returns wants as wants, gives as gives and fillWants as fillWants, when params has wants, gives and fillWants
Trade unit tests suite isPriceBetter
  βœ… Uses β€œgtβ€œ when ba = bids
  βœ… Uses β€œltβ€œ when ba = asks
Trade unit tests suite isPriceWorse
  βœ… Uses β€œgtβ€œ when ba = bids
  βœ… Uses β€œltβ€œ when ba = asks
Trade unit tests suite validateSlippage
  βœ… return given slippage, when it is valid
  βœ… returns 0, when slippage is undefined
  βœ… throw error, when slippage is above 100
  βœ… throw error, when slippage is lower than 0

βœ…Β test/unit/tradeEventManagement.unit.test.ts

TradeEventManagement unit tests suite createPosthookFailure
  βœ… returns posthookFailure object, always
TradeEventManagement unit tests suite createSuccess
  βœ… returns Success object, always
TradeEventManagement unit tests suite createSummary
  βœ… return summary with partialFill as true, when partialFill func returns true
TradeEventManagement unit tests suite createSummaryForOrderComplete
  βœ… returns createSummary, always
TradeEventManagement unit tests suite createSummaryForOrderSummary
  βœ… returns createSummary with offerId, always
TradeEventManagement unit tests suite createTradeFailure
  βœ… returns TradeFailure object, always
TradeEventManagement unit tests suite rawOfferToOffer
  βœ… returns offer with correct values for asks
  βœ… returns offer with correct values for bids

βœ…Β test/unit/unitCalculations.unit.test.ts

UnitCalculations unit tests suite fromUnits
  βœ… returns Big number, amount is BigNumber and nameOrDecimal is number
  βœ… returns Big number, amount is number and nameOrDecimal is number
  βœ… returns Big number, amount is number and nameOrDecimal is string
  βœ… returns Big number, amount is string and nameOrDecimal is number