Peg Stability Contract.
Contract for swapping stable token for VAI token and vice versa to maintain the peg stability between them.
enum FeeDirection {
IN,
OUT
}
BASIS_POINTS_DIVISOR
The divisor used to convert fees to basis points.
uint256 BASIS_POINTS_DIVISOR
The mantissa value representing 1 (used for calculations).
The value representing one dollar in the stable token.
VAI token contract.
STABLE_TOKEN_ADDRESS
The address of the stable token contract.
The address of ResilientOracle contract wrapped in its interface.
The address of the Venus Treasury contract.
The incoming stableCoin fee. (Fee for swapStableForVAI).
The outgoing stableCoin fee. (Fee for swapVAIForStable).
The maximum amount of VAI that can be minted through this contract.
The total amount of VAI minted through this contract.
A flag indicating whether the contract is currently paused or not.
Initializes the contract via Proxy Contract with the required parameters.
Parameters
The address of the AccessControlManager contract.
The address where fees will be sent.
The address of the ResilientOracle contract.
The percentage of fees to be applied to a stablecoin -> VAI swap.
The percentage of fees to be applied to a VAI -> stablecoin swap.
The cap for the total amount of VAI that can be minted.
swapVAIForStable
Swaps VAI for a stable token.
Parameters
The address where the stablecoin will be sent.
The amount of stable tokens to receive.
Return Values
The amount of VAI received and burnt from the sender.
swapStableForVAI
Swaps stable tokens for VAI with fees.
Parameters
The address that will receive the VAI tokens.
The amount of stable tokens to be swapped.
Return Values
Amount of VAI minted to the sender.
Pause the PSM contract.
Resume the PSM contract.
Set the fee percentage for incoming swaps.
Parameters
The new fee percentage for incoming swaps.
Set the fee percentage for outgoing swaps.
Parameters
The new fee percentage for outgoing swaps.
setVenusTreasury
Set the address of the Venus Treasury contract.
Parameters
The new address of the Venus Treasury contract.
Set the address of the ResilientOracle contract.
Parameters
The new address of the ResilientOracle contract.
previewSwapVAIForStable
Calculates the amount of VAI that would be burnt from the user.
Parameters
The amount of stable tokens to be received after the swap.
Return Values
The amount of VAI that would be taken from the user.
previewSwapStableForVAI
Calculates the amount of VAI that would be sent to the receiver.
Parameters
The amount of stable tokens provided for the swap.
Return Values
The amount of VAI that would be sent to the receiver.