contract StrategyMakerLINKV1 is StrategyMakerBase, StrategyCmpdDaiBase {
    // strategy specific
    address public link_collateral = 0x514910771AF9Ca656af840dff83E8264EcF986CA;
    address public link_usd = 0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c;
    uint256 public link_collateral_decimal = 1e18;
    bytes32 public link_ilk = "LINK-A";
    address public link_apt = 0xdFccAf8fDbD2F4805C174f856a317765B49E4a50;

    constructor(address _governance, address _strategist, address _controller, address _timelock) 
        public StrategyMakerBase(
            link_apt,
            link_ilk,
            link_collateral,
            link_collateral_decimal,
            link_usd,
            link_collateral,
            _governance,
            _strategist,
            _controller,
            _timelock
        )
    {
	   
    }
	
    // **** Setters ****	

    function setColFactorLeverageBuffer(uint256 _colFactorLeverageBuffer) public onlyGovernanceAndStrategist {
        colFactorLeverageBuffer = _colFactorLeverageBuffer;
    }

    function setColFactorSyncBuffer(uint256 _colFactorSyncBuffer) public onlyGovernanceAndStrategist {
        colFactorSyncBuffer = _colFactorSyncBuffer;
    }
	
    // **** State Mutation functions ****	

    function leverageToMax() public onlyKeepers{
        uint256 unleveragedSupply = getSuppliedUnleveraged();
        uint256 idealSupply = getLeveragedSupplyTarget(unleveragedSupply);
        _lUntil(idealSupply);
    }

    function deleverageToMin() public onlyKeepers{
        uint256 unleveragedSupply = getSuppliedUnleveraged();
        _dlUntil(unleveragedSupply);
    }
	
    function leverageUntil(uint256 _supplyAmount) public onlyKeepers {
        _lUntil(_supplyAmount);
    }
	
    function deleverageUntil(uint256 _supplyAmount) public onlyKeepers {
        _dlUntil(_supplyAmount);
    }
	
    function harvest() public override onlyBenevolent {
        _claimComp();
		
        uint256 _comp = IERC20(comp).balanceOf(address(this));
        if (_comp > 0) {
            _swapUniswap(comp, want, _comp);
        }

        uint256 _want = IERC20(want).balanceOf(address(this));
        uint256 _buybackAmount = _want.mul(performanceFee).div(performanceMax);

        if (buybackEnabled == true && _buybackAmount > 0) {
            buybackAndNotify(want, _buybackAmount);
        } else {
            // We want to get back LINK
            if (_want > 0) {
                // Performance Fees goes to treasury
                IERC20(want).safeTransfer(IController(controller).treasury(), _want.mul(performanceFee).div(performanceMax));
            }
        }

        // re-invest to compounding profit
        if (_want > 0) {
            deposit();
        }
    }
	
    function _convertWantToBuyback(uint256 _lpAmount) internal override returns (address, uint256){
        return (link_collateral, _lpAmount);
    }
	
    function _depositDAI(uint256 _daiAmt) internal override{	
        if (_daiAmt > 0){		
            _supplyDAI(_daiAmt);
        }
    }
	
    function _withdrawDAI(uint256 _daiAmt) internal override{	
        if (_daiAmt > 0){			
            _redeemDAI(_daiAmt);
        }
    }

    // Controller only function for creating additional rewards from dust
    function withdraw(IERC20 _asset) external override returns (uint256 balance) {
        require(cdai != address(_asset), "!cToken");
        _withdrawNonWantAsset(_asset);
    }

    // **** Views ****

    function getName() external override pure returns (string memory) {
        return "StrategyMakerLINKV1";
    }
}
function leverageToMax() public onlyKeepers{
    uint256 unleveragedSupply = getSuppliedUnleveraged();
    uint256 idealSupply = getLeveragedSupplyTarget(unleveragedSupply);
    _lUntil(idealSupply);
}

// **** State Mutation functions ****	