View Source: contracts/interfaces/ISovryn.sol
↗ Extends: State, ProtocolSettingsEvents, LoanSettingsEvents, LoanOpeningsEvents, LoanMaintenanceEvents, LoanClosingsEvents, SwapsEvents, AffiliatesEvents, FeesEvents
struct LoanReturnData {
bytes32 loanId,
address loanToken,
address collateralToken,
uint256 principal,
uint256 collateral,
uint256 interestOwedPerDay,
uint256 interestDepositRemaining,
uint256 startRate,
uint256 startMargin,
uint256 maintenanceMargin,
uint256 currentMargin,
uint256 maxLoanTerm,
uint256 endTimestamp,
uint256 maxLiquidatable,
uint256 maxSeizable
}
struct LoanReturnDataV2 {
bytes32 loanId,
address loanToken,
address collateralToken,
address borrower,
uint256 principal,
uint256 collateral,
uint256 interestOwedPerDay,
uint256 interestDepositRemaining,
uint256 startRate,
uint256 startMargin,
uint256 maintenanceMargin,
uint256 currentMargin,
uint256 maxLoanTerm,
uint256 endTimestamp,
uint256 maxLiquidatable,
uint256 maxSeizable,
uint256 creationTimestamp
}
Events
event PayInterestTransfer(address indexed interestToken, address indexed lender, uint256 effectiveInterest);
- replaceContract(address target)
- setTargets(string[] sigsArr, address[] targetsArr)
- getTarget(string sig)
- setSovrynProtocolAddress(address newProtocolAddress)
- setSOVTokenAddress(address newSovTokenAddress)
- setLockedSOVAddress(address newSOVLockedAddress)
- setMinReferralsToPayoutAffiliates(uint256 newMinReferrals)
- setPriceFeedContract(address newContract)
- setSwapsImplContract(address newContract)
- setLoanPool(address[] pools, address[] assets)
- setSupportedTokens(address[] addrs, bool[] toggles)
- setLendingFeePercent(uint256 newValue)
- setTradingFeePercent(uint256 newValue)
- setBorrowingFeePercent(uint256 newValue)
- setSwapExternalFeePercent(uint256 newValue)
- setAffiliateFeePercent(uint256 newValue)
- setAffiliateTradingTokenFeePercent(uint256 newValue)
- setLiquidationIncentivePercent(uint256 newAmount)
- setMaxDisagreement(uint256 newAmount)
- setSourceBuffer(uint256 newAmount)
- setMaxSwapSize(uint256 newAmount)
- setFeesController(address newController)
- withdrawLendingFees(address token, address receiver, uint256 amount)
- withdrawTradingFees(address token, address receiver, uint256 amount)
- withdrawBorrowingFees(address token, address receiver, uint256 amount)
- withdrawProtocolToken(address receiver, uint256 amount)
- depositProtocolToken(uint256 amount)
- getLoanPoolsList(uint256 start, uint256 count)
- isLoanPool(address loanPool)
- setWrbtcToken(address wrbtcTokenAddress)
- setSovrynSwapContractRegistryAddress(address registryAddress)
- setProtocolTokenAddress(address _protocolTokenAddress)
- setRolloverBaseReward(uint256 transactionCost)
- setRebatePercent(uint256 rebatePercent)
- setSpecialRebates(address sourceToken, address destToken, uint256 specialRebatesPercent)
- getSpecialRebates(address sourceToken, address destToken)
- togglePaused(bool paused)
- isProtocolPaused()
- setupLoanParams(struct LoanParamsStruct.LoanParams[] loanParamsList)
- disableLoanParams(bytes32[] loanParamsIdList)
- getLoanParams(bytes32[] loanParamsIdList)
- getLoanParamsList(address owner, uint256 start, uint256 count)
- getTotalPrincipal(address lender, address loanToken)
- minInitialMargin(bytes32 loanParamsId)
- borrowOrTradeFromPool(bytes32 loanParamsId, bytes32 loanId, bool isTorqueLoan, uint256 initialMargin, struct MarginTradeStructHelpers.SentAddresses sentAddresses, struct MarginTradeStructHelpers.SentAmounts sentValues, bytes loanDataBytes)
- setDelegatedManager(bytes32 loanId, address delegated, bool toggle)
- getEstimatedMarginExposure(address loanToken, address collateralToken, uint256 loanTokenSent, uint256 collateralTokenSent, uint256 interestRate, uint256 newPrincipal)
- getRequiredCollateral(address loanToken, address collateralToken, uint256 newPrincipal, uint256 marginAmount, bool isTorqueLoan)
- getBorrowAmount(address loanToken, address collateralToken, uint256 collateralTokenAmount, uint256 marginAmount, bool isTorqueLoan)
- liquidate(bytes32 loanId, address receiver, uint256 closeAmount)
- rollover(bytes32 loanId, bytes loanDataBytes)
- closeWithDeposit(bytes32 loanId, address receiver, uint256 depositAmount)
- closeWithSwap(bytes32 loanId, address receiver, uint256 swapAmount, bool returnTokenIsCollateral, bytes loanDataBytes)
- depositCollateral(bytes32 loanId, uint256 depositAmount)
- withdrawCollateral(bytes32 loanId, address receiver, uint256 withdrawAmount)
- extendLoanByInterest(bytes32 loanId, address payer, uint256 depositAmount, bool useCollateral, bytes loanDataBytes)
- reduceLoanByInterest(bytes32 loanId, address receiver, uint256 withdrawAmount)
- withdrawAccruedInterest(address loanToken)
- getLenderInterestData(address lender, address loanToken)
- getLoanInterestData(bytes32 loanId)
- getUserLoans(address user, uint256 start, uint256 count, uint256 loanType, bool isLender, bool unsafeOnly)
- getUserLoansV2(address user, uint256 start, uint256 count, uint256 loanType, bool isLender, bool unsafeOnly)
- getLoan(bytes32 loanId)
- getLoanV2(bytes32 loanId)
- getActiveLoans(uint256 start, uint256 count, bool unsafeOnly)
- getActiveLoansV2(uint256 start, uint256 count, bool unsafeOnly)
- setLegacyOracles(address[] refs, address[] oracles)
- getLegacyOracle(address ref)
- swapExternal(address sourceToken, address destToken, address receiver, address returnToSender, uint256 sourceTokenAmount, uint256 requiredDestTokenAmount, uint256 minReturn, bytes swapData)
- getSwapExpectedReturn(address sourceToken, address destToken, uint256 sourceTokenAmount)
- checkPriceDivergence(address sourceToken, address destToken, uint256 sourceTokenAmount, uint256 minReturn)
- getUserNotFirstTradeFlag(address user)
- setUserNotFirstTradeFlag(address user)
- payTradingFeeToAffiliatesReferrer(address referrer, address trader, address token, uint256 tradingFeeTokenBaseAmount)
- setAffiliatesReferrer(address user, address referrer)
- getReferralsList(address referrer)
- getAffiliatesReferrerBalances(address referrer)
- getAffiliatesReferrerTokensList(address referrer)
- getAffiliatesReferrerTokenBalance(address referrer, address token)
- withdrawAffiliatesReferrerTokenFees(address token, address receiver, uint256 amount)
- withdrawAllAffiliatesReferrerTokenFees(address receiver)
- getProtocolAddress()
- getSovTokenAddress()
- getLockedSOVAddress()
- getFeeRebatePercent()
- getMinReferralsToPayout()
- getAffiliatesUserReferrer(address user)
- getAffiliateRewardsHeld(address referrer)
- getAffiliateTradingTokenFeePercent()
- getAffiliatesTokenRewardsValueInRbtc(address referrer)
- getSwapExternalFeePercent()
- setTradingRebateRewardsBasisPoint(uint256 newBasisPoint)
- getTradingRebateRewardsBasisPoint()
- getDedicatedSOVRebate()
- setRolloverFlexFeePercent(uint256 newRolloverFlexFeePercent)
- getDefaultPathConversion(address sourceTokenAddress, address destTokenAddress)
- setDefaultPathConversion(IERC20[] defaultPath)
- removeDefaultPathConversion(address sourceTokenAddress, address destTokenAddress)
- checkCloseWithDepositIsTinyPosition(bytes32 loanId, uint256 depositAmount)
function replaceContract(address target) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
target | address |
Source Code
function replaceContract(address target) external;
function setTargets(string[] sigsArr, address[] targetsArr) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
sigsArr | string[] | |
targetsArr | address[] |
Source Code
function setTargets(string[] calldata sigsArr, address[] calldata targetsArr) external;
function getTarget(string sig) external view
returns(address)
Arguments
Name | Type | Description |
---|---|---|
sig | string |
Source Code
function getTarget(string calldata sig) external view returns (address);
function setSovrynProtocolAddress(address newProtocolAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newProtocolAddress | address |
Source Code
function setSovrynProtocolAddress(address newProtocolAddress) external;
function setSOVTokenAddress(address newSovTokenAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newSovTokenAddress | address |
Source Code
function setSOVTokenAddress(address newSovTokenAddress) external;
function setLockedSOVAddress(address newSOVLockedAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newSOVLockedAddress | address |
Source Code
function setLockedSOVAddress(address newSOVLockedAddress) external;
function setMinReferralsToPayoutAffiliates(uint256 newMinReferrals) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newMinReferrals | uint256 |
Source Code
function setMinReferralsToPayoutAffiliates(uint256 newMinReferrals) external;
function setPriceFeedContract(address newContract) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newContract | address |
Source Code
function setPriceFeedContract(address newContract) external;
function setSwapsImplContract(address newContract) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newContract | address |
Source Code
function setSwapsImplContract(address newContract) external;
function setLoanPool(address[] pools, address[] assets) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
pools | address[] | |
assets | address[] |
Source Code
function setLoanPool(address[] calldata pools, address[] calldata assets) external;
function setSupportedTokens(address[] addrs, bool[] toggles) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
addrs | address[] | |
toggles | bool[] |
Source Code
function setSupportedTokens(address[] calldata addrs, bool[] calldata toggles) external;
function setLendingFeePercent(uint256 newValue) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newValue | uint256 |
Source Code
function setLendingFeePercent(uint256 newValue) external;
function setTradingFeePercent(uint256 newValue) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newValue | uint256 |
Source Code
function setTradingFeePercent(uint256 newValue) external;
function setBorrowingFeePercent(uint256 newValue) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newValue | uint256 |
Source Code
function setBorrowingFeePercent(uint256 newValue) external;
function setSwapExternalFeePercent(uint256 newValue) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newValue | uint256 |
Source Code
function setSwapExternalFeePercent(uint256 newValue) external;
function setAffiliateFeePercent(uint256 newValue) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newValue | uint256 |
Source Code
function setAffiliateFeePercent(uint256 newValue) external;
function setAffiliateTradingTokenFeePercent(uint256 newValue) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newValue | uint256 |
Source Code
function setAffiliateTradingTokenFeePercent(uint256 newValue) external;
function setLiquidationIncentivePercent(uint256 newAmount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newAmount | uint256 |
Source Code
function setLiquidationIncentivePercent(uint256 newAmount) external;
function setMaxDisagreement(uint256 newAmount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newAmount | uint256 |
Source Code
function setMaxDisagreement(uint256 newAmount) external;
function setSourceBuffer(uint256 newAmount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newAmount | uint256 |
Source Code
function setSourceBuffer(uint256 newAmount) external;
function setMaxSwapSize(uint256 newAmount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newAmount | uint256 |
Source Code
function setMaxSwapSize(uint256 newAmount) external;
function setFeesController(address newController) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newController | address |
Source Code
function setFeesController(address newController) external;
function withdrawLendingFees(address token, address receiver, uint256 amount) external nonpayable
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
token | address | |
receiver | address | |
amount | uint256 |
Source Code
function withdrawLendingFees(
address token,
address receiver,
uint256 amount
) external returns (bool);
function withdrawTradingFees(address token, address receiver, uint256 amount) external nonpayable
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
token | address | |
receiver | address | |
amount | uint256 |
Source Code
function withdrawTradingFees(
address token,
address receiver,
uint256 amount
) external returns (bool);
function withdrawBorrowingFees(address token, address receiver, uint256 amount) external nonpayable
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
token | address | |
receiver | address | |
amount | uint256 |
Source Code
function withdrawBorrowingFees(
address token,
address receiver,
uint256 amount
) external returns (bool);
function withdrawProtocolToken(address receiver, uint256 amount) external nonpayable
returns(address, bool)
Arguments
Name | Type | Description |
---|---|---|
receiver | address | |
amount | uint256 |
Source Code
function withdrawProtocolToken(address receiver, uint256 amount)
external
returns (address, bool);
function depositProtocolToken(uint256 amount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
amount | uint256 |
Source Code
function depositProtocolToken(uint256 amount) external;
function getLoanPoolsList(uint256 start, uint256 count) external view
returns(bytes32[])
Arguments
Name | Type | Description |
---|---|---|
start | uint256 | |
count | uint256 |
Source Code
function getLoanPoolsList(uint256 start, uint256 count)
external
view
returns (bytes32[] memory);
function isLoanPool(address loanPool) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
loanPool | address |
Source Code
function isLoanPool(address loanPool) external view returns (bool);
function setWrbtcToken(address wrbtcTokenAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
wrbtcTokenAddress | address |
Source Code
function setWrbtcToken(address wrbtcTokenAddress) external;
function setSovrynSwapContractRegistryAddress(address registryAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
registryAddress | address |
Source Code
function setSovrynSwapContractRegistryAddress(address registryAddress) external;
function setProtocolTokenAddress(address _protocolTokenAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
_protocolTokenAddress | address |
Source Code
function setProtocolTokenAddress(address _protocolTokenAddress) external;
function setRolloverBaseReward(uint256 transactionCost) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
transactionCost | uint256 |
Source Code
function setRolloverBaseReward(uint256 transactionCost) external;
function setRebatePercent(uint256 rebatePercent) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
rebatePercent | uint256 |
Source Code
function setRebatePercent(uint256 rebatePercent) external;
function setSpecialRebates(address sourceToken, address destToken, uint256 specialRebatesPercent) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
sourceToken | address | |
destToken | address | |
specialRebatesPercent | uint256 |
Source Code
function setSpecialRebates(
address sourceToken,
address destToken,
uint256 specialRebatesPercent
) external;
function getSpecialRebates(address sourceToken, address destToken) external view
returns(specialRebatesPercent uint256)
Arguments
Name | Type | Description |
---|---|---|
sourceToken | address | |
destToken | address |
Source Code
function getSpecialRebates(address sourceToken, address destToken)
external
view
returns (uint256 specialRebatesPercent);
function togglePaused(bool paused) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
paused | bool |
Source Code
function togglePaused(bool paused) external;
function isProtocolPaused() external view
returns(bool)
Source Code
function isProtocolPaused() external view returns (bool);
function setupLoanParams(struct LoanParamsStruct.LoanParams[] loanParamsList) external nonpayable
returns(loanParamsIdList bytes32[])
Arguments
Name | Type | Description |
---|---|---|
loanParamsList | struct LoanParamsStruct.LoanParams[] |
Source Code
function setupLoanParams(LoanParams[] calldata loanParamsList)
external
returns (bytes32[] memory loanParamsIdList);
function disableLoanParams(bytes32[] loanParamsIdList) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
loanParamsIdList | bytes32[] |
Source Code
function disableLoanParams(bytes32[] calldata loanParamsIdList) external;
function getLoanParams(bytes32[] loanParamsIdList) external view
returns(loanParamsList struct LoanParamsStruct.LoanParams[])
Arguments
Name | Type | Description |
---|---|---|
loanParamsIdList | bytes32[] |
Source Code
function getLoanParams(bytes32[] calldata loanParamsIdList)
external
view
returns (LoanParams[] memory loanParamsList);
function getLoanParamsList(address owner, uint256 start, uint256 count) external view
returns(loanParamsList bytes32[])
Arguments
Name | Type | Description |
---|---|---|
owner | address | |
start | uint256 | |
count | uint256 |
Source Code
function getLoanParamsList(
address owner,
uint256 start,
uint256 count
) external view returns (bytes32[] memory loanParamsList);
function getTotalPrincipal(address lender, address loanToken) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
lender | address | |
loanToken | address |
Source Code
function getTotalPrincipal(address lender, address loanToken) external view returns (uint256);
function minInitialMargin(bytes32 loanParamsId) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
loanParamsId | bytes32 |
Source Code
function minInitialMargin(bytes32 loanParamsId) external view returns (uint256);
function borrowOrTradeFromPool(bytes32 loanParamsId, bytes32 loanId, bool isTorqueLoan, uint256 initialMargin, struct MarginTradeStructHelpers.SentAddresses sentAddresses, struct MarginTradeStructHelpers.SentAmounts sentValues, bytes loanDataBytes) external payable
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
loanParamsId | bytes32 | |
loanId | bytes32 | |
isTorqueLoan | bool | |
initialMargin | uint256 | |
sentAddresses | struct MarginTradeStructHelpers.SentAddresses | |
sentValues | struct MarginTradeStructHelpers.SentAmounts | |
loanDataBytes | bytes |
Source Code
function borrowOrTradeFromPool(
bytes32 loanParamsId,
bytes32 loanId, // if 0, start a new loan
bool isTorqueLoan,
uint256 initialMargin,
MarginTradeStructHelpers.SentAddresses calldata sentAddresses,
// lender: must match loan if loanId provided
// borrower: must match loan if loanId provided
// receiver: receiver of funds (address(0) assumes borrower address)
// manager: delegated manager of loan unless address(0)
MarginTradeStructHelpers.SentAmounts calldata sentValues,
// newRate: new loan interest rate
// newPrincipal: new loan size (borrowAmount + any borrowed interest)
// torqueInterest: new amount of interest to escrow for Torque loan (determines initial loan length)
// loanTokenReceived: total loanToken deposit (amount not sent to borrower in the case of Torque loans)
// collateralTokenReceived: total collateralToken deposit
bytes calldata loanDataBytes
) external payable returns (uint256);
function setDelegatedManager(bytes32 loanId, address delegated, bool toggle) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
delegated | address | |
toggle | bool |
Source Code
function setDelegatedManager(
bytes32 loanId,
address delegated,
bool toggle
) external;
function getEstimatedMarginExposure(address loanToken, address collateralToken, uint256 loanTokenSent, uint256 collateralTokenSent, uint256 interestRate, uint256 newPrincipal) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
loanToken | address | |
collateralToken | address | |
loanTokenSent | uint256 | |
collateralTokenSent | uint256 | |
interestRate | uint256 | |
newPrincipal | uint256 |
Source Code
function getEstimatedMarginExposure(
address loanToken,
address collateralToken,
uint256 loanTokenSent,
uint256 collateralTokenSent,
uint256 interestRate,
uint256 newPrincipal
) external view returns (uint256);
function getRequiredCollateral(address loanToken, address collateralToken, uint256 newPrincipal, uint256 marginAmount, bool isTorqueLoan) external view
returns(collateralAmountRequired uint256)
Arguments
Name | Type | Description |
---|---|---|
loanToken | address | |
collateralToken | address | |
newPrincipal | uint256 | |
marginAmount | uint256 | |
isTorqueLoan | bool |
Source Code
function getRequiredCollateral(
address loanToken,
address collateralToken,
uint256 newPrincipal,
uint256 marginAmount,
bool isTorqueLoan
) external view returns (uint256 collateralAmountRequired);
function getBorrowAmount(address loanToken, address collateralToken, uint256 collateralTokenAmount, uint256 marginAmount, bool isTorqueLoan) external view
returns(borrowAmount uint256)
Arguments
Name | Type | Description |
---|---|---|
loanToken | address | |
collateralToken | address | |
collateralTokenAmount | uint256 | |
marginAmount | uint256 | |
isTorqueLoan | bool |
Source Code
function getBorrowAmount(
address loanToken,
address collateralToken,
uint256 collateralTokenAmount,
uint256 marginAmount,
bool isTorqueLoan
) external view returns (uint256 borrowAmount);
function liquidate(bytes32 loanId, address receiver, uint256 closeAmount) external payable
returns(loanCloseAmount uint256, seizedAmount uint256, seizedToken address)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
receiver | address | |
closeAmount | uint256 |
Source Code
function liquidate(
bytes32 loanId,
address receiver,
uint256 closeAmount // denominated in loanToken
)
external
payable
returns (
uint256 loanCloseAmount,
uint256 seizedAmount,
address seizedToken
);
function rollover(bytes32 loanId, bytes loanDataBytes) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
loanDataBytes | bytes |
Source Code
function rollover(bytes32 loanId, bytes calldata loanDataBytes) external;
function closeWithDeposit(bytes32 loanId, address receiver, uint256 depositAmount) external payable
returns(loanCloseAmount uint256, withdrawAmount uint256, withdrawToken address)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
receiver | address | |
depositAmount | uint256 |
Source Code
function closeWithDeposit(
bytes32 loanId,
address receiver,
uint256 depositAmount // denominated in loanToken
)
external
payable
returns (
uint256 loanCloseAmount,
uint256 withdrawAmount,
address withdrawToken
);
function closeWithSwap(bytes32 loanId, address receiver, uint256 swapAmount, bool returnTokenIsCollateral, bytes loanDataBytes) external nonpayable
returns(loanCloseAmount uint256, withdrawAmount uint256, withdrawToken address)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
receiver | address | |
swapAmount | uint256 | |
returnTokenIsCollateral | bool | |
loanDataBytes | bytes |
Source Code
function closeWithSwap(
bytes32 loanId,
address receiver,
uint256 swapAmount, // denominated in collateralToken
bool returnTokenIsCollateral, // true: withdraws collateralToken, false: withdraws loanToken
bytes calldata loanDataBytes
)
external
returns (
uint256 loanCloseAmount,
uint256 withdrawAmount,
address withdrawToken
);
function depositCollateral(bytes32 loanId, uint256 depositAmount) external payable
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
depositAmount | uint256 |
Source Code
function depositCollateral(
bytes32 loanId,
uint256 depositAmount // must match msg.value if ether is sent
) external payable;
function withdrawCollateral(bytes32 loanId, address receiver, uint256 withdrawAmount) external nonpayable
returns(actualWithdrawAmount uint256)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
receiver | address | |
withdrawAmount | uint256 |
Source Code
function withdrawCollateral(
bytes32 loanId,
address receiver,
uint256 withdrawAmount
) external returns (uint256 actualWithdrawAmount);
function extendLoanByInterest(bytes32 loanId, address payer, uint256 depositAmount, bool useCollateral, bytes loanDataBytes) external payable
returns(secondsExtended uint256)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
payer | address | |
depositAmount | uint256 | |
useCollateral | bool | |
loanDataBytes | bytes |
Source Code
function extendLoanByInterest(
bytes32 loanId,
address payer,
uint256 depositAmount,
bool useCollateral,
bytes calldata loanDataBytes
) external payable returns (uint256 secondsExtended);
function reduceLoanByInterest(bytes32 loanId, address receiver, uint256 withdrawAmount) external nonpayable
returns(secondsReduced uint256)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
receiver | address | |
withdrawAmount | uint256 |
Source Code
function reduceLoanByInterest(
bytes32 loanId,
address receiver,
uint256 withdrawAmount
) external returns (uint256 secondsReduced);
function withdrawAccruedInterest(address loanToken) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
loanToken | address |
Source Code
function withdrawAccruedInterest(address loanToken) external;
function getLenderInterestData(address lender, address loanToken) external view
returns(interestPaid uint256, interestPaidDate uint256, interestOwedPerDay uint256, interestUnPaid uint256, interestFeePercent uint256, principalTotal uint256)
Arguments
Name | Type | Description |
---|---|---|
lender | address | |
loanToken | address |
Source Code
function getLenderInterestData(address lender, address loanToken)
external
view
returns (
uint256 interestPaid,
uint256 interestPaidDate,
uint256 interestOwedPerDay,
uint256 interestUnPaid,
uint256 interestFeePercent,
uint256 principalTotal
);
function getLoanInterestData(bytes32 loanId) external view
returns(loanToken address, interestOwedPerDay uint256, interestDepositTotal uint256, interestDepositRemaining uint256)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 |
Source Code
function getLoanInterestData(bytes32 loanId)
external
view
returns (
address loanToken,
uint256 interestOwedPerDay,
uint256 interestDepositTotal,
uint256 interestDepositRemaining
);
function getUserLoans(address user, uint256 start, uint256 count, uint256 loanType, bool isLender, bool unsafeOnly) external view
returns(loansData struct ISovryn.LoanReturnData[])
Arguments
Name | Type | Description |
---|---|---|
user | address | |
start | uint256 | |
count | uint256 | |
loanType | uint256 | |
isLender | bool | |
unsafeOnly | bool |
Source Code
function getUserLoans(
address user,
uint256 start,
uint256 count,
uint256 loanType,
bool isLender,
bool unsafeOnly
) external view returns (LoanReturnData[] memory loansData);
function getUserLoansV2(address user, uint256 start, uint256 count, uint256 loanType, bool isLender, bool unsafeOnly) external view
returns(loansDataV2 struct ISovryn.LoanReturnDataV2[])
Arguments
Name | Type | Description |
---|---|---|
user | address | |
start | uint256 | |
count | uint256 | |
loanType | uint256 | |
isLender | bool | |
unsafeOnly | bool |
Source Code
function getUserLoansV2(
address user,
uint256 start,
uint256 count,
uint256 loanType,
bool isLender,
bool unsafeOnly
) external view returns (LoanReturnDataV2[] memory loansDataV2);
function getLoan(bytes32 loanId) external view
returns(loanData struct ISovryn.LoanReturnData)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 |
Source Code
function getLoan(bytes32 loanId) external view returns (LoanReturnData memory loanData);
function getLoanV2(bytes32 loanId) external view
returns(loanDataV2 struct ISovryn.LoanReturnDataV2)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 |
Source Code
function getLoanV2(bytes32 loanId) external view returns (LoanReturnDataV2 memory loanDataV2);
function getActiveLoans(uint256 start, uint256 count, bool unsafeOnly) external view
returns(loansData struct ISovryn.LoanReturnData[])
Arguments
Name | Type | Description |
---|---|---|
start | uint256 | |
count | uint256 | |
unsafeOnly | bool |
Source Code
function getActiveLoans(
uint256 start,
uint256 count,
bool unsafeOnly
) external view returns (LoanReturnData[] memory loansData);
function getActiveLoansV2(uint256 start, uint256 count, bool unsafeOnly) external view
returns(loansDataV2 struct ISovryn.LoanReturnDataV2[])
Arguments
Name | Type | Description |
---|---|---|
start | uint256 | |
count | uint256 | |
unsafeOnly | bool |
Source Code
function getActiveLoansV2(
uint256 start,
uint256 count,
bool unsafeOnly
) external view returns (LoanReturnDataV2[] memory loansDataV2);
function setLegacyOracles(address[] refs, address[] oracles) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
refs | address[] | |
oracles | address[] |
Source Code
function setLegacyOracles(address[] calldata refs, address[] calldata oracles) external;
function getLegacyOracle(address ref) external view
returns(address)
Arguments
Name | Type | Description |
---|---|---|
ref | address |
Source Code
function getLegacyOracle(address ref) external view returns (address);
function swapExternal(address sourceToken, address destToken, address receiver, address returnToSender, uint256 sourceTokenAmount, uint256 requiredDestTokenAmount, uint256 minReturn, bytes swapData) external nonpayable
returns(destTokenAmountReceived uint256, sourceTokenAmountUsed uint256)
Arguments
Name | Type | Description |
---|---|---|
sourceToken | address | |
destToken | address | |
receiver | address | |
returnToSender | address | |
sourceTokenAmount | uint256 | |
requiredDestTokenAmount | uint256 | |
minReturn | uint256 | |
swapData | bytes |
Source Code
function swapExternal(
address sourceToken,
address destToken,
address receiver,
address returnToSender,
uint256 sourceTokenAmount,
uint256 requiredDestTokenAmount,
uint256 minReturn,
bytes calldata swapData
) external returns (uint256 destTokenAmountReceived, uint256 sourceTokenAmountUsed);
function getSwapExpectedReturn(address sourceToken, address destToken, uint256 sourceTokenAmount) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
sourceToken | address | |
destToken | address | |
sourceTokenAmount | uint256 |
Source Code
function getSwapExpectedReturn(
address sourceToken,
address destToken,
uint256 sourceTokenAmount
) external view returns (uint256);
function checkPriceDivergence(address sourceToken, address destToken, uint256 sourceTokenAmount, uint256 minReturn) public view
Arguments
Name | Type | Description |
---|---|---|
sourceToken | address | |
destToken | address | |
sourceTokenAmount | uint256 | |
minReturn | uint256 |
Source Code
function checkPriceDivergence(
address sourceToken,
address destToken,
uint256 sourceTokenAmount,
uint256 minReturn
) public view;
function getUserNotFirstTradeFlag(address user) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
user | address |
Source Code
function getUserNotFirstTradeFlag(address user) external view returns (bool);
function setUserNotFirstTradeFlag(address user) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
user | address |
Source Code
function setUserNotFirstTradeFlag(address user) external view returns (bool);
function payTradingFeeToAffiliatesReferrer(address referrer, address trader, address token, uint256 tradingFeeTokenBaseAmount) external nonpayable
returns(affiliatesBonusSOVAmount uint256, affiliatesBonusTokenAmount uint256)
Arguments
Name | Type | Description |
---|---|---|
referrer | address | |
trader | address | |
token | address | |
tradingFeeTokenBaseAmount | uint256 |
Source Code
function payTradingFeeToAffiliatesReferrer(
address referrer,
address trader,
address token,
uint256 tradingFeeTokenBaseAmount
) external returns (uint256 affiliatesBonusSOVAmount, uint256 affiliatesBonusTokenAmount);
function setAffiliatesReferrer(address user, address referrer) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
user | address | |
referrer | address |
Source Code
function setAffiliatesReferrer(address user, address referrer) external;
function getReferralsList(address referrer) external view
returns(refList address[])
Arguments
Name | Type | Description |
---|---|---|
referrer | address |
Source Code
function getReferralsList(address referrer) external view returns (address[] memory refList);
function getAffiliatesReferrerBalances(address referrer) external view
returns(referrerTokensList address[], referrerTokensBalances uint256[])
Arguments
Name | Type | Description |
---|---|---|
referrer | address |
Source Code
function getAffiliatesReferrerBalances(address referrer)
external
view
returns (address[] memory referrerTokensList, uint256[] memory referrerTokensBalances);
function getAffiliatesReferrerTokensList(address referrer) external view
returns(tokensList address[])
Arguments
Name | Type | Description |
---|---|---|
referrer | address |
Source Code
function getAffiliatesReferrerTokensList(address referrer)
external
view
returns (address[] memory tokensList);
function getAffiliatesReferrerTokenBalance(address referrer, address token) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
referrer | address | |
token | address |
Source Code
function getAffiliatesReferrerTokenBalance(address referrer, address token)
external
view
returns (uint256);
function withdrawAffiliatesReferrerTokenFees(address token, address receiver, uint256 amount) external nonpayable
returns(withdrawAmount uint256)
Arguments
Name | Type | Description |
---|---|---|
token | address | |
receiver | address | |
amount | uint256 |
Source Code
function withdrawAffiliatesReferrerTokenFees(
address token,
address receiver,
uint256 amount
) external returns (uint256 withdrawAmount);
function withdrawAllAffiliatesReferrerTokenFees(address receiver) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
receiver | address |
Source Code
function withdrawAllAffiliatesReferrerTokenFees(address receiver) external;
function getProtocolAddress() external view
returns(address)
Source Code
function getProtocolAddress() external view returns (address);
function getSovTokenAddress() external view
returns(address)
Source Code
function getSovTokenAddress() external view returns (address);
function getLockedSOVAddress() external view
returns(address)
Source Code
function getLockedSOVAddress() external view returns (address);
function getFeeRebatePercent() external view
returns(uint256)
Source Code
function getFeeRebatePercent() external view returns (uint256);
function getMinReferralsToPayout() external view
returns(uint256)
Source Code
function getMinReferralsToPayout() external view returns (uint256);
function getAffiliatesUserReferrer(address user) external view
returns(referrer address)
Arguments
Name | Type | Description |
---|---|---|
user | address |
Source Code
function getAffiliatesUserReferrer(address user) external view returns (address referrer);
function getAffiliateRewardsHeld(address referrer) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
referrer | address |
Source Code
function getAffiliateRewardsHeld(address referrer) external view returns (uint256);
function getAffiliateTradingTokenFeePercent() external view
returns(affiliateTradingTokenFeePercent uint256)
Source Code
function getAffiliateTradingTokenFeePercent()
external
view
returns (uint256 affiliateTradingTokenFeePercent);
function getAffiliatesTokenRewardsValueInRbtc(address referrer) external view
returns(rbtcTotalAmount uint256)
Arguments
Name | Type | Description |
---|---|---|
referrer | address |
Source Code
function getAffiliatesTokenRewardsValueInRbtc(address referrer)
external
view
returns (uint256 rbtcTotalAmount);
function getSwapExternalFeePercent() external view
returns(swapExternalFeePercent uint256)
Source Code
function getSwapExternalFeePercent() external view returns (uint256 swapExternalFeePercent);
function setTradingRebateRewardsBasisPoint(uint256 newBasisPoint) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newBasisPoint | uint256 |
Source Code
function setTradingRebateRewardsBasisPoint(uint256 newBasisPoint) external;
function getTradingRebateRewardsBasisPoint() external view
returns(uint256)
Source Code
function getTradingRebateRewardsBasisPoint() external view returns (uint256);
function getDedicatedSOVRebate() external view
returns(uint256)
Source Code
function getDedicatedSOVRebate() external view returns (uint256);
function setRolloverFlexFeePercent(uint256 newRolloverFlexFeePercent) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
newRolloverFlexFeePercent | uint256 |
Source Code
function setRolloverFlexFeePercent(uint256 newRolloverFlexFeePercent) external;
function getDefaultPathConversion(address sourceTokenAddress, address destTokenAddress) external view
returns(contract IERC20[])
Arguments
Name | Type | Description |
---|---|---|
sourceTokenAddress | address | |
destTokenAddress | address |
Source Code
function getDefaultPathConversion(address sourceTokenAddress, address destTokenAddress)
external
view
returns (IERC20[] memory);
function setDefaultPathConversion(IERC20[] defaultPath) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
defaultPath | IERC20[] |
Source Code
function setDefaultPathConversion(IERC20[] calldata defaultPath) external;
function removeDefaultPathConversion(address sourceTokenAddress, address destTokenAddress) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
sourceTokenAddress | address | |
destTokenAddress | address |
Source Code
function removeDefaultPathConversion(address sourceTokenAddress, address destTokenAddress)
external;
function checkCloseWithDepositIsTinyPosition(bytes32 loanId, uint256 depositAmount) external view
returns(isTinyPosition bool, tinyPositionAmount uint256)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
depositAmount | uint256 |
Source Code
function checkCloseWithDepositIsTinyPosition(bytes32 loanId, uint256 depositAmount)
external
view
returns (bool isTinyPosition, uint256 tinyPositionAmount);
- Address
- Administered
- AdminRole
- AdvancedToken
- AdvancedTokenStorage
- Affiliates
- AffiliatesEvents
- ApprovalReceiver
- BProPriceFeed
- CheckpointsShared
- Constants
- Context
- DevelopmentFund
- DummyContract
- EnumerableAddressSet
- EnumerableBytes32Set
- EnumerableBytes4Set
- ERC20
- ERC20Detailed
- ErrorDecoder
- Escrow
- EscrowReward
- FeedsLike
- FeesEvents
- FeeSharingCollector
- FeeSharingCollectorProxy
- FeeSharingCollectorStorage
- FeesHelper
- FourYearVesting
- FourYearVestingFactory
- FourYearVestingLogic
- FourYearVestingStorage
- GenericTokenSender
- GovernorAlpha
- GovernorVault
- IApproveAndCall
- IChai
- IContractRegistry
- IConverterAMM
- IERC1820Registry
- IERC20_
- IERC20
- IERC777
- IERC777Recipient
- IERC777Sender
- IFeeSharingCollector
- IFourYearVesting
- IFourYearVestingFactory
- IFunctionsList
- ILiquidityMining
- ILiquidityPoolV1Converter
- ILoanPool
- ILoanToken
- ILoanTokenLogicBeacon
- ILoanTokenLogicModules
- ILoanTokenLogicProxy
- ILoanTokenModules
- ILoanTokenWRBTC
- ILockedSOV
- IMoCState
- IModulesProxyRegistry
- Initializable
- InterestUser
- IPot
- IPriceFeeds
- IPriceFeedsExt
- IProtocol
- IRSKOracle
- ISovryn
- ISovrynSwapNetwork
- IStaking
- ISwapsImpl
- ITeamVesting
- ITimelock
- IV1PoolOracle
- IVesting
- IVestingFactory
- IVestingRegistry
- IWrbtc
- IWrbtcERC20
- LenderInterestStruct
- LiquidationHelper
- LiquidityMining
- LiquidityMiningConfigToken
- LiquidityMiningProxy
- LiquidityMiningStorage
- LoanClosingsEvents
- LoanClosingsLiquidation
- LoanClosingsRollover
- LoanClosingsShared
- LoanClosingsWith
- LoanClosingsWithoutInvariantCheck
- LoanInterestStruct
- LoanMaintenance
- LoanMaintenanceEvents
- LoanOpenings
- LoanOpeningsEvents
- LoanParamsStruct
- LoanSettings
- LoanSettingsEvents
- LoanStruct
- LoanToken
- LoanTokenBase
- LoanTokenLogicBeacon
- LoanTokenLogicLM
- LoanTokenLogicProxy
- LoanTokenLogicStandard
- LoanTokenLogicStorage
- LoanTokenLogicWrbtc
- LoanTokenSettingsLowerAdmin
- LockedSOV
- MarginTradeStructHelpers
- Medianizer
- ModuleCommonFunctionalities
- ModulesCommonEvents
- ModulesProxy
- ModulesProxyRegistry
- MultiSigKeyHolders
- MultiSigWallet
- Mutex
- Objects
- OrderStruct
- OrigingVestingCreator
- OriginInvestorsClaim
- Ownable
- Pausable
- PausableOz
- PreviousLoanToken
- PreviousLoanTokenSettingsLowerAdmin
- PriceFeedRSKOracle
- PriceFeeds
- PriceFeedsLocal
- PriceFeedsMoC
- PriceFeedV1PoolOracle
- ProtocolAffiliatesInterface
- ProtocolLike
- ProtocolSettings
- ProtocolSettingsEvents
- ProtocolSettingsLike
- ProtocolSwapExternalInterface
- ProtocolTokenUser
- Proxy
- ProxyOwnable
- ReentrancyGuard
- RewardHelper
- RSKAddrValidator
- SafeERC20
- SafeMath
- SafeMath96
- setGet
- SharedReentrancyGuard
- SignedSafeMath
- SOV
- sovrynProtocol
- StakingAdminModule
- StakingGovernanceModule
- StakingInterface
- StakingProxy
- StakingRewards
- StakingRewardsProxy
- StakingRewardsStorage
- StakingShared
- StakingStakeModule
- StakingStorageModule
- StakingStorageShared
- StakingVestingModule
- StakingWithdrawModule
- State
- SwapsEvents
- SwapsExternal
- SwapsImplLocal
- SwapsImplSovrynSwap
- SwapsUser
- TeamVesting
- Timelock
- TimelockHarness
- TimelockInterface
- TokenSender
- UpgradableProxy
- USDTPriceFeed
- Utils
- VaultController
- Vesting
- VestingCreator
- VestingFactory
- VestingLogic
- VestingRegistry
- VestingRegistry2
- VestingRegistry3
- VestingRegistryLogic
- VestingRegistryProxy
- VestingRegistryStorage
- VestingStorage
- WeightedStakingModule
- WRBTC