Maple
  • Welcome to Maple
  • Maple for Lenders
    • Introduction
    • Lending
    • Defaults and Impairments
    • Margin Calls and Liquidations
    • Risk
    • Withdrawal Process
  • syrupUSDC for Lenders
    • Powered by Maple
    • Lending in syrupUSDC and syrupUSDT
    • Commitments
    • Drips Rewards
    • Withdrawals
    • Monthly Updates
    • Pendle Integration
  • SyrupUSDC Rewards Prize Draw Program Summary
  • FAQ
  • Maple for Borrowers
    • Introduction
    • Loan Management
  • Maple for Token Holders
    • Introduction to SYRUP
      • MPL to SYRUP Conversion
      • FAQs
    • SYRUP Tokenomics
      • Staking
      • Staking Smart Contract Details
    • Governance and Voting
    • Drips Rewards
    • Research and Media
      • Podcasts
      • News Articles
      • TV Segments
      • Research Reports
      • Data Dashboards
    • Additional Resources
  • Technical Resources
    • Protocol Overview
      • Background
      • Protocol Actors
      • Smart Contract Architecture
      • Glossary
      • Smart Contract Addresses
      • Fees
      • Composability
      • Proxies and Upgradeability
    • Security
      • Security
      • List of Assumptions
      • External Entry Points
      • Emergency Protocol Pause
      • Protocol Invariants
      • Test Report
    • Loans
      • Loans
      • Fixed Term Loans
      • Open Term Loans
      • Refinancing
      • Impairments
      • Defaults
    • Pools
      • Pools
      • Pool Creation
      • PoolManager
      • PoolDelegateCover
      • Accounting
        • Pool Accounting
        • Pool Exchange Rates
    • Strategies
      • Fixed Term Loan Manager
        • Overview
        • Claims
        • Advance Payment Accounting
        • Accounting Examples
      • Open Term Loan Manager
      • DeFi Strategies
    • Withdrawal Managers
      • WithdrawalManager (Cyclical)
      • WithdrawalManager (Queue)
    • Singletons
      • Globals
      • MapleTreasury
      • Oracles
      • Pool Permission Manager
    • Admin Functions
      • Governor Admin Actions
        • Operational Admin Actions
      • Pool Delegate Admin Actions
      • Timelocks
    • Operations
      • Protocol Deployment
      • Open Term Loan Deployment
      • December 2023 Deployment & Upgrade Procedure
      • Strategies Release Deployment Procedure
    • Interfaces
      • FixedTermLoan
      • FixedTermLoanFactory
      • FixedTermLoanFeeManager
      • FixedTermLoanInitializer
      • FixedTermLoanManager
      • FixedTermLoanManagerFactory
      • FixedTermLoanManagerInitializer
      • FixedTermLoanRefinancer
      • Globals
      • Liquidator
      • LiquidatorFactory
      • LiquidatorInitializer
      • OpenTermLoan
      • OpenTermLoanFactory
      • OpenTermLoanInitializer
      • OpenTermLoanManager
      • OpenTermLoanManagerFactory
      • OpenTermLoanManagerInitializer
      • OpenTermLoanRefinancer
      • Pool
      • PoolDelegateCover
      • PoolDeployer
      • PoolManager
      • PoolManagerFactory
      • PoolManagerInitializer
      • PoolPermissionManager
      • WithdrawalManager (Cyclical)
      • WithdrawalManagerFactory (Cyclical)
      • WithdrawalManagerInitializer (Cyclical)
      • WithdrawalManager (Queue)
      • WithdrawalManagerFactory (Queue)
      • WithdrawalManagerInitializer (Queue)
    • SYRUP Token
      • Architectural Overview
      • Base ERC20 Structure
      • Upgradability
      • Modules
      • Time Locks
      • Recapitalization Module
      • Emergency Module
      • Deployment and Migration Procedure
    • GraphQL API
    • SDK
      • Introduction
      • Installation
      • Protocol Actors
      • Usage Guide
  • Troubleshooting & Support
    • Intercom
  • Maple 1.0
    • Access to deprecated Maple 1.0
  • Legal
    • Borrower MLA
    • KYC
    • Interface Terms of Use
    • Privacy Policy
    • syrupUSDC and syrupUSDT - Risks
    • syrupUSDC and syrupUSDT - Defaults and Impairments
    • syrupUSDC and syrupUSDT - Available Jurisdictions
    • Interface Terms of Use [syrupUSDC and syrupUSDT]
    • Interface Terms of Use [Syrup.fi/convert/ and Syrup.fi/stake/]
    • syrupUSDC and syrupUSDT- Privacy Policy
    • SyrupUSDC Rewards Prize Draw Terms & Conditions
Powered by GitBook
On this page
  • Functions
  • collateralAsset
  • collateralRemaining
  • factory
  • fundsAsset
  • getExpectedAmount
  • globals
  • governor
  • implementation
  • liquidatePortion
  • loanManager
  • migrate
  • poolDelegate
  • pullFunds
  • setCollateralRemaining
  • setImplementation
  • upgrade
  • Events
  • FundsPulled
  • PortionLiquidated
  • Upgraded
  1. Technical Resources
  2. Interfaces

