Author Topic: BitShares X Status Update  (Read 260988 times)

0 Members and 1 Guest are viewing this topic.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
About the division.
Division come from the transactions fee which are destroyed.
For example:
I have 100 xts,  the destroyed fee is 10000 xts, so my wallet will display 100 * 400/399 to me.
to be clear, I call the unit yts, I have 400 * 400/399 yts.
so all my operation should based on yts. I buy 1 yts, sell 1 yts, transfer 1 yts .....

Here is the question:
At the beginning(total 400 milion xts), I give an order: buy 1000 usd with my 1 yts. It's not matched. my balancce is:
99 yts can be use
1 yts claimed by sell for 1000 usd

Now the total xts is 399 million. my balance should be
100*400/399 - 1 yts can be use
1 yts claimed by sell for 1000 usd

So all the unit used in order_match() should based yts. include margin_call()
maybe all the asset in the code based unit xts should changed to yts

BTS网络可以赚取交易费盈利,从而给所有持有 xts  者分红。
所有被直接销毁的交易费就是BTS网络赚取的利润,因为xts总量减少,所以每个xts相对升值了。
客户端钱包显示的用户xts余额,实际上是 xts 数量*400万/(400万-总的销毁交易费)。为便于描述,我把单位定义为 yts吧。

下面问题就来了

比如我最开始挂了个单子,卖 1yts,换 1000 usd。这个单子一致没成交。现在 xts 分红了,总量只有399万了。
我这个卖单是继续 1yts 换 1000 usd,还是变成  400/399 yts 换100usd?
现在的代码中会按 400/399 yts 卖出去。就是把本该属于我的分红,通过降价转移到了买家那里。

经过和网友们讨论,yidaidaxie给出了一个方案,在成交算法中要考虑到分红。多出的 yts应退还给我。

除了成交算法,强制平仓里面也应该考虑这个因素,不要忽略分红导致的 xts 增值。
« Last Edit: February 19, 2014, 02:04:32 am by alt »

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
ETA on testnet with p2p and TAPOS?

Monday.    It is currently working in my local tests, but I want to do a few more tests before launching it for more people.

drumroll...
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline bytemaster

Today was spent handling other tasks and tomorrow we are having a company wide meeting focused on learning and putting into practice the concepts of David Allen, http://www.swissviet.com/Getting_Things_Done.pdf  which comes highly recommended by Brian Page.  Having seen how Brian gets things done I am very excited to learn his techniques.

Our workload is so high and the number of things going on in parallel is beyond anything I have dealt with in my life to date, so I am looking forward to streamlining my productivity and focus along with the rest of our management team.   
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
I assume on Feb 28th the BTS X will not have a graphic user interface,  right? Although a friendly UI will absolutely stir the market more.

gui is secondary to widespread adoption. I think the idea is web based exchanges (for those that don't/can't/won't mess with their own wallets) and possible several different guis (some by I3 some by others). IF the backend is versatile and powerful enough, releasing a gui won't matter since someone will probably develop a better platform.
maintains an Ubuntu PPA: https://launchpad.net/~showard314/+archive/ubuntu/bitshares [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true

Offline ripplexiaoshan

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 2300
    • View Profile
  • BitShares: jademont
I assume on Feb 28th the BTS X will not have a graphic user interface,  right? Although a friendly UI will absolutely stir the market more.
« Last Edit: February 18, 2014, 04:43:50 am by ripplexiaoshan »
BTS committee member:jademont

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
I prefer another way for this position:
the order claim by long will not include by  match progress ,
until it  goes to next two block.(10 minutes or more)

Imagine this:
there is no one buy order in market at this moment.
If someone short 1 bts with 1billion usd(much lower then bitusd price...)
the buyer will see it, they have 10 minutes to decide what to do.
I think the marketing will give the short order a correct price.


this is not enough.
It can't work at the beginning, just 2 order:
buy 10000000 usd   with 1bts
short 10000000 usd with 1bts

so we should add two limit:
1. matching_order for claim_long only work when  buy order  is enough
2. can't short  with price  low than current price


Offline willj

  • Newbie
  • *
  • Posts: 17
    • View Profile
 :o

On knowing the sell about 1_bts for 10000000 USD, I am shocked.
And I think there must be something wrong.

I read the white paper, but just understand a little.
Here share the logic in my head. It maybe totally wrong.  :-[

------------------------
If no rule, the bitUSD is not USD, it is just a name.
It can be anything: cheap as DOGE, or expensive as 42Coin.

So there must be the rule:
You can create your BTA named bitAAA or bitXYZ, named anything.
But when you create BTA named bitUSD, it must equal to the real time USD value.
When you create BTA named bitBTC, it must equal to the real time BTC value.

So the BitShareX system already has the BTS with real time value.
If you want play in BitShareX, you must put in real USD or real BTS or real BTC.

How to put USD in/out BitShareX system ?
one method is using the public market(e.g. Bter);
Or using BTS_prepaid_code(e.g. BTER-code or BTCC-code or telephone recharge coupon) can buy with USD from the on-line/off-line shops

Then the game is starting: suppose USD==1 BTC==1000 BTS==100
UserA want buy 2 BTC
UserB want sell 2 BTC
UserC want keep 20 BTS

UserA checkin 2000_USD get 20_BTS; BitShareX increase 2000_bitUSD;
UserA use 20_BTS to buy 2_bitBTC.
UserA checkout 2_bitBTC get 2_BTC.

UserB checkin 2_BTC get 20_BTS, BitShareX increase 2_bitBTC;
UserB use 20_BTS to buy 2000_bitUSD.
UserB checkout 2000_bitUSD get 2000_USD.

UserC checkin 2000_USD get 20_BTS; BitShareX increase 2000_bitUSD;
1 year later, BTS==10,000;
UserB use 20_BTS to buy 200,000_bitUSD.
UserB checkout 200,000_bitUSD get 200,000_USD :)
 :)
