Author Topic: Leveraged Trade  (Read 2844 times)

0 Members and 1 Guest are viewing this topic.

Offline monsterer

In my mind I thought that it could be implemented as a market for an interest rate on an asset borrowed for a certain amount of time(second, minute, hour, day, whatever) coupled with the ability to lock funds in protocol based on the loan contract.

Indeed this is the more correct way to do it. I think they are just discussing how to achieve a similar effect very quickly.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline Jansky

  • Newbie
  • *
  • Posts: 11
    • View Profile
In my mind I thought that it could be implemented as a market for an interest rate on an asset borrowed for a certain amount of time(second, minute, hour, day, whatever) coupled with the ability to lock funds in protocol based on the loan contract.

Offline tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
x is the price of another token/asset ...
n is a parameter for your newly created "derivative" (literally)
F is the "derivative":

F = log(x^n) = n*log(x)

log can be of any base

Then, there is an approximation that states

n*log(x) = log(n*x)    // for small x

Let's say x_0 is the initial price, then we get

F(x_0) = n*log(x_0)

if the price moves by 1%, we get:   x_0*1.01 and the derivatives becomes

F(x_0*1.01) = n*log(x_0*1.01)  = (approximation)  log(n*x_0*1.01) = log(n*x_0) + log(1.01) = F(x_0) + log(1.01)  (!!! note the PLUS over here!!! )

Hence:
- log creates a non-linear mapping of x -> F(x)
- n is a scaling factor which allows for fine-tuning

ohh you mean if n=2, this does not represent 2x leverage. For some reason I read it like that. Now  rereading it  really does not say so, and I came up with this on my own.
Thanks.
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline monsterer

So I guess you guys are saying that if the feed price was scaled by, say 2 times, it's conceptually similar to having 2 x leverage, but not exactly in practice?
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
x is the price of another token/asset ...
n is a parameter for your newly created "derivative" (literally)
F is the "derivative":

F = log(x^n) = n*log(x)

log can be of any base

Then, there is an approximation that states

n*log(x) = log(n*x)    // for small x

Let's say x_0 is the initial price, then we get

F(x_0) = n*log(x_0)

if the price moves by 1%, we get:   x_0*1.01 and the derivatives becomes

F(x_0*1.01) = n*log(x_0*1.01)  = (approximation)  log(n*x_0*1.01) = log(n*x_0) + log(1.01) = F(x_0) + log(1.01)  (!!! note the PLUS over here!!! )

Hence:
- log creates a non-linear mapping of x -> F(x)
- n is a scaling factor which allows for fine-tuning

Offline tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
What is log (x)?  So, x is supposedly being the price.[leaving aside that this does not work with prices <=1]
what is log (d%)?


----
price = 5 ; log (5) = 0.69897

1% increase; 1.01*5=5.05; log(5.05) = 0.70329

 log(5.05) / log (5) = 1.006180




I definitely got some part of this post wrong. Which one?
« Last Edit: December 11, 2015, 12:48:33 am by tonyk »
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline theoretical

If you create an asset A and set the price feed of A to be a function F(x) of the price x of some other asset like

Code: [Select]
F(x) = x^n

then how many percent does F(x) move for a given percent movement of x?

Code: [Select]
log(F) = n*log(x)

So a d% gain in x will increase log(x) by log(d%) which will increase log(F) by n*log(d%), which is nearly log(n*d%) for small d, i.e. a 1% gain in X will lead to an approximately n% gain in F(x) -- and likewise a 1% loss will lead to an approximately n% fall in F(x):

Code: [Select]
log(F) = log(x) + log(1%)

Effectively A has the same gain/loss profile as borrowing money to invest in the underlying, then borrowing / repaying on the loan as needed to maintain the same leverage continuously as the price of underlying moves, without actually requiring any actual loan to take place.

