Skip to main content

Bot Smart Contracts

You may have saw there are some .sol files in contracts/ of liquidation bot. They include a main contract Terminator.sol and some auxiliary contract like interfaces, etc. Thus we will focus on the Terminator.sol file in this chapter. This the tables of variables and functions.

Variables

VariableInterpretation
mapping(address => bool) public executorsMap from address to a bool indicating if this address is an executor.
address[] public yearnList of yearn vaults connected.

Functions

FunctionsInterpretation
allowExecutor(address _executor)Add executor.
forbidExecutor(address _executor)Remove executor.
addYearn(address _yearn)Add yearn deposit vault.
liquidateAndSellOnV2(
address _creditManager,
address _borrower,
address _router,
UniV2Params[] calldata _paths
)
Execute liquidation action on
_borrower's CreditAccount of
_creditManager and sell on
Uniswap V2.