Author Topic: What's wrong with this universal asset lending and margin method?  (Read 3126 times)

0 Members and 1 Guest are viewing this topic.

Offline Taconator

  • Newbie
  • *
  • Posts: 18
    • View Profile
I commend you on what you have written up, and look forward to possibly having this capability (or something like it) built into the DEX. I would like to discuss the following.

A possible scenario that could be gamed by a lender (although this need not squash the whole idea) when the markets are thin:

A cartel of lenders who make up all of the "lending" orders, could game the system by:
1. placing sell orders on the order book for the same asset that they will lend (the cartel controls all of the offers to lend);
2. lend some of what they are offering;
3. withdraw the remaining orders and cause a liquidation (thereby acquiring all of the borrower's collateral)

Is there any term? Or until paid back by borrower or collateral runs too low.

Why not any collateral amount agreed upon by lender and borrower?

Why not any interest rate agreed upon by the lender and borrower?

Offline moinyoin

posted about this on steemit:

derivation of leverage here:

working through simple example in excel:

imo if we start adding trustless assets through pegged gateways like trustless btc we have proposal coming up in core github discussions, this will be key to gain interest.

And it could work with any assets at all. (specific ones chosen by each lender)

Even including borrowing BTS and borrowing bitUSD from others to gain higher leverage (but pay daily fee).

Need to give traders the tools they want. If you're worried about traders losing money, put a warning there that feature creates additional risk from book liquidity - typical on any exchange.
« Last Edit: September 09, 2017, 11:36:06 pm by moinyoin »

Offline moinyoin

2 people: A (lender) and B (borrower).

2 example currencies used: open.BTC and open.USDT - but can be anything

A has 1 open.BTC, B has 10,000 open.USDT.

B locks 10,000 open.USDT in smart contract to borrow 1 open.BTC from A.

A has 0 balance, 1 open.BTC lended out balance
B has 1 open.BTC, debt of -1 open.BTC (required to unlock what's left of open.USDT collateral from contract C)
C (contract) has 10,000 open.USDT (keeping track of the cost on orderbooks to market-buy and return 1 open.BTC to lender, comparing that cost to balance in contract as the ratio, paying out daily fee from balance to A set by A)

(assuming minimum collateral:debt ratio is set to 2:1 for example by committee)

Liquidation: if cost to buy 1 open.BTC on order books for open.BTC:open.USDT is higher than (let's say) 1/2 of collateral (e.g. 10000 open.USDT), C market-buys up to 1 open.BTC with collateral and return it to A (liquidation). As second priority, returns the rest of open.USDT if any to B.

Daily fee: For lending profit, daily market buy lending rate (e.g. 2%) of borrowed amount (e.g. 0.05 open.BTC) and send to A. This also avoids lenders losing all their money forever bc eventually liquidation triggers but can happen on thin order books. If 1 open.BTC is not available on orderbook to return, they get the entire collateral instead.

Liquidity: One attack vector would be lending out 1 open.BTC and then moving price of open. BTC vs open.USDT up quickly on the dex which might be cheap with low liquidity to cause liquidation to happen and not enough left on order books to return entire open.BTC to A with not enough left open.USDT to return to B - but liquidation is danger on any trading platform and depends on liquidity. Margin ability brings traders and liquidity to fix it. We can't control traders coming to platform, but we can control margin features as one more broad tool. We can also provide list of risks for lending available on lending & borrowing screens.

Lender chooses for which market pairs to make lending available: Another attack vector would be to create fake asset like myToken and make fake value worth a lot on dex, borrow BTC with it as collateral, and never return because myToken is worthless. So lending should only be available for pairs lender approves at lending rate he approves.

Shorting : When you borrow BTC with USDT as collateral, and expect price of BTC in the pair to go down, you can sell BTC for USDT, buy back BTC lower for less USDT, and settle the 1 BTC debt, with left over USDT as profit.

Long: When you borrow USDT with BTC as collateral, and expect price of USD in the pair to go down, you can sell USDT for BTC , buy back USDT lower for less BTC , and settle the 1 USDT debt, with left over BTC as profit.

Because the collateral value is >2x of margin position (x) with extra (?) to avoid liquidation, the leverage range is (2x + x + ?)/(2x + ?) = (3+?)/(2+?) so 1.5x-1x leverage with 1.5x max for one such step. Repeated borrowing and selling increase leverage on part of leveraged positions and lead to higher effective leverage of ~2x.

How it looks:
list of lenders for each market would be available with corresponding fee rate sorted from lowest to highest. borrowing would just go after the lowest fee orders first until borrowed sum is reached or run out of lenders below your set max lending rate you're ok with. (think poloniex)

I guess this was looked into already, but I haven't seen it. Clearly there's risk involved, but it does allow shorting any pair given lenders are ok with it.

Since lending markets do not generate coins out of no where and entire markets don't depend on their solvency, the required collateral ratio is less strict and can be lowered from 1.75-2 to 1.1. This doesn't take incentive away from borrowing bit-assets since those have no daily fees. This mechanism allows higher leverage at cost of daily fees.

The 1.1 (only hypothetical example) collateral:debt ratio would generate the following higher leverage possibilities (but more important is further distance from liquidation for same leverage so safer leverage for users, given liquidity):

FAQ: how can you have safely more margin than collateral?
A: these steps continuously lock more collateral thus always having more value locked in collateral than unlocked at time of borrowing

FAQ: but it's too complicated to do those steps
A: could be automated letting you simply choose target leverage on a slider (1.5-4?), back calculating necessary collateral, and automatically performing 5? steps. rebuying part of each step happens at set price with limit orders. (as always market orders if it can fill existing orders). leverage slider is pretty common tool.

* This enables margin trading on any pair in any direction on top of existing mechanisms, brings lenders helping liquidity, brings traders after leverage.
* requires allowing UIA (or any) coin locks in smart contracts that monitor order books instead of feeds so no new feeds necessary. (e.g. if we get btc+more trustless gateways, can work for even those!)
* lenders decide which coin to allow lending their coin for at what lending rate, letting them choose comfortable level of risk, nor putting the platform under risk, and avoiding thinner pairs or untrustworthy assets
* requires addition of lender markets and borrowing from lenders mechanic
* could work for any coins using system similar to existing methods on the dex while backed by collateral
* allow margin trading on the dex for ANYTHING that has lending market at cost of fees with higher leverage possible than before

Universal lending and leverage markets would make it highly attractive for traders.
« Last Edit: September 09, 2017, 11:53:42 pm by moinyoin »