SettingsManager

This is a contract for Vault Settings This is the contract for owner.

setFeeManager

Owner Function

This is an owner function for setting feeManager address.
settingsManager.
setFeeManager(address _feeManager)
Example Input
('0x70997970c51812dc3a010c7d01b50e0d17dc79c8')
Example Output

setVaultSettings

Owner Function

This is an owner function for setting cooldownduration and fee rewards basis points.
settingsManager.setVaultSettings(
uint256 _cooldownDuration,
uint256 _feeRewardsBasisPoints
)
Example Input
(
'0', // no cooldownduration
'70000' // 70%
)
Example Output
true

delegate

User Function

This is a function for adding delegates who can participate for StakeFor or DepositFor specific user.
settingsManager.delegate(address[] memory _delegates)
Example Input
[
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
]
Example Output

enableMarketOrder

Owner Function
This is a function for enable or disable market Order
settingsManager.enableMarketOrder(bool _enable)
Example Input
(
true // enable market order
)
Example Output

enableForexMarket

assetManagerWallet Function
This is a function for enable or disable forex trade at forex close time
settingsManager.enableForexMarket(bool _enable)
Example Input
(
true // pause forex trade
)
Example Output

setAssetManagerWallet

Owner Function
This is a function to set asset manager wallet
settingsManager.setAssetManagerWallet(address _wallet)
Example Input
(
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8' //
)
Example Output

setCloseDeltaTime

Owner Function
This is a function for setting closeDelta time
settingsManager.setCloseDeltaTime(uint256 _deltaTime)
Example Input
(
0 // users can close his position without waiting any closeDelaTime
)
Example Output

setCustomFeeForUser

Owner Function

This is an owner function for changing specific'user's fee. for special user, we can reduce user's site usage fee
settingsManager.setCustomFeeForUser(
address _account,
uint256 _feePoints,
bool _isEnabled
)
Example Input
(
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8', '100', true
)
Example Output

setDelayDeltaTime

Owner Function
This is an owner function for setting delay time to execute confirmDelayTransaction.
settingsManager.setDelayDeltaTime(uint256 _deltaTime)
Example Input
(
0, // no delay time, users can add position to existing position without any delay.
)
Example Output

setDepositFee

Owner Function
This is an owner function for setting deposit fee.
settingsManager.setDepositFee(uint256 _fee)
Example Input
(
0, // we dont charge any fee for deposit or withdraw.
)
Example Output

setEnableDeposit

Owner Function
This is an owner function for enable deposit or withdraw for token.
settingsManager.setEnableDeposit(
address _token,
bool _isEnabled
)
Example Input
(
'0x93F2394ceA60fa9E2E9AC215cd8ba04c30ed103b',
true // we allow users to deposit or withdraw only USDC
)
Example Output

setEnableStaking

Owner Function
This is an owner function for enable stake or unstake for token.
settingsManager.setEnableStaking(
address _token,
bool _isEnabled
)
Example Input
(
'0x93F2394ceA60fa9E2E9AC215cd8ba04c30ed103b',
true // we allow users to stake or unstake only USDC for VLP
)
Example Output

setFundingInterval

Owner Function
This is an owner function to set funding interval for fundingFee
settingsManager.setFundingInterval(uint256 _fundingInterval)
Example Input
(
60 * 60 * 2 // set funding interval as 2 hrs
)
Example Output

setFundingRateFactor

Owner Function
This is an owner function to set funding rate factor based on asset and side.
settingsManager.setFundingRateFactor(
address _token,
bool _isLong,
uint256 _fundingRateFactor
)
Example Input
(
'0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec', true, 100 // set BTC Long funding rate
)
Example Output

setLiquidateThreshold

Owner Function
This is an owner function to set liquidateThrehold
settingsManager.setLiquidateThreshold(
uint256 _newThreshold,
address _token
)
Example Input
(
9900, '0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec', // set 99% for liquidateThreshold
)
Example Output

