PSM

Peg Stability Contract.

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

Solidity API

enum FeeDirection {
  IN,
  OUT
}

BASIS_POINTS_DIVISOR

The divisor used to convert fees to basis points.

uint256 BASIS_POINTS_DIVISOR

MANTISSA_ONE

The mantissa value representing 1 (used for calculations).

uint256 MANTISSA_ONE

ONE_DOLLAR

The value representing one dollar in the stable token.

uint256 ONE_DOLLAR

VAI

VAI token contract.

contract IVAI VAI

STABLE_TOKEN_ADDRESS

The address of the stable token contract.

address STABLE_TOKEN_ADDRESS

oracle

The address of ResilientOracle contract wrapped in its interface.

contract ResilientOracleInterface oracle

venusTreasury

The address of the Venus Treasury contract.

address venusTreasury

feeIn

The incoming stableCoin fee. (Fee for swapStableForVAI).

uint256 feeIn

feeOut

The outgoing stableCoin fee. (Fee for swapVAIForStable).

uint256 feeOut

vaiMintCap

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

uint256 vaiMintCap

vaiMinted

The total amount of VAI minted through this contract.

uint256 vaiMinted

isPaused

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

bool isPaused

initialize

Initializes the contract via Proxy Contract with the required parameters.

function initialize(address accessControlManager_, address venusTreasury_, address oracleAddress_, uint256 feeIn_, uint256 feeOut_, uint256 vaiMintCap_) external

Parameters


swapVAIForStable

Swaps VAI for a stable token.

function swapVAIForStable(address receiver, uint256 stableTknAmount) external returns (uint256)

Parameters

Return Values


swapStableForVAI

Swaps stable tokens for VAI with fees.

function swapStableForVAI(address receiver, uint256 stableTknAmount) external returns (uint256)

Parameters

Return Values


pause

Pause the PSM contract.

function pause() external

resume

Resume the PSM contract.

function resume() external

setFeeIn

Set the fee percentage for incoming swaps.

function setFeeIn(uint256 feeIn_) external

Parameters


setFeeOut

Set the fee percentage for outgoing swaps.

function setFeeOut(uint256 feeOut_) external

Parameters


setVenusTreasury

Set the address of the Venus Treasury contract.

function setVenusTreasury(address venusTreasury_) external

Parameters


setOracle

Set the address of the ResilientOracle contract.

function setOracle(address oracleAddress_) external

Parameters


previewSwapVAIForStable

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

function previewSwapVAIForStable(uint256 stableTknAmount) external view returns (uint256)

Parameters

Return Values


previewSwapStableForVAI

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

function previewSwapStableForVAI(uint256 stableTknAmount) external view returns (uint256)

Parameters

Return Values


Last updated