------------------------

Offline crazybit

2 issues seems are identified in margin call algorithm, please find the detail in highlighted below, not sure if i misunderstood the logic,please correct me if so.

issue 1:
Quote
                  if( payoff > bid_usd )
                         { // consume the full bid, leaving a balance on the call
                            loan_amount         += bid_usd;
                            collateral_amount   += bid_usd * call_price;// line 474 of blockchain_db.cpp,why not double collateral in this short position?half from long bid, half from cover, should be bid_usd * call_price+bid_usd * call_price?

                            working_call.amount -= bid_usd * call_price;
                            cover_claim.payoff  -= bid_usd;

                            // add bid as input, and give the bidder their new cover position
                            market_trx.inputs.push_back( bid_itr->location );
                            market_trx.outputs.push_back(
                                       trx_output( claim_by_cover_output(loan_amount, bid_payout_address), collateral_amount) );
                            collateral_amount = asset();
                            loan_amount = asset( 0.0, quote );

                            // goto next bid
                            ++bid_itr;
                            if( bid_itr != bids.rend() ) working_bid = get_output( bid_itr->location );
                         }

issue 2:
Quote
else // payoff == bidusd
                         { // consume full call and bid..
                            auto cover_amount    = bid_usd * call_price;
                            loan_amount         += bid_usd;
                            collateral_amount   += cover_amount + cover_amount; // collat from bid+cover
                            working_call.amount -= cover_amount;

                            market_trx.outputs.push_back(
                                       trx_output( claim_by_cover_output( loan_amount, bid_payout_address ), collateral_amount) );
                     //line 521 of blockchain_db.cpp ,why needn't reset the variables collateral_amount and loan_amount after pushing short position output,won't it cause the incorrect output in next round  matching, is following code required?
                            collateral_amount = asset();
                            loan_amount = asset( 0.0, quote );

                           
                            if( working_call.amount.get_rounded_amount() > 0 )
                            {
                               // TODO.. charge a 5% fee
                               market_trx.outputs.push_back(
                                       trx_output( claim_by_signature_output( cover_claim.owner ), working_call.amount ) );
                            }

                            market_trx.inputs.push_back( call_itr->location );
                            market_trx.inputs.push_back( bid_itr->location );

                            ++bid_itr;
                            if( bid_itr != bids.rend() ) working_bid = get_output( bid_itr->location );

                            ++call_itr;
                            if( call_itr != margin_positions.end() )
                            {
                               working_call = get_output( call_itr->location );
                               cover_claim  = working_call.as<claim_by_cover_output>();
                            }
                         }
« Last Edit: February 17, 2014, 12:31:32 pm by CrazyBit »

Offline 天籁

  • Hero Member
  • *****
  • Posts: 744
    • View Profile
In Bitshares X, Bitusd is designed to anchoring USD. While BTS already exists in the system, the first Bitusd will appear if and only if someone likes to buy it with 1 USD in currency exchange interface. So, the number of Bitusd is finite ( from small to large as time goes and cash inflows increases). No one would like to use his Bitusd (equivalent to real money) to buy 1 BTS with ceiling price such as alt listed, 10**10Bitusd,otherwise he would lost all. In conclusion, There will not be hundreds of millions of unsecured Bitusd.
[/quote]

The individual who found the issue should receive the 23 pts and an interpreter should get 2 pts...  let me know who should get what.
[/quote]

