Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - moinyoin

Pages: [1]
1
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.

now
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.


tldr:
* 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.

2
General Discussion / sidechains and trustless gateways
« on: August 01, 2017, 10:56:56 am »
I saw old discussions about sidechains but couldn't find a new one and I think this is incredibly important for dex to have.

The DEX looks fantastic and has been doing really well as I summarized in this bitcointalk thread: https://bitcointalk.org/index.php?topic=1949828.0

Two major developments recently:
1) EOS coming out which much benefit possible for connecting DEX to it
2) Bitcoin got segwit making atomic swaps and sidechains easier

With EOS there are 2 major paths: (1) move to EOS and make it work or (2) sidechain to EOS and create basically trustless gateways

Additionally, the only criticism there is for bitshares is that gateways are trusted, so providing (2) sidechain bridges would be incredibly important for other coins like BTC as well even if (1) is done.

What I'm saying is instead of trusting openledger to return real BTC for open.BTC there could be drivechain / atomic swaps to trade between BTC and sidechain.BTC assets so people wouldn't have to worry about openledger gateway being solvent or around next year to redeem.

Atomic swaps: https://themerkle.com/what-is-an-atomic-swap/
Drivechain: http://www.truthcoin.info/blog/drivechain/

Imagine use of slow atomic swaps to load coins onto the dex in trustless manner while then having full trustless ultra high transaction capabilities of the bts DEX.

Potential collaboration with blocknet? They could be added as a trustless gateway as they are slowly adding coins to their collection. Currently they work with QTUM, DGB, PIVX, NMC, DOGE, MUE, VTC, SYS, LTC, DYN, DASH, VIA, and I'm guessing BTC after segwit is next. They are experts in atomic swaps, bts are experts in trustless fiat pegged assets, speed, and dex.
 
They think it's a great idea and they have the most experience with atomic swaps: https://twitter.com/The_Blocknet/status/890890575452491776



I see 2 main initial candidates for sidechains as priority: BTC (w/ segwit) and STEEM

1. BTC would introduce the broadest network effect allowing people to basically use BTS DEX as their wallet and pay in BTC for anything they want anywhere BTC is accessible. This would help people transition into sending around sidechain.BTC on bts chain instead of BTC network. This would be similar in concept to how people think rsk will evolve. Having trustless BTC/bitUSD market would be incredible that's easily redeemable.

2. STEEM is closest thing to EOS on livenet right now and would show if sidechain to it or EOS is practical. BTS devs have very good native understanding of both blockchains and would be best positioned to take advantage of it. Even if some graphene projects port to EOS, sidechain knowledge could come in useful for those that do not.


How to fund?

Can someone with technical understanding of bts side make at least a research proposal into this as a worker? It makes sense, right?

If getting uncertain project funded is issue, alternative would be to at least fund early research into it from volunteer donations (like others do but using DEX) with an asset sold from a multisig account in hands of active bigshots here putting up a sell wall like RNDSIDECHAIN1 vs bitUSD and using those funds to pay researcher(s) in weekly increments.

Being universal hub for trade for bitshares would be essential, but whether it's on EOS or on BTS, connecting to other blockchains in trustless manner is a must have imo.

What are your thoughts?

Pages: [1]