SiloRepository
Last updated
Last updated
SiloRepository
SiloRepository handles the creation and configuration of Silos.
Stores configuration for each asset in each silo. Each asset in each Silo starts with a default config can later be changed by the contract owner. Stores registry of Factory contracts that deploy different versions of Silos. It is possible to have multiple versions/implementations of Silo and use different versions for different tokens. For example, one version can be used for UNI (ERC20) and the other can be used for UniV3LP tokens (ERC721). Manages bridge assets. Each Silo can have 1 or more bridge assets. New Silos are created with all currently active bridge assets. Silos that are already developed must synchronize bridge assets. Sync can be done by anyone, function has public access. Is a single source of truth for other contract addresses.
Transfers ownership of the contract to a pending owner Can only be called by the pending owner.
Adds new bridge asset
New bridge asset must be unique. Duplicates in bridge assets are not allowed. It's possible to add bridge asset that has been removed in the past. Note that all Silos must be synced manually. Callable only by owner.
Name | Type | Description |
---|---|---|
maps silo => asset => config
Silo for bridge asset. We can have only one bridge pool
Default values for AssetConfig. Used if values are not configured manually.
checks all conditions for new silo creation and throws when not possible to create
Get protocol fee for opening a borrow position
Get current bridge assets
Keep in mind that not all Silos may be synced with current bridge assets so it's possbile that some assets in that list are not part of given Silo.
Get Interest Rate Model address for asset in given Silo
If dedicated config is not set, method returns default config
Get liquidation threshold for asset in given Silo
If dedicated config is not set, method returns default config
Gets deposit limit for Silo
Get maximum LTV for asset in given Silo
If dedicated config is not set, method returns default config
Maps Silo address to incentive contract that will distribute rewards for that Silo
Get removed bridge assets
Keep in mind that not all Silos may be synced with bridge assets so it's possbile that some assets in that list are still part of given Silo.
maps token address to silo address, asset => silo
Check if contract address is a Silo deployment
Check given asset in a Silo is paused
use this method only when off-chain verification is OFF
Silo does NOT support rebase and deflationary tokens
Get owner role address of Repository
Returns the address of the pending owner.
PriceProvidersRepository contract that manages ProceProviders implementations and is an entry point for reading prices for Silos.
Get protocol liquidation fee
Get protocol share fee
Registers new Silo version
User can choose which Silo version he wants to deploy. It's possible to have multiple versions of Silo. Callable only by owner.
Removes bridge asset
Note that all Silos must be synced manually. Callable only by owner.
Leaves the contract without owner. It will not be possible to call onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
use this method to deploy new version of Silo for an asset that already has Silo deployed. Only owner (DAO) can replace.
Silo does NOT support rebase and deflationary tokens
SiloRouter utility contract that combines number of actions (Deposit, Withdraw, Borrow, Repay) for batch execution in single transaction.
Set configuration for given asset in given Silo
Callable only by owner
Set default interest rate model
Callable only by owner
Set default liquidation threshold
Callable only by owner
Set default maximum LTV
Callable only by owner
Sets default deposit limit for all Silos
Set default Silo version
Callable only by owner.
Set default fees
Callable only by owner
Pause all Silos
Callable only by owner.
Set NotificationReceiver contract
Callable only by owner
Set price provider repository
Callable only by owner
Set router contract
Callable only by owner
Sets deposit limit for Silo
Pause single asset in a single Silo
Callable only by owner.
Set factory contract for debt and collateral tokens for each Silo asset
Callable only by owner
Maps version => ISiloFactory. Versions start at 1 and are incremented by 1.
maps silo address to token address, silo => asset
Switch to turn on and off limited liquidity
Factory contracts that deploys debt and collateral tokens for each asset in Silo
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Transfers pending ownership of the contract to a new account (newPendingOwner
). Can only be called by the current owner.
Unregisters Silo version
Callable only by owner.
Emitted on new bridge asset
Emitted on removed bridge asset
Emitted when new Silo (or existing one) becomes a bridge pool (pool with only bridge tokens).
Emitted when default max liquidity limit is changed
Emitted when default fee is updated
Emitted when all Silos are paused or unpaused
Emitted when default interest rate model is changed
Emitted when max liquidity toggle is switched
Emitted on new Silo creation
Emitted on INotificationReceiver address update
Emitted when ownership transfer is proposed, aka pending owner is set
Emitted when ownership is transferred on transferOwnership
and acceptOwnership
Emitted on price provider repository address update
Emitted when new Silo version is registered
Emitted on router address update
Emitted when default Silo version is updated
Emitted when deposit liquidity limit is changed for Silo and asset
Emitted when asingle Silo or single asset in a Silo is paused or unpaused
Emitted on token factory address update
Emitted when Silo version is unregistered
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
_newBridgeAsset
address
bridge asset address
_0
address
undefined
_1
address
undefined
maxLoanToValue
uint64
undefined
liquidationThreshold
uint64
undefined
interestRateModel
contract IInterestRateModel
undefined
_0
address
undefined
maxLoanToValue
uint64
undefined
liquidationThreshold
uint64
undefined
interestRateModel
contract IInterestRateModel
undefined
_asset
address
address of asset for which you want to create silo
_assetIsABridge
bool
bool TRUE when _asset
is bridge asset, FALSE when it is not
_0
uint256
fee in precision points (BaseSilo.PRECISION_DECIMALS() == 100%)
entryFee
uint64
undefined
protocolShareFee
uint64
undefined
protocolLiquidationFee
uint64
undefined
_0
address[]
address array of bridge assets
_silo
address
address of Silo
_asset
address
address of an asset
model
contract IInterestRateModel
address of interest rate model
_silo
address
address of Silo
_asset
address
address of an asset
_0
uint256
liquidation threshold in precision points (BaseSilo.PRECISION_DECIMALS())
_silo
address
Silo address for which to set limit
_asset
address
Silo asset for which to set limit
_0
uint256
deposit limit for Silo
_silo
address
address of Silo
_asset
address
address of an asset
_0
uint256
maximum LTV in precision points (BaseSilo.PRECISION_DECIMALS())
_0
address
undefined
_0
contract INotificationReceiver
undefined
_0
address[]
address array of bridge assets
_0
address
undefined
_0
address
undefined
globalPause
bool
undefined
_silo
address
address of expected Silo
_0
bool
true if address is Silo deployment, otherwise false
_silo
address
address of Silo
_asset
address
address of an asset
_0
bool
true if given asset in a Silo is paused, otherwise false
globalToggle
bool
undefined
defaultMaxLiquidity
uint256
undefined
_siloAsset
address
silo asset
_siloVersion
uint128
version of silo implementation
_siloData
bytes
(optional) data that may be needed during silo creation
_0
address
owner role address
_0
address
undefined
_0
contract IPriceProvidersRepository
undefined
_0
uint256
protocol liquidation fee in precision points (BaseSilo.PRECISION_DECIMALS() == 100%)
_0
uint256
protocol share fee in precision points (BaseSilo.PRECISION_DECIMALS() == 100%)
_factory
contract ISiloFactory
factory contract that deploys new version of Silo
_isDefault
bool
true if this version should be used as default
_bridgeAssetToRemove
address
bridge asset address to be removed
_siloAsset
address
silo asset
_siloVersion
uint128
version of silo implementation. Use 0 for default version which is fine for 99% of cases.
_siloData
bytes
(optional) data that may be needed during silo creation
_0
address
undefined
_silo
address
Silo address for which config applies
_asset
address
asset address for which config applies
_assetConfig
ISiloRepository.AssetConfig
: - _maxLoanToValue maximum Loan-to-Value, for detailes see Repository.AssetConfig.maxLoanToValue
- _liquidationThreshold liquidation threshold, for detailes see Repository.AssetConfig.maxLoanToValue
- _interestRateModel interest rate model address, for detailes see Repository.AssetConfig.interestRateModel
_defaultInterestRateModel
contract IInterestRateModel
default interest rate model
_defaultLiquidationThreshold
uint64
default liquidation threshold in precision points (BaseSilo.PRECISION_DECIMALS())
_defaultMaxLTV
uint64
default maximum LTV in precision points (BaseSilo.PRECISION_DECIMALS())
_maxDeposits
uint256
deposit limit amount in ETH
_defaultVersion
uint128
Silo version to be set as default
_fees
ISiloRepository.Fees
: - _entryFee one time protocol fee for opening a borrow position in precision points (BaseSilo.PRECISION_DECIMALS()) - _protocolShareFee protocol revenue share in interest paid in precision points (BaseSilo.PRECISION_DECIMALS()) - _protocolLiquidationFee protocol share in liquidation profit in precision points (BaseSilo.PRECISION_DECIMALS()). It's calculated from total collateral amount to be transferred to liquidator.
_globalPause
bool
true to pause all Silos, otherwise false
_silo
address
silo address for which to set _notificationReceiver
_newNotificationReceiver
contract INotificationReceiver
undefined
_repository
address
price provider repository address
_router
address
router address
_silo
address
Silo address for which to set limit
_asset
address
Silo asset for which to set limit
_maxDeposits
uint256
deposit limit amount in ETH
_silo
address
address of Silo in which _asset
is being paused
_asset
address
address of an asset that is being paused
_pauseValue
bool
true to pause, false to unpause
_tokensFactory
address
address of TokensFactory contract that deploys debt and collateral tokens
_0
uint256
undefined
_0
contract ISiloFactory
undefined
_0
bool
undefined
_0
address
undefined
_0
address
undefined
byDefault
uint128
undefined
latest
uint128
undefined
_0
contract ITokensFactory
undefined
newOwner
address
undefined
newPendingOwner
address
undefined
_siloVersion
uint128
Silo version to be unregistered
newBridgeAsset
address
undefined
bridgeAssetRemoved
address
undefined
pool indexed
address
undefined
newMaxDeposits
uint256
undefined
newEntryFee
uint64
undefined
newProtocolShareFee
uint64
undefined
newProtocolLiquidationFee
uint64
undefined
globalPause
bool
undefined
newModel
contract IInterestRateModel
undefined
newLimitedMaxLiquidityState
bool
undefined
defaultLiquidationThreshold
uint64
undefined
defaultMaximumLTV
uint64
undefined
silo indexed
address
undefined
asset indexed
address
undefined
siloVersion
uint128
undefined
newIncentiveContract
contract INotificationReceiver
undefined
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
oldProvider
contract IPriceProvidersRepository
undefined
newProvider
contract IPriceProvidersRepository
undefined
factory
address
undefined
siloLatestVersion
uint128
undefined
siloDefaultVersion
uint128
undefined
oldRouter
address
undefined
newRouter
address
undefined
oldDefaultVersion
uint128
undefined
newDefaultVersion
uint128
undefined
silo indexed
address
undefined
asset indexed
address
undefined
newMaxDeposits
uint256
undefined
silo
address
undefined
asset
address
undefined
pauseValue
bool
undefined
oldTokensFactory
address
undefined
newTokensFactory
address
undefined
factory
address
undefined
siloVersion
uint128
undefined