Buffer ARK

The Buffer ARK is a specialized holding contract in the Lazy Summer Protocol that manages deposits and withdrawals. It maintains a portion of Fleet assets in an undeployed state for efficient withdrawals.

Functionality

The Buffer ARK holds incoming deposits until they are allocated to yield-generating strategies. It maintains a minimum balance relative to the Fleet's total value locked (TVL) to facilitate efficient withdrawals, particularly beneficial for smaller transactions.

Withdrawal Methods

  1. Standard Withdrawal

    • Executes from Buffer ARK balance

    • Lower gas consumption

    • Efficient for most transaction sizes

  2. Force Withdrawal

    • Activates when Buffer ARK balance is insufficient

    • Withdraws directly from yield-generating ARKs

    • Higher gas consumption

    • Necessary for large withdrawals

    The Buffer ARK contract (BufferArk.sol) inherits from the base Ark contract and implement specialized buffer functionality:

    Constructor

    constructor(ArkParams memory _params, address commanderAddress) Ark(_params) {
        config.commander = commanderAddress;
    }
    • Initializes Buffer ARK with configuration parameters

    • Sets Fleet Commander address

    Asset Management Functions

    Total Assets View

    function totalAssets() public view override returns (uint256) {
        return config.asset.balanceOf(address(this));
    }
    • Returns current token balance

    • Direct reflection of undeployed assets

    • No yield calculations involved

    Withdrawable Assets View

    function _withdrawableTotalAssets() internal view override returns (uint256) {
        return totalAssets();
    }
    • All assets are always withdrawable

    • Returns same value as totalAssets()

    • No withdrawal restrictions implemented

    Asset Boarding

    function _board(uint256 amount, bytes calldata) internal override {}
    • Empty implementation

    • Assets automatically held in contract

    • No external protocol interactions

    Asset Disembarking

    function _disembark(uint256 amount, bytes calldata) internal override {}
    • Empty implementation

    • Standard ERC20 transfers handled by base contract

    • No position unwinding required

    Data Validation

    Board Data Validation

    function _validateBoardData(bytes calldata) internal override {}
    • No additional validation required

    • Accepts any boarding data

    • Empty implementation

    Disembark Data Validation

    function _validateDisembarkData(bytes calldata) internal override {}
    • No additional validation required

    • Accepts any disembarking data

    • Empty implementation

    Reward Handling

    function _harvest(bytes calldata) internal override returns (
        address[] memory rewardTokens,
        uint256[] memory rewardAmounts
    ) {}
    • Returns empty arrays

    • No reward generation

    • Empty implementation

    Integration Points

    1. Fleet Commander Interface

    config.commander = commanderAddress;
    • Set during construction

    • Controls asset allocation

    • Manages withdrawal coordination

    • ERC20 Token Interface

    config.asset.balanceOf(address(this))
    • Used for balance tracking

    • Core asset accounting

    • Inherited from base Ark contract

    Access Control

    The Buffer ARK inherits access control from the base Ark contract:

    • Only Fleet Commander can initiate withdrawals

    • Only authorized addresses can board assets

    • RAFT contract controls harvest operations

Last updated

Was this helpful?