Saturday, February 24, 2018

LENDROID Decentralized Margin Trading

LENDROID’S LENDING ORIGINS
The lender is the primary participant on the Lendroid platform. The protocol’s soundness is validated only by his sustained, profitable participation. The lender’s trust in the trust-independent protocol will power the creation of a global lending pool. To this end, innovative rules and fail safes have been put in place to not let down his basic expectations – of protecting his capital and earning risk-free interest in a low-friction manner.
In point of fact, Lendroid was initially intended as a decentralized lending platform. Broadly, the process was designed thus: A borrower pledges digital assets into an escrow account, and the lender defines specific terms for the loan – amount, interest rate, loan period, loan to value (LTV) – set in a smart contract. If the lender’s and borrower’s terms match, the smart contract is executed, locking in the collateral and releasing the funds to the borrower. If the borrower satisfies the loan obligations, his collateral is unlocked automatically. If the borrower defaults or the collateral drops below the agreed LTV, the collateral is liquidated.
From here on, margin trading seemed a logical first-use case for Lendroid for two main reasons
a. A Rapidly Growing Market - Margin funding has soared, as recorded by some widely used exchanges like Poloniex and Bitfinex. On the latter exchange alone, USD funding has increased from 14.8 Million to 168.5 million (Oct 2016 to Oct 2017); BTC loans have gone from USD 6.12 Million to USD 183 Million (Oct 2016 to Sep 2017); and ETH loans have risen from USD 834,192 to USD 88.29 Million (Oct 2016 to Sep 2017).
b. Need for Trust Independence is Immediate - Centralized exchanges that enable margin trading are left with the onerous, dual responsibility of funds and collateral management as well as keeping the traders from defaulting. In order to provide this service, it might be argued, centralized exchanges have bypassed the inherent strengths of the blockchain ecosystem premised on decentralization, on absolute protection and anonymity by global consensus.
A decentralized margin trading protocol - a platform that is censorship resistant and can be accessed globally would help move away from central custodians holding user funds. Further, a global network of lenders will increase liquidity and reduce overall margin trading costs.
THE 0X SHIFT
Consider the three main functions provided by current public exchanges – Exchange (regular trading), Margin Trading, and Lending. Ever since 0x – a protocol for peer-to-peer exchange of ERC20 tokens rolled out, a wholly decentralized ecosystem comprising all three functions has begun to seem highly plausible. The catalysts for this development are the ‘Relayers’, incentivized entities that facilitate the hosting of order books on 0x. The orders themselves are settled on the Ethereum blockchain using smart contracts.
The positive reception that has greeted 0x is the most recent illustration of the shift towards a wholly trust-independent, secure and decentralized exchange. The implications are tremendous, and new 0x relayers such as such as Ethfinex, Radar and The Ocean have already begun to enter the fray.
However, where 0x has enabled the Exchange to function seamlessly, the Lending and Margin Trading functions remain outside of the ecosystem. These are the missing pieces that Lendroid brings together to create a comprehensive solution.
AN ETHICAL PARENTHESIS
Ethical considerations seldom find a place in discussions about the structure of new cryptoeconomic models. In the case of Lendroid, however, they assume unique context.
This protocol aims to take forward a culture of fairness inherent in the blockchain ecosystem. Lendroid sets out to achieve total decentralization and true trust-independence at the most basic, reliable levels. Lendroid is not agnostic or indifferent to trust, which is after all, a positive phenomenon. It simply recognizes and leverages a paradox – trust abounds only in an environment that does not depend on it. To paraphrase a celebrated Google adage, on Lendroid the hope is that one ‘Can’t Be Evil’. Further on in this whitepaper, you will see that this end state is sought with a two-pronged approach
a. Inviolability: Vital, sensitive, conventionally trust-dependent functions like fund management are executed on-chain and via publicly accessible, inviolable Ethereum smart contracts.
b. Symbiosis: Wherein the off-chain players are incentivized to carry out their functions and whose propensity for profit and growth is proportionate to that of the other players in the ecosystem.
LENDROID FROM FOUR USERS JOURNEY
A more comprehensive and effective understanding of the protocol can be achieved when approached from the user journeys of four key actors.
THE LENDER
Analogous to the Maker from the 0x protocol, the lender broadcasts the loan-offer to all decentralized exchanges (off-chain action). Of the different types of accounts within the Lendroid Smart Contract system, the Funding Account is available to the lenders to deposit funds into and offer loans from.
Each loan offer is a data packet called the offer object containing the terms of the loan, offer parameters, and an associated ECDSA signature. The loan terms and parameters are concatenated and hashed to produce a 32 byte-long Keccak SHA3 signature called the offer-hash. The lender signs this offer-hash with their private key to produce the ECDSA signature.
As discussed in section 1, it is imperative that the interests of the Lender - who contributes to the shared liquidity pool - are protected. This is enabled by empowering the Lender to define key parameters within the offer object.
Defining the Offer Object
Off chain, the Lender defines the offer object with a range of parameters, key among them
a. Loan Amount and Interest Rate: The Lender defines the offer amount (token offered and number of units of the token) and sets the interest to be calculated on a daily basis.
b. Loan Expiration Period: The validity of the loan from the time it is availed. On expiry, the loan is called in and, should the borrower so choose, rolled over with another loan.
c. Offer Expiration: The validity of the offer itself. Based on the demand for a token, a Lender might want to change his offer to reflect a different interest rate or number of token units. Setting a prudent expiry time for the offer allows for this flexibility, without having go on-chain.
Bookkeeping
The same off-chain advantage in interface extends to the bookkeeping function of the Relayer as well. With computational power unbridled by on-chain lags and costs in gas, a Relayer can maintain Offer Books in a real-time, seamless manner.
The Relayer is incentivized with a fee in the Lendroid Support Token (LST) for recording and relaying the loan offer. A fee is paid by the Lender and, when the loan is availed, by the borrower/margin trader as well. Attracting liquidity into the platform, the Relayer is paid only when a loan is availed, and closed properly. The Relayer is able to match and offer with an ask even if it originated with another Relayer. Despite the incentive, and the fact that the Relayer has access to the entire shared lending pool, the protocol remains trust independent because of two key 0x-inspired characteristics, written into the protocol itself.
a. Relayers cannot execute transactions on behalf of the Lender or the Margin Trader. They can only recommend an ideal offer.
b. A clear fee structure when a loan is availed. The Relayer with whom the offer was recorded is paid by the Lender, and the same Relayer is paid by the Margin Trader once the loan is paid back.
A Global, Shared Liquidity Pool
Due to the inherent trust-independence of the protocol, access to loan offers is not limited to any one Relayer or a particular set of Relayers on Lendroid. As an extension, all the lenders and the Margin Traders on the platform contribute to liquidity in the ecosystem.
As Figure 3 illustrates, a lender is free to engage with any Relayer on the protocol. Irrespective of who they record the loan offer with, it goes into the shared lending pool. When catering to the Margin Trader, a Relayer is free to recommend loan offers received from any Relayer. In the interest of providing a ‘sticky’ experience that could make him the Primary Relayer, it is in his best interest to connect the Lender or Margin Trader to the most ideal offer.
The LENDROID AUCTION
The concept of a market order or limit order is inefficient in conventional exchanges and improbable on the blockchain. It requires intractable trust in the centralized exchange. When the collateral and positions of a Margin Account need to be repurposed, they are taken over by one or more Wranglers following a competitive bid. To be clear, this is not a winner-take-all auction.
Every Wrangler chooses to repay a small portion of the total outstanding loan and his bid will be proportionately considered. In other words, the Wrangler takes over the account, but only the corresponding percentage of the loan that he repays.
WHO IT HELPS?
The auction’s primary aim is to repay the Lender’s loan with interest. The auction is complete only if this basic criterion is met. To exercise their right on the collateral and the positions, the Wranglers repay the lender funds proportionate to the percentage they won in the auction. Because the competition prompts Wranglers to bid progressively lower for the collateral, the Margin Trader stands a chance to salvage some of his collateral at the end of the exercise, instead of having to lose it all. The Wrangler who identified the account is paid the bounty, and every Wrangler who bid successfully gets to win a portion of the assets.
In short, the Wranglers get to further their assets at a potentially discounted price, the Margin Trader is not impacted beyond repair, and the Lender’s interests are protected.
HOW IT HAPPENS?
Multiple Wranglers can monitor the margin account at the same time. The Wrangler who first identifies the terminal account triggers the startAuction function in the Auction Smart Contract. The Smart Contract triggers an Oracle call and subsequently checks the account’s margin level. The oracle, in this case, serves as an anti-spam feature. If the margin level is below the liquidation level, then the auction starts.
Once the auction commences, it remains open for a total of 3 minutes allowing various Wranglers to submit their bids. Say the total amount owed by the trader is 100 ETH. If Wrangler1 pays 10 ETH and Wrangler2 pays 30 ETH, they receive 10% and 30% of the Margin Account respectively. In addition to receiving trade positions, they can also request a portion of the collateral. The collateral requested is transferred to compensate for losses in the trade positions taken over by them. Both the LSTs and the collateral are distributed based on % of the position closed by the Wranglers. The only exception being the first Wrangler to detect the unhealthy Margin Account who is guaranteed 25% of the LSTs staked as a reward for hisvigilance. The remaining 75% is then distributed among the rest.
To summarize, the % of the position closed will determine how much of the LST and collateral each Wrangler receives, while the % of collateral requested will determine the order in which the Wranglers repay the loan.
Scenario:
Total margin account loans: 100 ETH
Total interest accrued: 1.5 ETH
Total owed to lenders: 101.5 ETH

