The Credit Facade is the user-facing contract that handles credit account operations including opening, closing, liquidation, and multicall execution.
View Functions
creditManager
function creditManager() external view returns (address)
Returns the address of the credit manager.
The credit manager contract address
underlying
function underlying() external view returns (address)
Returns the address of the underlying token.
The underlying token address
treasury
function treasury() external view returns (address)
Returns the treasury address.
priceFeedStore
function priceFeedStore() external view returns (address)
Returns the price feed store address.
The price feed store contract address
degenNFT
function degenNFT() external view returns (address)
Returns the degen NFT address.
The degen NFT contract address
weth
function weth() external view returns (address)
Returns the WETH address.
botList
function botList() external view returns (address)
Returns the bot list address.
The bot list contract address
maxDebtPerBlockMultiplier
function maxDebtPerBlockMultiplier() external view returns (uint8)
Returns the max debt per block multiplier.
maxQuotaMultiplier
function maxQuotaMultiplier() external view returns (uint256)
Returns the max quota multiplier.
expirable
function expirable() external view returns (bool)
Returns whether the credit facade is expirable.
True if the facade can expire
expirationDate
function expirationDate() external view returns (uint40)
Returns the expiration date timestamp.
Unix timestamp of expiration
debtLimits
function debtLimits() external view returns (uint128 minDebt, uint128 maxDebt)
Returns the debt limits.
Minimum debt per credit account
Maximum debt per credit account
lossPolicy
function lossPolicy() external view returns (address)
Returns the loss policy address.
The loss policy contract address
forbiddenTokenMask
function forbiddenTokenMask() external view returns (uint256)
Returns the forbidden token mask.
Bitmask of forbidden tokens
Account Management
openCreditAccount
function openCreditAccount(
address onBehalfOf,
MultiCall[] calldata calls,
uint256 referralCode
) external payable returns (address creditAccount)
Opens a new credit account and executes a multicall.
The address to open the account for
Array of multicall operations to execute
Referral code for tracking
The address of the newly opened credit account
closeCreditAccount
function closeCreditAccount(
address creditAccount,
MultiCall[] calldata calls
) external payable
Closes a credit account after executing a multicall.
The credit account to close
Array of multicall operations to execute before closing
liquidateCreditAccount
function liquidateCreditAccount(
address creditAccount,
address to,
MultiCall[] calldata calls,
bytes memory lossPolicyData
) external
Liquidates a credit account with loss policy data.
The credit account to liquidate
Address to send remaining funds to
Array of multicall operations to execute during liquidation
function liquidateCreditAccount(
address creditAccount,
address to,
MultiCall[] calldata calls
) external
Liquidates a credit account without loss policy data.
The credit account to liquidate
Address to send remaining funds to
Array of multicall operations to execute during liquidation
partiallyLiquidateCreditAccount
function partiallyLiquidateCreditAccount(
address creditAccount,
address token,
uint256 repaidAmount,
uint256 minSeizedAmount,
address to,
PriceUpdate[] calldata priceUpdates
) external returns (uint256 seizedAmount)
Partially liquidates a credit account by repaying debt and seizing collateral.
The credit account to partially liquidate
The collateral token to seize
Minimum amount of collateral to seize
Address to send seized collateral to
Array of price updates to apply
Amount of collateral seized
multicall
function multicall(
address creditAccount,
MultiCall[] calldata calls
) external payable
Executes a multicall on a credit account.
The credit account to execute on
Array of multicall operations to execute
botMulticall
function botMulticall(
address creditAccount,
MultiCall[] calldata calls
) external
Executes a multicall on a credit account as a bot.
The credit account to execute on
Array of multicall operations to execute
Configuration
setExpirationDate
function setExpirationDate(uint40 newExpirationDate) external
Sets a new expiration date.
setDebtLimits
function setDebtLimits(
uint128 newMinDebt,
uint128 newMaxDebt,
uint8 newMaxDebtPerBlockMultiplier
) external
Sets new debt limits and max debt per block multiplier.
newMaxDebtPerBlockMultiplier
New max debt per block multiplier
setLossPolicy
function setLossPolicy(address newLossPolicy) external
Sets a new loss policy.
New loss policy contract address
setTokenAllowance
function setTokenAllowance(
address token,
AllowanceAction allowance
) external
Sets token allowance (forbid or allow).
The allowance action (FORBID or ALLOW)
pause
function pause() external
Pauses the credit facade.
unpause
function unpause() external
Unpauses the credit facade.