The abstract AMM contract contains variables and functions pertaining to the Uniswap V2 style AMM vault. The vault is itself a different contract but is a first class citizen and is tightly integrated with the Orderbook contract. The Orderbook contract inherits from the Abstract AMM contract which enables the vault to place orders at clearly defined price intervals.
uint256 vaultPricePrecision
- The price precision of orders placed by the vault.address kuruAmmVault
- Address of the kuru AMM vault contractuint256 vaultBestBid
- The vault’s best bid priceuint96 bidPartiallyFilledSize
- The partially filled bid size supplied by the vaultuint96 vaultBidOrderSize
- The total bid order size of the vaultuint96 vaultAskOrderSize
- The total ask order size of the vaultThe vault contract is used for managing deposits, withdrawals and initialising the vault price while the abstract AMM handles the buy and sell order fills.
This function is used by placeAndExecuteMarketBuy()
.
Input parameters:
uint256 _breakPoint
- The price till which the vault should filluint32 _quoteSize
- The quote size available for the vault to fillReturn parameters:
uint32 quoteLeft
- The quote left to filluint96 sizeFilled
- The size which is filled by the vaultbytes memory makerCredits
- The encoded data containing info on tokens to be credited to the vault