Wranglers start bidding for a portion or the whole Margin Account, and how much collateral they require in addition to portion of the open positions they have rights over.
Once 3 minutes have passed, the smart contract proceeds to process the bids and allocates the positions, collateral and LSTs accordingly.
The bids are ordered by collateral % requested :
Lendroid will subsequently introduce two types of scripts. One for monitoring Margin Accounts and defaulting loans, and the other to bid auctions that Wranglers can put to use. These scripts are designed to minimize effort in monitoring and bidding.
LENDROID Smart Contract System
The Smart Contract is a pivotal aspect of the Lendroid protocol. Permissionless access and censorship resistance have been two key focuses of the Ethereum Smart Contract. Considering the evolving nature of the Lendroid protocol, and the immutability of the Smart Contract, we have worked towards a design that enables upgradability and modularity. It is important to note that Lendroid is a Smart Contract System. It runs not on one central Smart Contract, but a system of coded rules of how to handle values inside the Ethereum blockchain.
UPGRADABLE AND MODULAR
In the Lendroid Smart Contract System, there are the Fund Smart Contracts, Business Logic Contracts and the Proxy Contracts. Funds are held and handled in a Fund Smart Contract. The inviolable nature of these contracts is effectively put to use when defining loan contracts, or executing a range of cryptoeconomic functions.
The Business Rules Smart Contracts, on the other hand, are community-driven contracts. Market parameters, token support and other considerations will be determined by the community. When such modifications are writ, the Proxy Smart Contract redirects to the relevant Business Rules Smart Contract.
Road Map
Details Information

Bitcointalk : https://bitcointalk.org/index.php?action=profile;u=1103736

No comments:

Post a Comment