All pages
Powered by GitBook
1 of 1

Loading...

PSM

Peg Stability Contract.

Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.

Solidity API

BASIS_POINTS_DIVISOR

The divisor used to convert fees to basis points.


MANTISSA_ONE

The mantissa value representing 1 (used for calculations).


ONE_DOLLAR

The value representing one dollar in the stable token.


VAI

VAI token contract.


STABLE_TOKEN_ADDRESS

The address of the stable token contract.


oracle

The address of ResilientOracle contract wrapped in its interface.


venusTreasury

The address of the Venus Treasury contract.


feeIn

The incoming stableCoin fee. (Fee for swapStableForVAI).


feeOut

The outgoing stableCoin fee. (Fee for swapVAIForStable).


vaiMintCap

The maximum amount of VAI that can be minted through this contract.


vaiMinted

The total amount of VAI minted through this contract.


isPaused

A flag indicating whether the contract is currently paused or not.


initialize

Initializes the contract via Proxy Contract with the required parameters.

Parameters

Name
Type
Description

swapVAIForStable

Swaps VAI for a stable token.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

swapStableForVAI

Swaps stable tokens for VAI with fees.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

pause

Pause the PSM contract.


resume

Resume the PSM contract.


setFeeIn

Set the fee percentage for incoming swaps.

Parameters

Name
Type
Description

setFeeOut

Set the fee percentage for outgoing swaps.

Parameters

Name
Type
Description

setVenusTreasury

Set the address of the Venus Treasury contract.

Parameters

Name
Type
Description

setOracle

Set the address of the ResilientOracle contract.

Parameters

Name
Type
Description

previewSwapVAIForStable

Calculates the amount of VAI that would be burnt from the user.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

previewSwapStableForVAI

Calculates the amount of VAI that would be sent to the receiver.

Parameters

Name
Type
Description

Return Values

Name
Type
Description

enum FeeDirection {
  IN,
  OUT
}

feeOut_

uint256

The percentage of fees to be applied to a VAI -> stablecoin swap.

vaiMintCap_

uint256

The cap for the total amount of VAI that can be minted.

accessControlManager_

address

The address of the AccessControlManager contract.

venusTreasury_

address

The address where fees will be sent.

oracleAddress_

address

The address of the ResilientOracle contract.

feeIn_

uint256

receiver

address

The address where the stablecoin will be sent.

stableTknAmount

uint256

The amount of stable tokens to receive.

[0]

uint256

The amount of VAI received and burnt from the sender.

receiver

address

The address that will receive the VAI tokens.

stableTknAmount

uint256

The amount of stable tokens to be swapped.

[0]

uint256

Amount of VAI minted to the sender.

feeIn_

uint256

The new fee percentage for incoming swaps.

feeOut_

uint256

The new fee percentage for outgoing swaps.

venusTreasury_

address

The new address of the Venus Treasury contract.

oracleAddress_

address

The new address of the ResilientOracle contract.

stableTknAmount

uint256

The amount of stable tokens to be received after the swap.

[0]

uint256

The amount of VAI that would be taken from the user.

stableTknAmount

uint256

The amount of stable tokens provided for the swap.

[0]

uint256

The amount of VAI that would be sent to the receiver.

The percentage of fees to be applied to a stablecoin -> VAI swap.

uint256 BASIS_POINTS_DIVISOR
uint256 MANTISSA_ONE
uint256 ONE_DOLLAR
contract IVAI VAI
address STABLE_TOKEN_ADDRESS
contract ResilientOracleInterface oracle
address venusTreasury
uint256 feeIn
uint256 feeOut
uint256 vaiMintCap
uint256 vaiMinted
bool isPaused
function initialize(address accessControlManager_, address venusTreasury_, address oracleAddress_, uint256 feeIn_, uint256 feeOut_, uint256 vaiMintCap_) external
function swapVAIForStable(address receiver, uint256 stableTknAmount) external returns (uint256)
function swapStableForVAI(address receiver, uint256 stableTknAmount) external returns (uint256)
function pause() external
function resume() external
function setFeeIn(uint256 feeIn_) external
function setFeeOut(uint256 feeOut_) external
function setVenusTreasury(address venusTreasury_) external
function setOracle(address oracleAddress_) external
function previewSwapVAIForStable(uint256 stableTknAmount) external view returns (uint256)
function previewSwapStableForVAI(uint256 stableTknAmount) external view returns (uint256)