View Source: contracts/connectors/loantoken/interfaces/ProtocolLike.sol
- borrowOrTradeFromPool(bytes32 loanParamsId, bytes32 loanId, bool isTorqueLoan, uint256 initialMargin, struct MarginTradeStructHelpers.SentAddresses sentAddresses, struct MarginTradeStructHelpers.SentAmounts sentValues, bytes loanDataBytes)
- getTotalPrincipal(address lender, address loanToken)
- withdrawAccruedInterest(address loanToken)
- getLenderInterestData(address lender, address loanToken)
- priceFeeds()
- 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)
- isLoanPool(address loanPool)
- lendingFeePercent()
- getSwapExpectedReturn(address sourceToken, address destToken, uint256 sourceTokenAmount)
- borrowerNonce(address )
- closeWithSwap(bytes32 loanId, address receiver, uint256 swapAmount, bool returnTokenIsCollateral, bytes )
- closeWithDeposit(bytes32 loanId, address receiver, uint256 depositAmount)
function borrowOrTradeFromPool(bytes32 loanParamsId, bytes32 loanId, bool isTorqueLoan, uint256 initialMargin, struct MarginTradeStructHelpers.SentAddresses sentAddresses, struct MarginTradeStructHelpers.SentAmounts sentValues, bytes loanDataBytes) external payable
returns(newPrincipal uint256, newCollateral 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 newPrincipal, uint256 newCollateral);
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 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 priceFeeds() external view
returns(address)
Source Code
function priceFeeds() external view returns (address);
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 isLoanPool(address loanPool) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
loanPool | address |
Source Code
function isLoanPool(address loanPool) external view returns (bool);
function lendingFeePercent() external view
returns(uint256)
Source Code
function lendingFeePercent() external view returns (uint256);
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 borrowerNonce(address ) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
address |
Source Code
function borrowerNonce(address) external view returns (uint256);
function closeWithSwap(bytes32 loanId, address receiver, uint256 swapAmount, bool returnTokenIsCollateral, bytes ) external nonpayable
returns(loanCloseAmount uint256, withdrawAmount uint256, withdrawToken address)
Arguments
Name | Type | Description |
---|---|---|
loanId | bytes32 | |
receiver | address | |
swapAmount | uint256 | |
returnTokenIsCollateral | bool | |
bytes |
Source Code
function closeWithSwap(
bytes32 loanId,
address receiver,
uint256 swapAmount, // denominated in collateralToken
bool returnTokenIsCollateral, // true: withdraws collateralToken, false: withdraws loanToken
bytes calldata // for future use /*loanDataBytes*/
)
external
returns (
uint256 loanCloseAmount,
uint256 withdrawAmount,
address withdrawToken
);
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
);
- 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