Adaptors
A detailed breakdown of the BaseAdaptor.sol contract.
Last updated
A detailed breakdown of the BaseAdaptor.sol contract.
Last updated
Adaptors are the mechanisms by which strategists can interact with external protocols and allocate Cellar assets. All adaptors inherit from , which spells out a number of requirements for an adaptor to be used with Cellars:
Each adaptor must have a unique identifier
. Updated adaptors using the same protocol should increment a version number in their identifier.
Each adaptor should report its base asset, via assetOf
, and any other assets used, with assetsUsed
.
An adaptor should report whether or not it allows the Cellar to take on debt, via isDebt
.
An adaptor should be able to report its own balance in terms of the assetOf
asset, via the invocation of balanceOf
.
An adaptor should contain deposit
, withdraw
, and withdrawableFrom
functions that allow Cellars to move assets into and out of the position in response to user deposit/withdrawal requests. For adaptors that do not represent liquid positions (such as adaptors for debt positions, like the ), the implementor can have withdrawableFrom
return 0
.
For more information on adaptor architecture, see
See the next page for a current API for BaseAdaptor.sol
.