bZx is a decentralized cryptoasset lending protocol primarily intended to facilitate margin trading of ETH and ERC-20 tokens. Operating on Ethereum, the core bZx ecosystem consists of a series of solidity-based smart contracts and three native ERC-20 assets: iTokens, pTokens and BZRX. Notably not itself an exchange, the bZx protocol is currently instantiated by integrations into various third-party decentralized exchanges, as well as the project’s three native DeFi products: bZx Portal, Fulcrum, and Torque. Further, bZx has fostered an extended decentralized financial ecosystem, consisting of wallets, exchanges and cryptoasset management tools with which its protocol interacts and/or powers. The team behind bZx is led by CEO Tom Bean, a former Nokia engineer, and CVO Kyle Kistner, a former molecular biological researcher at Georgia State University.
Base Protocol Details
The bZx protocol is a cryptoeceonmic primitive enabling the trustless margin lending of cryptoassets in decentralized environments. Such lending for the purposes of margin trading offers potentially lucrative returns for both lenders, who earn interest on cryptoassets loaned, and traders, who earned returns on short and leveraged positions. However, hitherto available only on centralized exchanges, potential profits from margin lending for both parties were lost, as many traders were unwilling to accept the counterparty risk associated with custodial exchanges, and lenders had no means of servicing traders via decentralized exchanges. bZx, rooted in the 0x protocol for decentralized trading of Ethereum-based assets, seeks to facilitate margin trading through non-custodial DEXs as well as its own platforms, negating certain counterparty risk; with loaned assets secured by smart contracts rather than centralized ledgers, decentralized margin lending carries with it lower costs, as it negates high risk premiums resulting from third-party possession of one’s private keys.
While exact procedures vary by implementation, the core bZx protocol is comprised of a series of Ethereum-based smart contracts, with the bZx.sol contract acting as coordinator of and ultimate authority over all sub-contracts. At a high level, the lending process is catalyzed by either lenders or borrowers sending a request for matching to bZx.sol via a third-party application acting as a relay (i.e. a DEX interface, into which the bZx protocol has been integrated). Once counterparties are matched and loan parameters finalized, bZx smart contracts trustlessly facilitate the transfer of the specified asset from the lender to the borrower, and the transfer of the borrower’s collateral to bZx’s centralized pool; in exchange, the lender receives iTokens or pTokens—depending on the type of loan—which represent a commensurate claim to assets held in pool as well as accrued interest.
Individual loans are overseen by custom oracle contracts, which are submitted to and selected from an open, fee-based marketplace by oracle providers and loan counterparties, respectively. The open-source oracle smart contracts are solely responsible for monitoring the loan’s maintenance margin and, when deemed necessary according to external price feeds, initiating liquidation of its collateral. Alternatively, counterparties may choose to employ the protocol’s native bZxOracle contract, which performs the same liquidation functions as custom oracle contracts but instead relies on public ‘bounty hunters’ to indicate inadequate collateralization levels, triggering liquidation, in exchange for a percentage of oracle fees.
To close out a loan position, the lender simply sends their iTokens or pTokens back to the bZx contract, where they will be burned; doing so initiates an atomic swap, instantly returning to the lender their principal and accrued interest from bZx’s capital pool. Loans may be closed by the lender at any time without impacting the borrowers, so long as the network’s total loan utilization does not surpass 100% (in which case, a queue is formed and lenders are gradually reimbursed on an ongoing basis). Conversely, one may ‘exit’ a position by simply selling one’s iTokens or pTokens on the open market.
In addition to integrations into third-party exchanges, the bZx protocol underlies bZx’s three native DeFi products:
- bZx Portal is the first live implementation of the bZx protocol, serving as a native alternative to DEXs for accessing bZx’s decentralized margin trading services. The portal broadly facilitates the full spectrum bZx’s functions, and is divided into four sections: an order book for matching borrowers and lenders; a section for borrowers to manage borrowed funds and associated trades and a corresponding, reciprocal section for lenders to do so; and a section for bounty hunters to monitor trades and request liquidation.
- Fulcrum is bZx’s primary platform intended specifically for non-custodial, tokenized lending and margin trading, facilitating both activities directly on the dApp itself. The platform supports the minting and burning of iTokens and pTokens for the leveraging, shorting and lending of ERC-20 assets, while requiring no KYC measures. The open-source platform also maintains its own iToken and pToken lending pool, as well as an insurance fund to mitigate the risk of socialized clawbacks.
- Torque employs the bZx protocol to offer indefinite-term, fixed-interest rate loans. Loans made on Torque funded directly by Fulcrum’s iToken lending pool and request are made through a base protocol order with a duration parameter of zero. As such, Torque loans are overcollateralized by ETH or any ERC-20 asset, including perpetual maintenance of three month’s interest, held in Fulcrum’s iToken contract; thus, those holding iTokens from loans made on Fulcrum also earn a claim to interest and collateralizing assets from Torque transactions.
The differences, from an end user’s perspective, between bZx and other margin trading protocols vary by the former’s given instantiation—i.e. Fulcrum operates with a higher degree of centralization than does bZx Portal. In general, however, the core bZx differentiates itself from other margin lending protocols, such as Compound and MakerDAO, through its decentralized sourcing of price feeds and interest rates for DEXs and their order books; in contrast, Compound and other peers do not employ DEX order books, nor do they utilize data therefrom, instead maintaining whitelisted price feeds and centrally-controlled interest rates.
Conceived in 2017, bZx released its official whitepaper in February of 2018. Two months later, the bZx protocol was initially launched via the Ropsten Testnet. The release of bZx Portal and bZx.js occurred in the days immediately following. In contrast to many of its contemporaries, bZx conducted its token sale several months after the release of its first implementation on Ethereum’s testnet. Though the project raised $8M in ETH from the sale of 7.3M BZRX tokens (22% of total supply), it fell significantly short of its $36.5M hard cap (which would have accounted 500M tokens, 50% of the total BZRX supply). Fulcrum and Torque, joining bZx Portal as the project’s native instantiations of the bZx protocol, were launched in June and October of 2019, respectively.
In February of 2020, bZx lost $945,000 of assets held in its collateral pool as the result of two consecutive protocol manipulation events. In the first instance, an attacker was able to exploit a “logic bug” in the protocol’s lending mechanism, completing a complex series of transactions across multiple prominent DeFi platforms, ultimately netting $300,000 in profit from bZx’s collateral pool. At a high level, the maneuver involved ETH, obtained via a flash loan from dYdX, being used to collateralize a wBTC loan on Compound and a ETH:wBTC short position on Fulcrum, thus obtaining a large number of wBTC from both transactions; additional ETH was then borrowed and swapped for wBTC via the Kyber protocol, effectively driving up the wBTC price on Uniswap. Finally, the attacker uses Uniswap to sell the wBTC for on Kyber and Compound, allowing them to pay back the initial flash loan and exit with a profit of 1,200 ETH. Notably, the attack did not involve any direct security breaches of coding, but rather ‘legitimately’ profited from arbitrage, exploiting mass slippage resulting from bZx’s—and, in general, DeFi’s—illiquidity.
One day later, a second attack took advantage of flaws in bZx’s oracle mechanisms to profit $645,000 from the platform’s ETH pool. As with the previous attack, this exploitation targeted a procedural inefficiency rather than a coding vulnerability. That is, the attacker obtained ETH through a bZx flash loan, used a portion of the ETH to purchase sUSD from Synthetix, and then used the sUSD to collateralize a second bZx ETH loan. They then used another portion of the flash loaned ETH to articifially inflate the price of the dollar-pegged stablecoin to $2, effectively deceiving bZx’s oracle into offering a disproportionate exchange rate and allowing them to convert all sUSD positions back to ETH a net gain of 2,378 ETH, derived from bZx’s ETH pool. In response to this attack, bZx announced it would incorporate Chainlink’s oracle middleware into its protocol according to an accelerated timeline.
While myriad cryptoassets exist within the bZx ecosystem, three types of digital assets perform key functions of the bZx protocol’s core token economy:
- iTokens are a class of assets representing a pro rata claim on the funds held in the lending pool, including accrued interest. Lenders receive freely-tradable iTokens upon finalization of a loan agreement may redeem them for due funds at any time via burning in a bZx smart contract or through selling them on the open market. iTokens are individual, fungible ERC-20 compliant assets named according to the asset underlying their associated loan; examples of iTokens include iLINK, iBAT, iREP and iETH.
- pTokens function similarly to iTokens but are used exclusively when a trader wishes to enter a short position. Like an iToken contract, when called, a pToken contract distributes pTokens to the lender and appropriate assets from the lending pool to the borrower. However, pToken contracts take the additional step of calling the KyberSwap contract to initiate an exchange of the borrowed asset (thus shorting it). pTokens are also fungible, freely-tradable ERC-20 assets. Both iTokens and pTokens have an unfixed supply and come into existence only through participation in lending.
- BZRX is the project’s native governance token that serves as the primary medium of exchange within the bZx ecosystem. In addition to being freely-tradable across external exchanges, these ERC-20 assets may always be redeemed for an equivalent amount of diversified assets held in the lending pool. As relay fees are paid in BZRX, such an ability to exchange BZRX seeks to avoid issues faced by the 0x protocol: namely, ZRX struggled to retain value as relays either exchanged their ZRX fees immediately or performed duties for no fees at all. Most importantly, however, BZRX ownership confers a pro rata claim to assets held in the protocol’s insurance fund.