LogoLogo
  • Introduction
  • Parallel Protocol
    • PRL (Parallel Governance Token)
      • Issuance
      • Bridging Module
        • Specifications
        • Implementation
      • Tokenomics
        • Epoch Concept
        • Staking Mechanisms
        • ParaBoost
        • Fee Distribution
      • Governance
      • MIMO to PRL Migration
    • PAR (€ stablecoin)
      • How does PAR work?
      • Where can I get PAR ?
    • paUSD ($ stablecoin)
      • How does paUSD work?
      • Where can I get paUSD ?
    • Classic Vaults
      • Depositing
      • Borrowing
      • Fees
        • Fees Generation
      • Withdrawing
      • Repaying
      • Liquidating
    • Bridging Module
      • LayerZero Infrastructure
      • Specifications
      • Implementation
        • PAR
        • paUSD
    • Super Vaults (SV)
      • Leveraging
      • Rebalancing
      • EmptyVault
      • Automated Rebalance
      • Managed Rebalance
    • Inception Vaults (IV)
      • Borrowing
      • Liquidating
  • DAO & Governance
    • sPRL and Voting Power
    • Governance process
    • Proposal Framework
      • Parallel Integration Request (PIR)
      • Parallel Governance Proposal (PGP)
      • Parallel Improvement Protocol (PIP)
    • DAO Multisigs
      • DAO Multisigs Elections
        • Election 1
        • Election 2
        • Election 3
        • Election 4
        • Election 5
        • Election 6
      • Multisigs Transactions History
        • May 2022 Multisig History
        • June 2022 Multisig History
        • July 2022 Multisig History
        • August 2022 Multisig History
        • September 2022 Multisig History
        • October 2022 Multisig History
        • November 2022 Multisig History
        • December 2022 Multisig History
        • January 2023 Multisig History
        • February 2023 Multisig History
        • March 2023 Multisig History
        • April 2023 Multisig History
        • May 2023 Multisig History
        • June 2023 Multisig History
        • July 2023 Multisig History
        • August 2023 Multisig History
        • September 2023 Multisig History
        • October 2023 Multisig History
        • November 2023 Multisig History
        • December 2023 Multisig History
        • January 2024 Multisig History
        • February 2024 Multisig History
        • March 2024 Multisig History
        • April 2024 Multisig History
        • May 2024 Multisig History
    • Parallel Emergency Guardians
    • DAO Treasury
      • DAO Treasury Reports
  • Risk Assessments
    • Parallel's Risk framework
    • Methodology
    • Risk per Assets
      • PAR
        • Ethereum Assets
        • Polygon Assets
        • Fantom Assets
      • paUSD
        • Ethereum Assets
        • Polygon Assets
    • Risk parameters
      • PAR
        • Ethereum Risk parameters
        • Polygon Risk parameters
        • Fantom Risk parameters
      • paUSD
        • Ethereum Risk parameters
        • Polygon Risk parameters
    • Insurance Fund
  • Developers
    • Developer Guide
    • Parallel Governance Token (PRL)
    • Tokenomics
      • Key Operations Flows
      • Contracts
    • Classic Vaults
      • Architecture
      • VaultsCore
      • Opening a vault
      • Borrowing and minting PAR/paUSD
    • Bridging Module
      • Architecture
      • Sample Use Cases
    • Super Vault (SV)
      • Proxy Design
        • MIMOProxy
        • MIMOProxyGuard
        • MIMOProxyFactory
      • Action Contracts
        • MIMOEmptyVault
        • MIMOLeverage
        • MIMORebalance
        • MIMOAutoRebalance
        • MIMOManagedRebalance
        • MIMOProxyActions
        • MIMOVaultActions
      • Leverage Max Amount Derivation
    • Inception Vault (IV)
      • IV Architecture
      • InceptionVaultFactory
      • AdminInceptionVault
      • InceptionVaultCore
      • InceptionVaultsDataProvider
      • InceptionVaultPriceFeed
    • Contract Addresses
      • Parallel V3
        • Core Protocol
        • Parallel Governance Token
      • Parallel V2
        • PAR
          • Ethereum
          • Polygon PoS
          • Fantom
        • paUSD
          • Ethereum
          • Polygon PoS
      • Super Vaults (SV)
        • PAR
          • Ethereum
          • Polygon PoS
        • paUSD
          • Ethereum
          • Polygon PoS
      • Inception Vaults (IV)
        • Kovan
  • Resources
    • User Guides
      • Setting up
      • Managing Transactions on EVM blockchains
      • Troubleshooting
      • Mint PAR
      • Liquidity Providing
        • Provide PAR-USDC liquidity on Uniswap V3 (Ethereum)
        • Provide PAR-jEUR liquidity on Balancer (Polygon PoS)
        • Impermanent loss
      • How to Migrate to PRL?
      • How to Bridge Parallel Tokens?
      • How to Stake PRL?
    • Security & Audits
    • Links
    • Glossary
    • Brand Kit
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Inception Vault (IV)

InceptionVaultCore

PreviousAdminInceptionVaultNextInceptionVaultsDataProvider

Last updated 1 year ago

Was this helpful?

The IncepionVaultsCore contract is the main interface for users to interact with the Inception Vault. It handles all the Inception Vault logic, which is the exact same logic used in the Parallel protocol but for a new ERC20 collateral. It also owns the global state (cumulative rate & last refresh) and perform all state updates.

The contract leverages the existing Parallel protocol architecture to perform checks and queries :

  • Price queries are done through the

  • Debt calculations are done through the

  • Health checks, liquidation bonus and discounts calculations are done through the

