LendingOracleFacet
LendingOracleFacet
NonPriceSetter
Thrown when attempting to set price from a non price setter account.
UnauthorizedInitialization
Thrown when trying to initialize from non admin account.
LendingOracleCollateralPriceSet
SetCollateralPriceLimitsOnPostReceiveHookExecuted
RemoveMarginFromPriceLimitsExecuted
initLendingOracleFacet
Initializes the lending oracle facet.
Called by the creator of the tokenizer.
Parameters
Name | Type | Description |
---|---|---|
initLendingOracleData | bytes | The data associated with the initialization. |
setAndCheckLendingOracleFacet
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
Name | Type | Description |
---|---|---|
setAndCheckLendingOracleData | bytes | The data associated with the setAndCheck. |
setCollateralPrice
Sets the collateral price in funding packets for a given campaign.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The campaignId associated with the action. |
collateralPrice | uint256 | The collateral price in funding packets. |
setPriceLimitsOnPostReceive
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
Name | Type | Description |
---|---|---|
campaignId | uint256 | The campaignId associated with the action. |
removeMarginFromPriceLimits
Removes the margin added in case of a successful marginCall.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The campaignId associated with the action. |
packetsMarginAmount | uint256 | The packetsMarginAmount that is added. |
checkDifferenceBetweenPriceAndCurrentPriceLevel
Returns the substraction between price of the collateral and the price of the limit reached.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The campaignId associated with the action. |
getRemainingObligation
Returns the remaining obligation which is different from obligationToEachFraction * fractionsPurchased in case of Margin call.
Accounts for any added margin amounts, ensuring that the returned obligation is always current.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The campaignId associated with the action. |