Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: markm on July 14, 2012, 07:36:42 PM



Title: "Shorting" altcoins
Post by: markm on July 14, 2012, 07:36:42 PM
Open Transactions (https://bitcointalk.org/index.php?topic=53329.0) development has reached a point where it is time to start figuring out how best to handle "shorting" of assets. Since I already support a number of altcoins on my server, looking into how shorting of altcoins would work seems a reasonably good idea.

Since shorting involves borrowing an asset from someone, it would seem that introducing shorting to an asset introduces a demand for loans of that asset, thus it provides people who own that asset an opportunity to earn interest by loaning it. Possibly shorting might therefore create a demand for loans of assets that hitherto no one had any desire to borrow.

How much interest are people likely to want on loans when they know the loan is going to be used to try to drive down the value of that which is loaned?

Might shorting drive up demand for an asset due to people wanting to own some to loan in order to earn interest?

Are there, for each altcoin type, people in the community who hold large numbers of that type and are willing to loan them out for shorting?

Each type of coin the server supports will of course be shortable against each other type of coin, supply of coins available to be borrowed permitting. Thus it is not only altcoins that will be short-able. You will also be able to short Bitcoins and, in general, any asset available for borrowing.

-MarkM-


Title: Re: "Shorting" altcoins
Post by: smoothie on July 14, 2012, 08:02:15 PM
Open Transactions (https://bitcointalk.org/index.php?topic=53329.0) development has reached a point where it is time to start figuring out how best to handle "shorting" of assets. Since I already support a number of altcoins on my server, looking into how shorting of altcoins would work seems a reasonably good idea.

Since shorting involves borrowing an asset from someone, it would seem that introducing shorting to an asset introduces a demand for loans of that asset, thus it provides people who own that asset an opportunity to earn interest by loaning it. Possibly shorting might therefore create a demand for loans of assets that hitherto no one had any desire to borrow.

How much interest are people likely to want on loans when they know the loan is going to be used to try to drive down the value of that which is loaned?

Might shorting drive up demand for an asset due to people wanting to own some to loan in order to earn interest?

Are there, for each altcoin type, people in the community who hold large numbers of that type and are willing to loan them out for shorting?

Each type of coin the server supports will of course be shortable against each other type of coin, supply of coins available to be borrowed permitting. Thus it is not only altcoins that will be short-able. You will also be able to short Bitcoins and, in general, any asset available for borrowing.

-MarkM-


Didn't Roger Ver just have 24k btc stolen because of lending his bitcoins out?

Once again sounds like it could start another run with people's money. I'm not saying anyone in particular. Just the concept is sketchy with btc.


Title: Re: "Shorting" altcoins
Post by: markm on July 14, 2012, 08:15:05 PM
Sure, its just that an asset is an asset. Once the capability is in the code, which asset pair it is used with is of no importance to the code.

Plus of course the ideal is to "do this right", in such a way that the only risk lies in whether the tokens you play with in the Open Transactions server (https://bitcointalk.org/index.php?topic=53329.0) will turn out to actually be convertible into "real assets" such as actual bitcoins, actual devcoins, actual groupcoins, actual litecoins, actual namecoins, actual iocoins, actual ixcoins etc.

That risk exists regardless of why one bothers to use such tokens instead of using assets directly, but properly speaking the counterparty of that risk is not the server but, rather, the issuer of each type of token.

It just happens to be the case on my server that I have not yet allowed anyone else to issue assets on my server, due to not wanting to be seen as an enabler of issuers of fraudulent/scam assets, issuers planning to fly by night with the actual assets etc etc.

So if anyone has tokens on the server they already have the risk. The question then is would they like to loan out tokens to earn interest?

-MarkM-



Title: Re: "Shorting" altcoins
Post by: smoothie on July 14, 2012, 08:23:01 PM
Sure, its just that an asset is an asset. Once the capability is in the code, which asset pair it is used with is of no importance to the code.

Plus of course the ideal is to "do this right", in such a way that the only risk lies in whether the tokens you play with in the Open Transactions server (https://bitcointalk.org/index.php?topic=53329.0) will turn out to actually be convertible into "real assets" such as actual bitcoins, actual devcoins, actual groupcoins, actual litecoins, actual namecoins, actual iocoins, actual ixcoins etc.

That risk exists regardless of why one bothers to use such tokens instead of using assets directly, but properly speaking the counterparty of that risk is not the server but, rather, the issuer of each type of token.

It just happens to be the case on my server that I have not yet allowed anyone else to issue assets on my server, due to not wanting to be seen as an enabler of issuers of fraudulent/scam assets, issuers plannign to fly by night with the actual assets etc etc.

So if anyone has tokens on the server they already have the risk. The question then is would they like to loan out tokens to earn interest?

-MarkM-



You have a point.


Title: Re: "Shorting" altcoins
Post by: markm on July 14, 2012, 08:40:42 PM
I played around with "bc", the arbitrary accuracy calculator command-line app often used from shell scripts to do calculations, to try to figure out how much a certain percent per day would be if implemented as compounding per second so that I could use unix dates (seconds since the epoch) conveniently to compute interest to the second. It turns out that calculator seems to maybe use a loop; 1.01 ^ 86400 is not a swift calculation.

I wonder if it would suffice to use hours, with any loan period being taken to be at least one full hour even if paid back before the hour is up?

Using hours and eight decimal rates (though 16 decimal calculations) I found I can get pretty close to one percent per day by setting the rate per hour, compounded hourly, to 1.00041469.

100 * (1.00041469 ^ 24) = 101.0000167764657900

One percent per day seems to be pretty much the common ceiling on interest rates lately when compounding is per whole day rather than per hour, minute or second so I am not sure whether it would be better to just use whole days, or maybe min (1, seconds div 86400), as the compounding period.

It seems offhand though that for loans that might last only a few days compounding in days instead of hours might be too "chunky" (insufficiently "granular").

-MarkM-


Title: Re: "Shorting" altcoins
Post by: ArticMine on July 14, 2012, 10:59:21 PM
Shorting Solidcoin / Microcash could be interesting. I am not sure how profitable it could be.


Title: Re: "Shorting" altcoins
Post by: markm on July 15, 2012, 12:27:12 AM
Shorting Solidcoin / Microcash could be interesting. I am not sure how profitable it could be.

Unfortunately that particular coin-type is not supported by my server and I have no plans to add it. :)

However, my server does support a bunch of coin types that are not currently running as actual blockchains on this planet, such as Britcoin, Martian Botcoin, Canadian Digital Notes, General Mining Corp, General Retirement Corp, bitNicKeLs, and so on and so on, as well as a growing number of shares. Maybe something among those might strike your fancy as worth trying to drive down in value by shorting?

GMC and GRF might be of particular interest to a number of entities, because there is a lot of well-secured debt denominated in them; the debtors would presumably love to see them driven down in price so their debts will be easier to pay back.

-MarkM-


Title: Re: "Shorting" altcoins
Post by: ArticMine on July 15, 2012, 01:48:31 AM
Thanks

To me a good short candidate is something that has some value in the marketplace and also has really lousy fundamentals. Most of what is listed on the GLBSE on the other hand falls in the area of very high risk and also very high potential return. Sure some can and will fail, but others can also skyrocket in value and the latter will kill a short in no time. I will keep my eyes open though


Title: Re: "Shorting" altcoins
Post by: markm on July 15, 2012, 05:58:29 PM
The Open Transactions server (https://bitcointalk.org/index.php?topic=53329.0) does not directly access "assets" such as bars of gold, coins on blockchains, cars on car-for-sale-lots, mansions on land somewhere and so on. So far such things are not even "smart assets" such as Mike Hearn described on the wiki. Rather, tokens are issued on the server to represent such things, and responsibility for actually backing the tokens with the real things falls upon the "issuer" of the tokens. On my server so far I am the only "issuer" so my server is not an example of the idea situation Open Transactions is designed to allow. The design allows the "issuer" function to be entirely separate from the operator of the server, by having all transactions the server performs have to be signed by a client as well as by the server. Audit functions are planned which will allow the "issuer" of an asset to check that the server is not "cheating".

To get your actual bars of gold or *coins or cars or houses or whatever the token represent though you have to "redeem" the tokens with the "issuer" or with a third party marketmaker (who basically either interfaces with the "issuer" for you or keeps the tokens circulating thus avoiding the expense of constantly "bailing in" assets to the issuer's vault and "bailing out" assets from the issuer's vault.

The issuer presumably hopes (I know I, as an issuer, do) that most of the tokens will keep circulating, reducing to a minimum the amount of bailing-in and bailing-out operations that need to be done, since bailing in and bailing out are overhead expenses, especially if they involve sending armoured cars with armed guards running around fetching assets from one place and moving them to another.

As to letting loaners lend free of charge, that is of course their choice in private deals. But to set up automated systems maintaining pools of capital for shorters (and others) to draw loans from typically some kind of itnerest rate would presumably be implemented in order to create an incentive to put your capital into such a pool. In principle a pool with no interest could be set up if in fact there were people wishing to loan without interest though. Moslems maybe would insist on no interest though possibly they may have other incentive structures that still somehow provide an incentive.

-MarkM-


Title: Re: "Shorting" altcoins
Post by: FreeMoney on July 16, 2012, 05:43:13 AM
How much interest are people likely to want on loans when they know the loan is going to be used to try to drive down the value of that which is loaned?

-MarkM-


That doesn't seem right. The borrower will have to buy back just as much as they sell.


Title: Re: "Shorting" altcoins
Post by: FreeMoney on July 16, 2012, 05:48:31 AM
I played around with "bc", the arbitrary accuracy calculator command-line app often used from shell scripts to do calculations, to try to figure out how much a certain percent per day would be if implemented as compounding per second so that I could use unix dates (seconds since the epoch) conveniently to compute interest to the second. It turns out that calculator seems to maybe use a loop; 1.01 ^ 86400 is not a swift calculation.

I wonder if it would suffice to use hours, with any loan period being taken to be at least one full hour even if paid back before the hour is up?

Using hours and eight decimal rates (though 16 decimal calculations) I found I can get pretty close to one percent per day by setting the rate per hour, compounded hourly, to 1.00041469.

100 * (1.00041469 ^ 24) = 101.0000167764657900

One percent per day seems to be pretty much the common ceiling on interest rates lately when compounding is per whole day rather than per hour, minute or second so I am not sure whether it would be better to just use whole days, or maybe min (1, seconds div 86400), as the compounding period.

It seems offhand though that for loans that might last only a few days compounding in days instead of hours might be too "chunky" (insufficiently "granular").

-MarkM-


I don't know if it helps for what you are doing but you can approximate compounding by the second with the continuous compounding compounding formula.

http://en.wikipedia.org/wiki/Compound_interest#Continuous_compounding


Title: Re: "Shorting" altcoins
Post by: markm on July 16, 2012, 06:22:42 AM
How much interest are people likely to want on loans when they know the loan is going to be used to try to drive down the value of that which is loaned?

-MarkM-


That doesn't seem right. The borrower will have to buy back just as much as they sell.

Yes, of course, but the borrower believes the asset will have a lower market price at that time, thus that they will be buying it back at a lower price than they sold it for.

-MarkM-


Title: Re: "Shorting" altcoins
Post by: markm on July 16, 2012, 06:28:08 AM
I don't know if it helps for what you are doing but you can approximate compounding by the second with the continuous compounding compounding formula.

http://en.wikipedia.org/wiki/Compound_interest#Continuous_compounding

t (time; the number of compounding periods) is still in the exponent. The problem with the "bc" calculator seems to be that it actually iterates to raise to a power. That keeps it accurate but it limits it to integer powers and makes it take longer the higher the power you want to raise a number to. There are 86400 seconds in a day and it takes quite a while to loop through that many multiplications just to work out one day's interest.

Thanks though.

I am only using "bc" right now in shell scripts, presumably Open Transactions would use some C++ library if/when it implements interest.

-MarkM-


Title: Re: "Shorting" altcoins
Post by: maaku on July 16, 2012, 06:53:32 AM
I've been using MPFR (http://www.mpfr.org/) for demurrage calculations in Freicoin. It's a software-floating point library that is deterministic and efficient (well, efficiency is relative for what it does). I don't know what your development environment is, but you can probably find a binding.


Title: Re: "Shorting" altcoins
Post by: Unthinkingbit on July 16, 2012, 07:50:36 AM
..
t (time; the number of compounding periods) is still in the exponent. The problem with the "bc" calculator seems to be that it actually iterates to raise to a power. That keeps it accurate but it limits it to integer powers and makes it take longer the higher the power you want to raise a number to. There are 86400 seconds in a day and it takes quite a while to loop through that many multiplications just to work out one day's interest.

A way to speed up exponentiation of a composite power is to exponentiate by the prime factors.

Code:
86,400 = 60 * 60 * 24 = (2 * 2 * 3 * 5) * (2 * 2 * 3 * 5) * (2 * 2 * 2 * 3) = (2 ** 7) * (3 ** 3) * (5 ** 2)

In pseudo code:

result = (interest each second) * (interest each second)
result = result * result
result = result * result
result = result * result
result = result * result
result = result * result
result = result * result

result = result ** 3
result = result ** 3
result = result ** 3

result = result ** 5
result = result ** 5

This will get the same result as (interest each second) ** 86,400; but only needs 12 operations.


Title: Re: "Shorting" altcoins
Post by: mystery2048 on July 19, 2012, 06:32:37 AM
Whats up with this project? It sounds very good, and I would definitely be interested in shorting bitcoins, litecoins, namecoins and solidcoins... :)

I think I could make huge money doing this...


Title: Re: "Shorting" altcoins
Post by: markm on July 19, 2012, 07:19:20 AM
Whats up with this project? It sounds very good, and I would definitely be interested in shorting bitcoins, litecoins, namecoins and solidcoins... :)

I think I could make huge money doing this...

Sorry, no solidcoins on my server. I don't want to get stuck holding the stupid coins to "back" the tokens traded on the server. (I don't want their code running on any of my machines.)

Where I am at so far is I have a working Open Transactions server (https://bitcointalk.org/index.php?topic=53329.0) with asset contracts set up for a bunch of coin types, and have issued some coins into it though I do not have many of most types of coins. Now that the passphrase handling system is done I am able to run market-maker scripts again so am in the process of figuring out what exactly to have those scripts buy and sell and at what prices. I have some other scripts that examine fundamentals such as the reserves each asset actually has to figure out reasonable offers; these scripts of course loop to converge on values since obviously if Martian Botcoin goes down in value and the Brits, Canadians, and United Nations each hold Martian Botcoin in their reserves the value of their reserves changes, which changes the value these scripts will ascribe to their own coins, which the Martians likely have in their reserves so those changes further change the value of the Botcoins and so on. The scripts do converge though so that is looking good so far.

I also have scripts to do basic handling of hourly compounding interest, so I can make a simple file that sets original unix-date and original debt then any time run a script to tell me current value of the debt, and the scripts for evaluating reserves can take those values into account.

I do not have yet though a simple quick easy method, suitable for applying to umpteen people without human intervention, for doing margin accounts.  My current approaches to things actually leads me to think about doing shorting not as an individual player activity at all but, rather, by creating a corp dedicated to shorting some specific thing, and let people trade shares of that corp.

There is a big lending boom ever since the General Financial Corp (https://bitcointalk.org/index.php?topic=61557.0) was formed, due to a large amount of debt that had been paying 1% per day to General Mining Corp and General Retirement Corp being made aware by General Financial Corp of the possiblity of refinancing at lower interest rates. This has resulted in a bunch of entities looking to take over such secured loans and, as an aside, start thinking about how much money they might be able to make if they can design some more forms of secured loans.

So the basic financing picture is where I am at so far, maybe looking toward large players like with the underwriter idea (https://bitcointalk.org/index.php?topic=92725).

I am still actually somewhat dubious of the whole concept of shorting, since it seems to me the loaner is only going to loan you something at a profit, thus will either charge interest more than (s)he thinks you can drive the value down or will screw you nicely by buying on the market everything you borrow as soon as you put it on the market, and could even try to buy up so much that you cannot even find anywhere enough of what you borrowed to pay them back. Remember I am operating in a paradigm of no preferential asset; there is no magic asset that "by fiat" can pay all debts public and private. If you owe someone a rarecoin and they have bought up every single rarecoin, you are screwed.

That led me to thinking maybe the mechanism for implementing shorting should include putting on the market as much as you borrow of what you borrow, to absolutely guarantee there will for sure be enough of it there for you to buy to pay back the debt.

That in turn leads to thinking you might want your contract to include a specifying of exactly what price those emergency backup assets are to sit at in the orderbook, so you know what the worst case cost is going to be.

So basically it is all very much up in the air and even looking like a possibly entirely silly concept. Maybe simply going to bets of bitcoin and betting that the price of this that or the other thing will or will not hit a certain price on a certain market by a certain date might be a much more sensible enterprise. Except that such betting maybe cannot actually move a market...

-MarkM-


Title: Re: "Shorting" altcoins
Post by: markm on July 19, 2012, 04:41:05 PM
Trust-free betting in the sense of not having to trust your counterparty should be very possible using "oracles", but you have to trust the "oracle", which is basically a "smart contract". You'd bet on what a script in the contract is going to say, with the script doing something like scrape the sports page of a certain online newspaper, or scrape the top five such newspapers to see if any three of them agree or something like that.

Open Transactions does have "smart contracts" so if those can be authorised to use a website scraper (libcurl type thing) betting on things one can predict the newspaper's format for reporting should be feasible.

If there is no delivery of the stuff you shorted you maybe aren't really shorting it; if it doesn't hit the market you are maybe really just doing some kind of option or non-delivery-future rather than a genuine "short"?

-MarkM-


Title: Re: "Shorting" altcoins
Post by: markm on July 19, 2012, 07:19:36 PM
Actually shorting something you do not own, that is, selling something you do not own, has to involve leverage to do it right now, even if the leverage is only a fraction not a multiple. Basically you have to borrow the thing you want to sell.

If you are not selling it now but in the future, I can see that maybe being able to avoid leverage (borrowing), maybe, if there is to be no guarantee that you will ever actually be able to get hold of the thing you claim you will at some future time sell.

To actually guarantee that what you will have to buy in the future will actually be available for you to buy in the future, some has to be put aside, reserved, to ensure it will be avilable for you to buy come the time you want to buy it.

However if you set up your contracts in such a way that they leave you an emergency penalty clause allowing you to pay some penalty in some other currency or asset if you fail to deliver the asset the contract is really about, then presumably this problem of whether what you will be owing will be available to you come the day your debt comes due can be sidestepped. I think in normal trading fiat comes into it for that, since all debts have to be willing to accept settlement in fiat.

I think if a system of leverage (borrowing) is set up, shorting can take care of itself. If no one is willing to loan you the thing you want to short, tough, you maybe aren't offering them enough interest on the loan, try making a better offer.

So maybe the thing we need to solve is how to secure loans of arbitrary assets by arbitrary users to arbitrary users. That sounds like something that should be possible using smart contracts. It is probably just a matter of designing a contract that both parties find agreeable.

-MarkM-


Title: Re: "Shorting" altcoins
Post by: markm on July 19, 2012, 08:06:01 PM
There is another problem when using an Open Transactions server, and that is the number of tokens actually available on that server.

For example right now there are no litecoins issued onto my server as DigiLitecoins (dLTC), only 10,000 ixcoins issued as dIXC, only 20,000 i0coins issued as dI0C, only 200 bitcoins issued as dBTC, and only 1150 namecoins issed as dNMC.

Thus the problem of not having enough available to buy to pay back what you borrowed can be very real. For example if you borrow 10,000 dIXC and short them (sell them), who-ever bought them then has the only dIXC on the server. How are you going to pay back the loan? Buy them back from the guy who bought them from you? Convince them to loan them to you to "short" again, thus making the problem worse but pushing it into the future? Or send in some actual real on the blockchain ixcoins for the server to stash away in their cold storage vault so that more dIXC can be issued onto the server?

-MarkM-


Title: Re: "Shorting" altcoins
Post by: smoothie on July 19, 2012, 09:05:28 PM
I still don't see much interest in this yet...


Title: Re: "Shorting" altcoins
Post by: markm on July 19, 2012, 09:14:35 PM
I still don't see much interest in this yet...

Maybe altcoin values aren't going down a whole lot lately or something? It seems quite possible that a lot of the interest in shorting is not really an intent to drive down the value but just to profit from the already lowering value. So maybe it is more a feature for opportunists than a feature for those who actually want to try to drive down the value of something.

Part of the interest in it on my server is from debtors. They heard that shorting can somehow sometimes drive down the price of something, which got them interested in trying to drive down the price of whatever their debts are denominated in so as to make the debts easier to pay off.

-MarkM-


Title: Re: "Shorting" altcoins
Post by: markm on September 28, 2012, 07:36:49 PM
Maybe focus on shorting "altcoins" is too limited, since really what this is about is shorting assets, where assets might represent bitcoins, altcoins, bonds, shares, gold, silver, or whatever.

I guess why I thought of altcoins was I thought shorting was kind of a way to put your money where your mouth is, thus that all the people who mouth of about this that or the other altcoin being doomed could short it.

But one could just as well short bitcoins, they too are just another asset.

I think the crucial thing needed regardless of what someone wants to short is a system for collateral, so that whatever other assets they have that they are willing to put up as collateral can be evaluated as to how much of what they want to short the loaner is willing to loan them based on the assets offered as collateral.

-MarkM-