The contract also stores all ERC20 collaterals.

The Inception VaultConfig is the equivalent of the CollateralConfig in the ConfigProvider with the exception of the collateralType as there can only be one inceptionCollateral per inception vault.

This configuration is set by the inception vault owner at deployment.

Param Name
Type
Description

liquidationRatio

uint256

LTV ratio from which an inception vault is open for liquidation

minCollateralRatio

uint256

Minimum LTV ratio for a vault to be considered healthy

borrowRate

uint256

The interest rate paid over time by borrowers (e.g. 2%.)

originationFee

uint256

Fee applied when borrowing/opening a loan

liquidationBonus

uint256

Liquidation bonus earned by liquidators

liquidationFee

uint256

Fee charged to the borrower for getting his collateral liquidated

Write Methods

initialize(VaultConfig memory vaultConfig, IERC20 inceptionCollateral, IAddressProvider addressProvider, IAdminInceptionVault adminInceptionVault, IInceptionVaultsDataProvider inceptionVaultsDataProvider, IInceptionVaultPriceFeed inceptionPriceFeed)

Initializer function to set state variables upon cloning.

Requirements :

  • Can only be called once

  • Set liquidation fee must be greater or equal than WAD

Param Name
Type
Description

vaultConfig

struct

VaultConfig struct with all inception vault configuration parameters

inceptionCollateral

IERC20

The address of the ERC20 token that will be set as inceptionCollateral

addressProvider

IAddressProvider

AddressProvider address

adminInceptionVault

IAdminInceptionVault

AdminInceptionVault address

inceptionVaultsDataProvider

IInceptionVaultsDataProvider

InceptionVaultsDataProvider address

inceptionPriceFeed

IInceptionVaultPriceFeed

InceptionVaultPriceFeed address

deposit(uint256 _amount)

Deposits inception collateral ERC20 token into the vault of the owner as collateral. A new vault is created if no vault exists for the caller.

Param Name
Type
Description

_amount

uint256

The amount of tokens to be deposited in WEI

depositByVaultId(uint256 _vaultId, uint256 _amount)

Deposits inception collateral ERC20 token into the specified vault as collateral.

Param Name
Type
Description

_vaultId

uint256

The ID of the vault in which to deposit the inceptionCollateral

_amount

uint256

The amount of tokens to be deposited in WEI

depositAndBorrow(uint256 _depositAmount, uint256 _borrowAmount)

Deposit inceptionCollateral ERC20 token into the vault of the msg.sender as collateral and borrows the specified amount of tokens in WEI.

Requirements :

  • Can only be called by the vault owner

  • The AdminInceptionVault stableX balance must be greater or equal than the borrowed amount

  • The operation must not result in an unhealthy vault

Param Name
Type
Description

_depositAmount

uint256

The amount of inception collateral to be deposited in WEI

_borrowAmount

uint256

The amount of borrowed StableX tokens in WEI

borrow(uint256 _vaultId, uint256 _amount)

Borrows new PAR tokens from a vault.

Requirements :

  • Can only be called by the vault owner

  • The AdminInceptionVault stableX balance must be greater or equal than the borrowed amount

  • The operation must not result in an unhealthy vault

Param Name
Type
Description

_vaultId

uint256

The ID of the vault from which to borrow

_amount

uint256

The amount of borrowed inceptionCollateral tokens in WEI

function withdraw(uint256 _vaultId, uint256 _amount)

Withdraws inception collateral ERC20 token from a vault.

Requirements :

  • Can only be called by the vault owner

  • The operation must not result in an unhealthy vault

Param Name
Type
Description

_vaultId

uint256

The ID of the vault from which to withdraw the inception collateral

_amount

uint256

The amount of inceptionCollateral ERC20 tokens to be withdrawn in WEI

repay(uint256 _vaultId, uint256 _amount)

Repays an outstanding PAR balance to a vault and update the outstanding vault debt to the current time.

Param Name
Type
Description

_vaultId

The ID of the vault for which to repay the outstanding debt balance

_amount

The amount of PAR tokens in WEI to be repaid

repayAll(uint256 _vaultId)

Repay all debt of a vault.

Param Name
Type
Description

_vaultId

uint256

The ID of the vault for which to repay the debt

liquidate(uint256 _vaultId)

Liquidates a vault that is below the liquidation threshold by repaying its outstanding debt.

Requirements :

  • The vault must be unhealthy

Param Name
Type
Description

_vaultId

uint256

The ID of the vault to liquidate

liquidatePartial(uint256 _vaultId, uint256 _amount)

Liquidates a vault partially that is below the liquidation threshold by repaying part of its outstanding debt, update the outstanding vault debt to the current time and pay a liquidation bonus to the liquidator. A liquidation fee can also be applied to the borrower during the liquidation.

Requirements :

  • The vault must be unhealthy

Param Name
Type
Description

_vaultId

uint256

The ID of the vault to liquidate

_amount

uint256

The amount of debt + liquidation fee to repay

View Methods

getCumulativeRate()

Returns the current cumulativeRate

getLastRefresh()

Returns the timestamp of the last cumulativeRate refresh.

getVaultConfig()

Returns the inception vault configuration.

getA()

Returns the AddressProvider address.

getInceptionCollateral()

Returns the inception vault collateral.

getAdminInceptionVault()

Returns the AdminInceptionVault address.

getInceptionVaultsData()

Returns the InceptionVaultsDataProvider address.

getInceptionPriceFeed()

Returns the InceptionVaultPriceFeed address.

PriceFeed
RatesManager
LiquidationManager