Skip to main content

ILiquidityProvider

ILiquidityProvider​

newOffer​

function newOffer(struct OLKey olKey, Tick tick, uint256 gives, uint256 gasreq) external payable returns (uint256 offerId)

creates a new offer on Mangrove with an override for gas requirement

Parameters​

NameTypeDescription
olKeystruct OLKeythe offer list key.
tickTickthe tick
givesuint256the amount of inbound tokens the offer maker gives for a complete fill
gasrequint256the gas required by the offer logic

Return Values​

NameTypeDescription
offerIduint256the Mangrove offer id.

updateOffer​

function updateOffer(struct OLKey olKey, Tick tick, uint256 gives, uint256 offerId, uint256 gasreq) external payable

updates an offer existing on Mangrove (not necessarily live) with an override for gas requirement

Parameters​

NameTypeDescription
olKeystruct OLKeythe offer list key.
tickTickthe tick
givesuint256the new amount of inbound tokens the offer maker gives for a complete fill
offerIduint256the id of the offer in the offer list.
gasrequint256the gas required by the offer logic

retractOffer​

function retractOffer(struct OLKey olKey, uint256 offerId, bool deprovision) external returns (uint256 freeWei)

Retracts an offer from an Offer List of Mangrove.

An offer that is retracted without deprovision is retracted from the offer list, but still has its provisions locked by Mangrove. Calling this function, with the deprovision flag, on an offer that is already retracted must be used to retrieve the locked provisions.

Parameters​

NameTypeDescription
olKeystruct OLKeythe offer list key.
offerIduint256the identifier of the offer in the offer list
deprovisionboolif set to true if offer owner wishes to redeem the offer's provision.

Return Values​

NameTypeDescription
freeWeiuint256the amount of native tokens (in WEI) that have been retrieved by retracting the offer.