CoreKandel is agnostic to the chosen price distribution.
SetGasprice
eventSetGasprice(uint256value)
the gasprice has been set.
By emitting this data, an indexer will be able to keep track of what gasprice is used.
Parameters
Name
Type
Description
value
uint256
the gasprice for offers.
SetGasreq
eventSetGasreq(uint256value)
the gasreq has been set.
By emitting this data, an indexer will be able to keep track of what gasreq is used.
Parameters
Name
Type
Description
value
uint256
the gasreq (including router's gasreq) for offers
SetStepSize
eventSetStepSize(uint256value)
the step size has been set.
Parameters
Name
Type
Description
value
uint256
the step size in amount of price points to jump for posting dual offer
Credit
the Kandel instance is credited of amount by its owner.
By emitting this data, an indexer will be able to keep track of what credits are made.
Parameters
Name
Type
Description
token
contract IERC20
the asset. This is indexed so that RPC calls can filter on it.
amount
uint256
the amount.
Debit
the Kandel instance is debited of amount by its owner.
By emitting this data, an indexer will be able to keep track of what debits are made.
Parameters
Name
Type
Description
token
contract IERC20
the asset. This is indexed so that RPC calls can filter on it.
amount
uint256
the amount.
Params
Core Kandel parameters
Parameters
params
Storage of the parameters for the strat.
setStepSize
sets the step size
Parameters
Name
Type
Description
stepSize
uint256
the step size.
setGasprice
sets the gasprice for offers
Parameters
Name
Type
Description
gasprice
uint256
the gasprice.
setGasreq
sets the gasreq (including router's gasreq) for offers
Parameters
Name
Type
Description
gasreq
uint256
the gasreq.
setParams
Updates the params to new values.
Parameters
Name
Type
Description
newParams
struct CoreKandel.Params
the new params to set.
constructor
Constructor
Parameters
Name
Type
Description
mgv
contract IMangrove
The Mangrove deployment.
olKeyBaseQuote
struct OLKey
The OLKey for the outbound_tkn base and inbound_tkn quote offer list Kandel will act on, the flipped OLKey is used for the opposite offer list.
reserveId
address
identifier of this contract's reserve when using a router.
populate
publishes bids/asks for the distribution in the indices. Care must be taken to publish offers in meaningful chunks. For Kandel an offer and its dual should be published in the same chunk (one being optionally initially dead).
This function is used at initialization and can fund with provision for the offers.
Use populateChunk to split up initialization or re-initialization with same parameters, as this function will emit.
If this function is invoked with different pricePoints or stepSize, then first retract all offers.
msg.value must be enough to provision all posted offers (for chunked initialization only one call needs to send native tokens).
the parameters for Kandel. Only changed parameters will cause updates. Set gasreq and gasprice to 0 to keep existing values.
baseAmount
uint256
base amount to deposit
quoteAmount
uint256
quote amount to deposit
populateChunk
Publishes bids/asks for the distribution in the indices. Care must be taken to publish offers in meaningful chunks. For Kandel an offer and its dual should be published in the same chunk (one being optionally initially dead).
This function is used externally after populate to reinitialize some indices or if multiple transactions are needed to split initialization due to gas cost.
This function is not payable, use populate to fund along with populate.