Liquidator

\

Functions

collateralAsset

Returns the address of the collateral asset.

    function collateralAsset()
        view
        returns (
            address
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

address

address

\

collateralRemaining

Returns the amount of collateral yet to be liquidated.

    function collateralRemaining()
        view
        returns (
            uint256
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

uint256

uint256

\

factory

The address of the proxy factory.

    function factory()
        view
        returns (
            address factory_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

factory_

address

address

\

fundsAsset

Returns the address of the funding asset.

    function fundsAsset()
        view
        returns (
            address
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

address

address

\

getExpectedAmount

Returns the expected amount to be returned from a flash loan given a certain amount of `collateralAsset`.

    function getExpectedAmount(
        uint256 swapAmount_
    )
        view
        returns (
            uint256 expectedAmount_
        );

Parameters:

Index
Name
Type
Internal Type
Description

0

swapAmount_

uint256

uint256

Amount of `collateralAsset` to be flash-borrowed.

Return Values:

Index
Name
Type
Internal Type
Description

0

expectedAmount_

uint256

uint256

Amount of `fundsAsset` that must be returned in the same transaction.

\

globals

    function globals()
        view
        returns (
            address globals_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

globals_

address

address

\

governor

    function governor()
        view
        returns (
            address governor_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

governor_

address

address

\

implementation

The address of the implementation contract being proxied.

    function implementation()
        view
        returns (
            address implementation_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

implementation_

address

address

\

liquidatePortion

Flash loan function that: 1. Transfers a specified amount of `collateralAsset` to `msg.sender`. 2. Performs an arbitrary call to `msg.sender`, to trigger logic necessary to get `fundsAsset` (e.g., AMM swap). 3. Performs a `transferFrom`, taking the corresponding amount of `fundsAsset` from the user. If the required amount of `fundsAsset` is not returned in step 3, the entire transaction reverts.

    function liquidatePortion(
        uint256 collateralAmount_,
        uint256 maxReturnAmount_,
        bytes data_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

collateralAmount_

uint256

uint256

1

maxReturnAmount_

uint256

uint256

Max amount of `fundsAsset` that can be returned to the liquidator contract.

2

data_

bytes

bytes

ABI-encoded arguments to be used in the low-level call to perform step 2.

\

loanManager

Returns the address of the loan manager contract.

    function loanManager()
        view
        returns (
            address
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

address

address

\

migrate

Modifies the proxy's storage by delegate-calling a migrator contract with some arguments. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.

    function migrate(
        address migrator_,
        bytes arguments_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

migrator_

address

address

The address of a migrator contract.

1

arguments_

bytes

bytes

Some encoded arguments to use for the migration.

\

poolDelegate

    function poolDelegate()
        view
        returns (
            address poolDelegate_
        );

Return Values:

Index
Name
Type
Internal Type
Description

0

poolDelegate_

address

address

\

pullFunds

Pulls a specified amount of ERC-20 tokens from the contract. Can only be called by `owner`.

    function pullFunds(
        address token_,
        address destination_,
        uint256 amount_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

token_

address

address

The ERC-20 token contract address.

1

destination_

address

address

The destination of the transfer.

2

amount_

uint256

uint256

The amount to transfer.

\

setCollateralRemaining

Sets the initial amount of collateral to be liquidated.

    function setCollateralRemaining(
        uint256 collateralAmount_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

collateralAmount_

uint256

uint256

The amount of collateral to be liquidated.

\

setImplementation

Modifies the proxy's implementation address.

    function setImplementation(
        address implementation_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

implementation_

address

address

\

upgrade

Upgrades a contract implementation to a specific version. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.

    function upgrade(
        uint256 version_,
        bytes arguments_
    )
        nonpayable;

Parameters:

Index
Name
Type
Internal Type
Description

0

version_

uint256

uint256

1

arguments_

bytes

bytes

Some encoded arguments to use for the upgrade.

\

Events

FundsPulled

Funds were withdrawn from the liquidator.

    event FundsPulled(
        address token_,
        address destination_,
        uint256 amount_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

token_

address

address

Address of the token that was withdrawn.

1

destination_

address

address

Address of where tokens were sent.

2

amount_

uint256

uint256

Amount of tokens that were sent.

\

PortionLiquidated

Portion of collateral was liquidated.

    event PortionLiquidated(
        uint256 swapAmount_,
        uint256 returnedAmount_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

swapAmount_

uint256

uint256

Amount of collateralAsset that was liquidated.

1

returnedAmount_

uint256

uint256

Amount of fundsAsset that was returned.

\

Upgraded

The instance was upgraded.

    event Upgraded(
        uint256 toVersion_,
        bytes arguments_
    );

Parameters:

Index
Name
Type
Internal Type
Description

0

toVersion_

uint256

uint256

The new version of the loan.

1

arguments_

bytes

bytes

The upgrade arguments, if any.

\

PreviousGlobalsNextLiquidatorFactory

Last updated 6 months ago