pool

The Pool contract is the main interface for users and integrations.

Typical user actions:

  • supply

  • withdraw

  • borrow

  • repay

  • toggle collateral usage

  • liquidate

  • flash loans

Write methods

supply

function supply(
  address asset,
  uint256 amount,
  address onBehalfOf,
  uint16 referralCode
) external;

Deposits an asset into Orchid and mints oTokens to onBehalfOf.

Notes:

  • You must approve the Pool to spend the underlying token first

  • referralCode can be 0 if not used


supplyWithPermit

Supply using an ERC-2612 permit signature so users do not need a separate approval transaction.


withdraw

Burns your oTokens and returns the underlying asset.

Notes:

  • If your collateral backs debt, withdrawals are limited to keep your account safe

  • Use type(uint256).max to withdraw full balance


borrow

Borrows an asset if the account has sufficient collateral and borrowing power.

Notes:

  • Orchid may support only variable rate mode. If so, pass the correct constant for variable mode as defined in the protocol


repay

Repays debt for onBehalfOf and burns the debt tokens.

Notes:

  • Approve the Pool to spend the underlying token first

  • Use type(uint256).max to repay all debt for yourself


repayWithPermit

Repay using ERC-2612 permit approval.


repayWithOTokens

Repay using your oTokens instead of transferring the underlying token.


setUserUseReserveAsCollateral

Enables or disables an asset as collateral for the caller.

Notes:

  • Orchid will block disabling collateral if doing so makes the account liquidatable


liquidationCall

Allows anyone to liquidate an unhealthy position.

  • liquidator repays a portion of debtAsset

  • liquidator receives discounted collateralAsset

  • receiveOToken can return oTokens instead of underlying collateral if enabled


flashLoan

Borrows liquidity that must be returned in the same transaction plus fee, otherwise the transaction reverts.

Last updated