There are a couple problems:

  • A black swan is easier to happen in A than in an asset that tracks the underlying directly
  • You have to find a counterparty who wants to invest in the opposite market at the same leverage ratio you do, which may be a very thin market for some pairs
  • The new asset may need its own marketing independent of the underlying asset (especially if they have different feed providers)

Having a way for the system to automatically compute these derived feeds was on my wishlist for Graphene, but nobody seemed to care much about implementing leverage this way.
« Last Edit: December 10, 2015, 04:19:52 pm by theoretical »
BTS- theoretical / PTS- PZxpdC8RqWsdU3pVJeobZY7JFKVPfNpy5z / BTC- 1NfGejohzoVGffAD1CnCRgo9vApjCU2viY / the delegate formerly known as drltc / Nothing said on these forums is intended to be legally binding / All opinions are my own unless otherwise noted / Take action due to my posts at your own risk

Offline eagleeye

  • Hero Member
  • *****
  • Posts: 931
    • View Profile
thanks
Thanks for posting your feedback :)

I understand Cryptonomex is delivering margin trading in in the next few months.

I follow these forums very closely and I have not heard that they will be delivering margin trading/bond market any time in the near future.

It sounds like stealth transactions are first and that isn't scheduled to be done until mid February


Thanks for the info.  I do think that implementing those features [capital market, leveraged trading] would help drive adoption substantially, and would be fairly straightforward to implement.  Bringing traders to the yard would be a good thing.  I for one would like to lend out my parked funds to traders for a yeild.  Also I'd really like to buy at the market and place stop orders (without writing scripts to do so)  any plans to implement this in the UI?

I agree with you.  Margin trading and a loan market are very important.

Offline Jansky

  • Newbie
  • *
  • Posts: 11
    • View Profile
thanks
Thanks for posting your feedback :)

I understand Cryptonomex is delivering margin trading in in the next few months.

I follow these forums very closely and I have not heard that they will be delivering margin trading/bond market any time in the near future.

It sounds like stealth transactions are first and that isn't scheduled to be done until mid February


Thanks for the info.  I do think that implementing those features [capital market, leveraged trading] would help drive adoption substantially, and would be fairly straightforward to implement.  Bringing traders to the yard would be a good thing.  I for one would like to lend out my parked funds to traders for a yeild.  Also I'd really like to buy at the market and place stop orders (without writing scripts to do so)  any plans to implement this in the UI?

Offline carpet ride

  • Hero Member
  • *****
  • Posts: 544
    • View Profile
Thanks for posting your feedback :)

I understand Cryptonomex is delivering margin trading in in the next few months.

I follow these forums very closely and I have not heard that they will be delivering margin trading/bond market any time in the near future.

It sounds like stealth transactions are first and that isn't scheduled to be done until mid February

I'm going to default to your recollection then.  I must be remembering something that was said in a mumble session about polo-style margin trading being easy enough to implement.  good thing I can proxy my votes. ...
All opinions are my own. Anything said on this forum does not constitute an intent to create a legal obligation between myself and anyone else.
Check out my blog: http://CertainAssets.com
Buy the ticket, take the ride.

Offline lil_jay890

  • Hero Member
  • *****
  • Posts: 1197
    • View Profile
Thanks for posting your feedback :)

I understand Cryptonomex is delivering margin trading in in the next few months.

I follow these forums very closely and I have not heard that they will be delivering margin trading/bond market any time in the near future.

It sounds like stealth transactions are first and that isn't scheduled to be done until mid February

Offline carpet ride

  • Hero Member
  • *****
  • Posts: 544
    • View Profile
Thanks for posting your feedback :)

I understand Cryptonomex is delivering margin trading in in the next few months.
All opinions are my own. Anything said on this forum does not constitute an intent to create a legal obligation between myself and anyone else.
Check out my blog: http://CertainAssets.com
Buy the ticket, take the ride.

Offline Jansky

  • Newbie
  • *
  • Posts: 11
    • View Profile
I like BTS 2.o :-)

is there a way to open a leveraged trade?  I really want bts to be Bitfinex lol, is there a plan to implement loans?