Offline ppimp

  • Newbie
  • *
  • Posts: 15
    • View Profile
Dan/Invictus Team,
 Can you provide a short summary of how the 3 million per month quoted for funding will be spent to develop Bitshares X?

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
I have an idea about margin call.
For example, I short 1000 usd with 2bts  backing.
when the price is up to 1000 usd /1.5  bts, margin call excute.
forced  execute  a buy order: buy 1000 usd with price 1000usd/1.5bts.
this buy order can not be cancel.
and 5% fee of bts will assessed.

the one who hold bitusd have two choice: sell bitusd with 1000usd/1.5bts, or hold continue to sell for more high price.

From this we can avoid to create bitusd with no backing.

Offline bytemaster

Today I implemented the code necessary to initialize the genesis block from the .json files being produced by this bounty: https://bitsharestalk.org/index.php?topic=2869.0
I implemented the output type required to claim based upon PTS or BTC addresses.
I fixed the bugs in the encrypted wallet loading and improved robustness of saving wallet data.

Tomorrow I will have the wallet import private keys using the various utility methods that have been produced by bounties and then display the starting balances as well as add the ability to spend BTC and PTS balances. 

Then I have to look into the issue identified by Alt regarding short sell positions. 

We are laying the groundwork for broad unit testing and nightly builds of all of our products so things should be more accessible to everyone by the end of the month.

For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline 天籁

  • Hero Member
  • *****
  • Posts: 744
    • View Profile
自己钻牛角尖了,死不承认。

No, It's not the business about real USD.

bytemaster,now you would like to send me 25 PTS,or 23PTS and 2PTS to some Interpreter.

alt又把人绕进去了,变成先鸡生蛋还是先蛋生鸡的问题了。

很简单。其实,只要系统强制要求BTA必须按与当时实物A价格挂钩的方法,规定用法币在系统外或系统本身设置的接口兑换取得BTA,系统内BTA数量是有限的(从小到大)。这样,没人会拿用真金白银买到的BTA出过高的价格买你的天价BTS,更不会出现所说的上亿个无抵押BTA。BTS是系统内已有的(也是有成本的),BTA是外来的(不是凭空产生的,而是用法币买的),alt推论的前提不成立,推理无立足点,结论自然错了。


Offline 天籁

  • Hero Member
  • *****
  • Posts: 744
    • View Profile
没人翻译吗?12小时后我自己来。

bytemaster,now you would like to send me 25 PTS,or 23PTS and 2PTS to some Interpreter.

alt又把人绕进去了,变成先鸡生蛋还是先蛋生鸡的问题了。

很简单。其实,只要系统强制要求BTA必须按与当时实物A价格挂钩的方法,规定用法币在系统外或系统本身设置的接口兑换取得BTA,系统内BTA数量是有限的(从小到大)。这样,没人会拿用真金白银买到的BTA出过高的价格买你的天价BTS,更不会出现所说的上亿个无抵押BTA。BTS是系统内已有的(也是有成本的),BTA是外来的(不是凭空产生的,而是用法币买的),alt推论的前提不成立,推理无立足点,结论自然错了。

Quote
current price is 1000usd/bts

here is the buy order:
buy 1000 usd with 1bts
buy 1001 usd with  1bts
buy 1002 usd with 1bts
.....
buy 1100 usd with 1bts

anytime I can give a buy order with
buy 1000000000 usd with 1bts
And I can give a short with
short 10000000000 usd with 1bts

So there is a line of people each wanting to buy about 1000 usd for 1 bts ....
And along comes someone who wants to sell 1000,0000 usd for 1 bts....

Assuming he actually had this usd (ie it was a long/long sale) then the market should match him against all of the buys (4103 usd), give the seller his .0001 bts and earn 3.999 bts in fees for the network because the seller was an idiot and sold way below market.   

Now in the event of a short position the result of this move should be...

Buyers get 4103 usd and the short seller ends up short -4103 with collateral of 4 bts (from buyers) + .0001 bts (from himself) which would seem to justify a margin call immediately... thus  I need to adjust the short-sell code to always use the price of the bids to determine required collateral (bts) or this kind of abuse could carry on.

Let me look into it a tad more and if it pans out I will send 25 PTS your way for finding this.

The individual who found the issue should receive the 23 pts and an interpreter should get 2 pts...  let me know who should get what.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi

Can't build on linux now:
filesystem.cpp|415 col 44| error: ‘home_dir’ was not declared in this scope

don't know if it's ok to use QApplication::applicationDirPath()  in  bts_wallet/main.cpp

No, bts_wallet is free of Qt. 

Update fc from github.
Got it, thx