shift
  • Introduction
  • Underlying factors for developing shift
  • Get started
    • How to choose the Vault
    • How to deposit
    • How to withdraw
    • How to shuffle between Vault versions
    • How to track the balance
    • How to review transactions history
    • Emergency situation
  • SHIFT Products
    • Vault
    • DeFi strategy
    • Vault for Financial Institutes
  • Risk Management
    • Overview
    • Risk Assessment and Management Policy
    • Risk Mitigation
  • Developer Resources
    • Ecosystem overview
    • Vault contract
      • Position status logic
    • DEFII
      • Logic contract
      • LocalDefii contract
      • RemoteDefiiPrincipal contract
      • RemoteDefiiAgent contract
      • Instructions
    • OperatorRegistry contract
    • Emergency situations
    • Deployment addresses
  • Vaults
    • USD - Risk Level 3
  • FAQ
    • General
    • Fee terms
    • Platform design
    • Emergency
    • Utility
    • Security
    • Communication
  • Resources
    • Discord
    • Medium
    • Twitter
    • Telegram
    • Github
Powered by GitBook
On this page
  • Read functions
  • Write function
  1. Developer Resources
  2. DEFII

Logic contract

Logic acts as the connection between DEFII and external protocols. It's a library where the logic for interacting with external protocols is implemented. When DEFII needs to interact with an external protocol, it uses delegatecall to invoke Logic functions.

Read functions

accountLiquidity

Shows the amount of liquidity locked in an external protocol.

function accountLiquidity(
        address account
    ) external view virtual returns (uint256);
Parameter
Type
Definition

account

address

Address for which to return the amount of liquidity.

Write function

enter

Implements the deposit logic into an external protocol. This can include leverage in a lending protocol, providing liquidity to liquidity pools, and so on. Expects that the smart contract already has a certain amount of input tokens

function enter() external payable;

exit

Implements the logic of exiting from the external protocol.

function exit(uint256 liquidity) external payable;
Parameter
Type
Definition

liquidity

uint256

The amount of liquidity to withdraw from the external protocol.

withdrawLiquidity

Function for withdrawing liquidity from the external protocol directly to the recipient.

function withdrawLiquidity(
        address recipient,
        uint256 amount
    ) external payable;
Parameter
Type
Definition

recipient

address

Recipient address

amount

uint256

Amount of tokens to withdraw.

emergencyExit

Function for exiting the protocol in emergency situations.

function emergencyExit() external payable;

claimRewards

Claims rewards to recipient.

function claimRewards(address recipient) external payable;
Parameter
Type
Definition

recipient

address

Recipient address

Last updated 1 year ago