Skip to main content
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.
creditManager
address
The credit manager contract address

underlying

function underlying() external view returns (address)
Returns the address of the underlying token.
underlying
address
The underlying token address

treasury

function treasury() external view returns (address)
Returns the treasury address.
treasury
address
The treasury address

priceFeedStore

function priceFeedStore() external view returns (address)
Returns the price feed store address.
priceFeedStore
address
The price feed store contract address

degenNFT

function degenNFT() external view returns (address)
Returns the degen NFT address.
degenNFT
address
The degen NFT contract address

weth

function weth() external view returns (address)
Returns the WETH address.
weth
address
The WETH token address

botList

function botList() external view returns (address)
Returns the bot list address.
botList
address
The bot list contract address

maxDebtPerBlockMultiplier

function maxDebtPerBlockMultiplier() external view returns (uint8)
Returns the max debt per block multiplier.
multiplier
uint8
The multiplier value

maxQuotaMultiplier

function maxQuotaMultiplier() external view returns (uint256)
Returns the max quota multiplier.
multiplier
uint256
The multiplier value

expirable

function expirable() external view returns (bool)
Returns whether the credit facade is expirable.
expirable
bool
True if the facade can expire

expirationDate

function expirationDate() external view returns (uint40)
Returns the expiration date timestamp.
expirationDate
uint40
Unix timestamp of expiration

debtLimits

function debtLimits() external view returns (uint128 minDebt, uint128 maxDebt)
Returns the debt limits.
minDebt
uint128
Minimum debt per credit account
maxDebt
uint128
Maximum debt per credit account

lossPolicy

function lossPolicy() external view returns (address)
Returns the loss policy address.
lossPolicy
address
The loss policy contract address

forbiddenTokenMask

function forbiddenTokenMask() external view returns (uint256)
Returns the forbidden token mask.
forbiddenTokenMask
uint256
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.
onBehalfOf
address
required
The address to open the account for
calls
MultiCall[]
required
Array of multicall operations to execute
referralCode
uint256
required
Referral code for tracking
creditAccount
address
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.
creditAccount
address
required
The credit account to close
calls
MultiCall[]
required
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.
creditAccount
address
required
The credit account to liquidate
to
address
required
Address to send remaining funds to
calls
MultiCall[]
required
Array of multicall operations to execute during liquidation
lossPolicyData
bytes
required
Data for the loss policy
function liquidateCreditAccount(
    address creditAccount,
    address to,
    MultiCall[] calldata calls
) external
Liquidates a credit account without loss policy data.
creditAccount
address
required
The credit account to liquidate
to
address
required
Address to send remaining funds to
calls
MultiCall[]
required
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.
creditAccount
address
required
The credit account to partially liquidate
token
address
required
The collateral token to seize
repaidAmount
uint256
required
Amount of debt to repay
minSeizedAmount
uint256
required
Minimum amount of collateral to seize
to
address
required
Address to send seized collateral to
priceUpdates
PriceUpdate[]
required
Array of price updates to apply
seizedAmount
uint256
Amount of collateral seized

multicall

function multicall(
    address creditAccount,
    MultiCall[] calldata calls
) external payable
Executes a multicall on a credit account.
creditAccount
address
required
The credit account to execute on
calls
MultiCall[]
required
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.
creditAccount
address
required
The credit account to execute on
calls
MultiCall[]
required
Array of multicall operations to execute

Configuration

setExpirationDate

function setExpirationDate(uint40 newExpirationDate) external
Sets a new expiration date.
newExpirationDate
uint40
required
New expiration timestamp

setDebtLimits

function setDebtLimits(
    uint128 newMinDebt,
    uint128 newMaxDebt,
    uint8 newMaxDebtPerBlockMultiplier
) external
Sets new debt limits and max debt per block multiplier.
newMinDebt
uint128
required
New minimum debt
newMaxDebt
uint128
required
New maximum debt
newMaxDebtPerBlockMultiplier
uint8
required
New max debt per block multiplier

setLossPolicy

function setLossPolicy(address newLossPolicy) external
Sets a new loss policy.
newLossPolicy
address
required
New loss policy contract address

setTokenAllowance

function setTokenAllowance(
    address token,
    AllowanceAction allowance
) external
Sets token allowance (forbid or allow).
token
address
required
The token address
allowance
AllowanceAction
required
The allowance action (FORBID or ALLOW)

pause

function pause() external
Pauses the credit facade.

unpause

function unpause() external
Unpauses the credit facade.

Build docs developers (and LLMs) love