Fraction ProtocolinterfacesoracleFacetslendingOracle

ILendingOracleFacet

It defines the basic interface of LendingOracle Facets.

LendingOracleInitialized

event LendingOracleInitialized()

LendingOracleConfigured

event LendingOracleConfigured(uint256 campaignId, uint256[] proportionsOverObligation)

initLendingOracleFacet

function initLendingOracleFacet(bytes initLendingOracleData) external

Initializes the lending oracle facet.

Called by the creator of the tokenizer.

Parameters

NameTypeDescription
initLendingOracleDatabytesThe data associated with the initialization.

setAndCheckLendingOracleFacet

function setAndCheckLendingOracleFacet(bytes setAndCheckLendingOracleData) external

Sets data on the lending oracle facet for the newly created campaignId and checks if all data are correct.

Called by the creator of the campaign.

Parameters

NameTypeDescription
setAndCheckLendingOracleDatabytesThe data associated with the setAndCheck.

setPriceLimitsOnPostReceive

function setPriceLimitsOnPostReceive(uint256 campaignId) external

Sets the price limits of the oracle after fractions are purchased.

This function should be registered as a before state hook on FUNDED state Can only be called after purchase phase is done, because thats when the amount of fractions actually purchased is revealed. (i.e., when the creator (the address that receives the loan) is able to receive the lent assets) Selector: 0xdd9a32c5

Parameters

NameTypeDescription
campaignIduint256The campaignId associated with the action.

setCollateralPrice

function setCollateralPrice(uint256 campaignId, uint256 collateralPrice) external

Sets the collateral price in funding packets for a given campaign.

Parameters

NameTypeDescription
campaignIduint256The campaignId associated with the action.
collateralPriceuint256The collateral price in funding packets.

removeMarginFromPriceLimits

function removeMarginFromPriceLimits(uint256 campaignId, uint256 packetsMarginAmount) external

Removes the margin added in case of a successful marginCall.

Parameters

NameTypeDescription
campaignIduint256The campaignId associated with the action.
packetsMarginAmountuint256The packetsMarginAmount that is added.

checkDifferenceBetweenPriceAndCurrentPriceLevel

function checkDifferenceBetweenPriceAndCurrentPriceLevel(uint256 campaignId) external view returns (uint256)

Returns the substraction between price of the collateral and the price of the limit reached.

Parameters

NameTypeDescription
campaignIduint256The campaignId associated with the action.

getRemainingObligation

function getRemainingObligation(uint256 campaignId) external view returns (uint256)

Returns the remaining obligation which is different from obligationToEachFraction * fractionsPurchased in case of Margin call.

Parameters

NameTypeDescription
campaignIduint256The campaignId associated with the action.