setLiquidationFeeUsd

Owner Function
This is an owner function to set liquidationFee
settingsManager.setLiquidationFeeUsd(uint256 _liquidationFeeUsd)
Example Input
(
0, // we dont charge any fee for liquidation
)
Example Output

setMaxBorrowAmountPerAsset

Owner Function
This is an owner function to set max borrow amount per asset
settingsManager.setMaxBorrowAmountPerAsset(
address _token,
uint256 _maxAmount
)
Example Input
(
'0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec', '10000000000000000000000000000000000'// set 10000 for BTC
)
Example Output

setMaxBorrowAmountPerSide

Owner Function
This is an owner function to set max borrow amount per side
settingsManager.setMaxBorrowAmountPerSide(
bool _isLong,
uint256 _maxAmount
)
Example Input
(
true, '10000000000000000000000000000000000'// set 10000 for LONG
)
Example Output

setMaxBorrowAmountPerUser

Owner Function
This is an owner function to set max borrow amount per user
settingsManager.setMaxBorrowAmountPerUser(uint256 _maxAmount)
Example Input
(
'10000000000000000000000000000000000'// set 10000 for each user
)
Example Output

setPositionManager

Owner Function
This is an owner function to set position manager address
settingsManager.setPositionManager(
address _manager,
bool _isManager
)
Example Input
(
'0x93F2394ceA60fa9E2E9AC215cd8ba04c30ed103b', true //
)
Example Output

setReferEnabled

Owner Function
This is an owner function to enable or disable refer feature
settingsManager.setReferEnabled(bool _referEnabled)
Example Input
(
true
)
Example Output

setReferFee

Owner Function
This is an owner function to set refer fee
settingsManager.setReferFee(uint256 _fee)
Example Input
(
'10000000000000000000000000000000' // set 10 usd for refer
)
Example Output

setStakingFee

Owner Function
This is an owner function for setting staking fee.
settingsManager.setStakingFee(uint256 _fee)
Example Input
(
0, // we dont charge any fee for stake or unstake.
)
Example Output

setBountyPercent

Owner Function
This is an owner function to set bountyPercent for transfer Bounty.
settingsManager.setBountyPercent(uint256 _bountyPercent)
Example Input
(
20000, // we transfer 20% fee for bounty.
)
Example Output

validatePosition

Function
This is a function to check max leverage exceed status or max borrow amount exceed status for position if it exceeds the max leverage or max borrow amount, then it will revert
vaultUtils.validatePosition(
address _account,
address _indexToken,
bool _isLong,
uint256 _size,
uint256 _collateral
)
Example Input
('0x93F2394ceA60fa9E2E9AC215cd8ba04c30ed103b', '0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec', true, '100', '10')
Example Output

checkDelegation

Function
This is a function to check delegate's allow status for stakeFor or depositFor
vaultUtils.checkDelegation(
address _master,
address _delegate
)
Example Input
('0x93F2394ceA60fa9E2E9AC215cd8ba04c30ed103b', '0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec')
Example Output
true

getFundingFee

Function
This is a function to get funding fee
vaultUtils.getFundingFee(
address _indexToken,
bool _isLong,
uint256 _size,
uint256 _entryFundingRate
)
Example Input
('0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec', true, '100', '256')
Example Output
1800000000000000000000000000// 0.00018 usd

getPositionFee

Function
This is a function to get position fee
vaultUtils.getPositionFee(
address _indexToken,
bool _isLong,
uint256 _sizeDelta
)
Example Input
('0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec', true, '100')
Example Output
1800000000000000000000000000// 0.00018 usd

getDelegates

Function
This is a function to get all delegates for stakeFor and depositFor
vaultUtils.getDelegates(
address _master
)
Example Input
('0xa36F5ea837A1925252eB5dc5A3605C9C3ba840ec')
Example Output
['0x93F2394ceA60fa9E2E9AC215cd8ba04c30ed103b']