function _borrow(
    address from,
    address to,
    uint256 amount
) internal returns (uint256 part, uint256 share) {
    uint256 feeAmount = (amount * borrowOpeningFee) / FEE_PRECISION; // A flat % fee is charged for any borrow

    (totalBorrow, part) = totalBorrow.add(amount + feeAmount, true);
    require(
        totalBorrowCap == 0 || totalBorrow.elastic <= totalBorrowCap,
        "BigBang: borrow cap reached"
    );

    userBorrowPart[from] += part;

    //mint USDO
    IUSDOBase(address(asset)).mint(address(this), amount);

    //deposit borrowed amount to user
    asset.approve(address(yieldBox), amount);
    yieldBox.depositAsset(assetId, address(this), to, amount, 0);

    share = yieldBox.toShare(assetId, amount, false);

    emit LogBorrow(from, to, amount, feeAmount, part);
}
