Evoq Finance
  • introduction
    • Evoq Finance: A P2P-Based Lending Optimizer
  • background
    • Problem: Capital Inefficiency
  • protocol overview
    • How it works
      • Fallback Mechanism
      • Interest Rate Model
      • Cap Mechanism
    • Liquidation
    • Price Oracle
    • Risk Fund
  • advanced mechanism
    • Matching Engine
      • Priority Queue Matching
      • Max Gas Limit
    • Delta Mechanism
  • security
    • General Risks
      • Flash Loan Attack
      • Front-Running Attack
    • Audits
  • Technical
    • Overview
      • Evoq
      • WBNBGateway
      • Lens
      • Contract Deployments
    • Liquidation Bot
  • GETTING STARTED
    • User Guide
    • FAQ
  • Links
    • Launch App
    • Community
Powered by GitBook
On this page
  1. Technical
  2. Overview

Evoq

PreviousOverviewNextWBNBGateway

Last updated 5 months ago

Entrypoint of the Evoq Protocol built on top of Venus Protocol.

Functions

supply

function supply(
    address _poolToken,
    uint256 _amount
) external;

Creates a supply position for the sender. msg.sender must have approved Evoq's contract to spend the underlying _amount.

Parameters:

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_amount

uint256

The amount of token (in underlying) to supply.

supply on behalf

function supply(
    address _poolToken,
    address _onBehalf,
    uint256 _amount
) external;

Creates a supply position for a given user, spending sender tokens. msg.sender must have approved Evoq's contract to spend the underlying _amount.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_onBehalf

address

The address of the account whose positions will be updated.

_amount

uint256

The amount of token (in underlying) to supply.

function supply(
    address _poolToken,
    address _onBehalf,
    uint256 _amount,
    uint256 _maxGasForMatching
) external;

Creates a supply position for a given user, spending sender tokens, and controlling the gas consumed for matching. msg.sender must have approved Evoq's contract to spend the underlying _amount.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_onBehalf

address

The address of the account whose positions will be updated.

_amount

uint256

The amount of token (in underlying) to supply.

_maxGasForMatching

uint256

The gas threshold at which to stop the matching engine.

function borrow(
    address _poolToken,
    uint256 _amount
) external;

Borrows underlying tokens from a specific market.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_amount

uint256

The amount of token (in underlying) to borrow.

function borrow(
    address _poolToken,
    uint256 _amount,
    address _borrower,
    address _receiver
) external;

Borrows underlying tokens from a specific market and set borrwer and receiver.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_amount

uint256

The amount of token (in underlying) to borrow.

_borrower

address

The address of the borrower in debt.

_receiver

address

The address of the receiver of the borrowed asset.

function borrow(
    address _poolToken,
    uint256 _amount,
    address _borrower,
    address _receiver,
    uint256 _maxGasForMatching
) external;

Borrows underlying tokens from a specific market, by controlling the gas consumed for matching.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_amount

uint256

The amount of token (in underlying) to borrow.

_borrower

address

The address of the borrower in debt.

_receiver

address

The address of the receiver of the borrowed asset.

_maxGasForMatching

uint256

The gas threshold at which to stop the matching engine.

function withdraw(
    address _poolToken,
    uint256 _amount
) external;

Withdraws underlying tokens from a specific market.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_amount

uint256

The amount of token (in underlying) to withdraw.

function withdraw(
    address _poolToken,
    uint256 _amount,
    address _supplier,
    address _receiver
) external;

Withdraws underlying tokens from a specific market to a given user.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_amount

uint256

The amount of token (in underlying) to withdraw.

_supplier

address

The address that supplied the tokens.

_receiver

address

The address to send withdrawn tokens to.

function repay(
    address _poolToken,
    uint256 _amount
) external;

Repays underlying tokens from a specific market.

msg.sender must have approved Evoq's contract to spend the underlying _amount.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_amount

uint256

The amount of token (in underlying) to repay from borrow.

function repay(
    address _poolToken,
    address _onBehalf,
    uint256 _amount
) external;

Repays underlying tokens from a specific market to a given user.

Name
Type
Description

_poolToken

address

The address of the market the user wants to interact with.

_onBehalf

address

The address of the account whose positions will be updated.

_amount

uint256

The amount of token (in underlying) to repay from borrow.

function liquidate(
    address _poolTokenBorrowed,
    address _poolTokenCollateral,
    address _borrower,
    uint256 _amount
) external;

Liquidates a position.

Name
Type
Description

_poolTokenBorrowed

address

The address of the pool token the liquidator wants to repay.

_poolTokenCollateral

address

The address of the collateral pool token the liquidator wants to seize.

_borrower

address

The address of the borrower to liquidate.

_amount

uint256

The amount of token (in underlying) to repay.

function claimRewards(address[] calldata _vTokenAddresses, bool)
        external
        returns (uint256 amountOfRewards);

Claims rewards from the underlying pool.

This function is specific to Evoq.

Name
Type
Description

_vTokenAddresses

address[]

The addresses of the vTokens to claim rewards from.

Name
Type
Description

amountOfRewards

uint256

The amount of rewards claimed (in XVS for Venus).

Parameters:

supply on behalf with matching management

Parameters:

borrow

Parameters:

borrow with borrower and receiver

Parameters:

borrow with matching management

Parameters:

withdraw

Parameters:

withdraw to a specific user

Parameters:

repay

Parameters:

repay on behalf

Parameters:

liquidate

Parameters:

claimRewards

Parameters:

Return values:

GitHub Code
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​