Author Topic: [Python] Price Feed Script for BitShares 2.0  (Read 31886 times)

0 Members and 1 Guest are viewing this topic.

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
yes, you are right.
all witness please think about it,  set short_squeeze_ratio between 1001 to 1100.

my opinion is that higher could be acceptable (and actually preferred), but we are making the ratio to the wrong value (FEED instead of SWAN).
https://bitsharestalk.org/index.php/topic,19102.msg245969.html#msg245969

Since allowing a black swan is worse than allowing margin calls in an artificial short squeeze, I'd suggest a larger short_squeeze_ratio (1100). However, that number is kind of arbitrary since it isn't a function of collateralization.
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 xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I skrewed up my git repository while "cleanin up" ..
I agree with the protection and SQR to be defined by the witnesses even though I am not sure they are supposed to be the same for all markets.

Anyway. what I don't like to see is workers publishing price feeds .. even though that would make running a witness legally uncritical in most countries, it would complicated running a worker (since you now need to actually RUN somthing) + you'd have the legal problems too ..

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
here is the pull request:
https://github.com/pch957/python-graphenelib/commit/30cb48559fc1436ecf46ce64d371ca27e3b4d746

I just merged a pull request of forum member "alt" which allows to define the collateral and short squeeze ratio.
Plese update the code and add the new configuration parameters

I'm not seeing any new parameters.

Code: [Select]
################################################################################
## Fine tuning
################################################################################
discount                 = 0.995
core_exchange_factor     = 1.05 # 5% surplus if paying fees in bitassets

minValidAssetPriceInBTC  = 0.00001
change_min               = 0.5

## Enable exchanges

Xeldal

  • Guest
I just merged a pull request of forum member "alt" which allows to define the collateral and short squeeze ratio.
Plese update the code and add the new configuration parameters

I'm not seeing any new parameters.

Code: [Select]
################################################################################
## Fine tuning
################################################################################
discount                 = 0.995
core_exchange_factor     = 1.05 # 5% surplus if paying fees in bitassets

minValidAssetPriceInBTC  = 0.00001
change_min               = 0.5

## Enable exchanges


Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
agree,  include the three parameters: core_exchange_factor , maintenance_collateral_ratio, short_squeeze_ratio

Thanks for the info.
However I don't think this parameter should be DECIDED by witnesses, it's better to be set as a system parameter, and adjustable by committee proposals.

Offline maqifrnswa

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Thanks for the info.
However I don't think this parameter should be DECIDED by witnesses, it's better to be set as a system parameter, and adjustable by committee proposals.

Agree, in the "separation of powers,"
  • Witnesses are supposed to be economically dumb but technically literate system administrators
  • Committee members are supposed to balance economics and system performance
  • Proxies are well informed members of the community
  • Workers are technical experts in the system

this seems like a role for committee members to suggest and users to approve. Witnesses shouldn't be held accountable for their decisions on network parameters.
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 emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
Can the new pull be disabled in the config?

I prefer a simple price feed. ( also I'm not an economist )
As a witness, you must understand the market engine. a bad parameter will break the peg.
All witness must publish these parameters,
My suggest is set short_squeeze_ratio between 1001 to 1100. this parameter is very important,
when it's 1100
SQP   = FEED / 1.1
when it's 1050
SQP = FEED /1.05



A margin call will occur any time the highest bid is less than the CALL PRICE and greater than SQP

FEED = Settlement Price
SWAN = DEBT / COLLATERAL  - the point at which the network is insolvent.
CALL   = SWAN * 1.75
SQP   = FEED / 1.5

1.75 and 1.5 are specified as two parameters to the price feed. 

If you would like the feed to provide additional protection to the shorts, then ask the witnesses to adjust their feed publishing scripts to use SQP of FEED / 1.1.

Just beware that the consequence of protecting the shorts against thin markets is the following:

1. Shorts will end up posting less collateral
2. Greater dependence upon the feed vs the market
3. If there are no bids above the SQP price then margin will not get called even if the Feed Price is below the Call price.
Thanks for the info.
However I don't think this parameter should be DECIDED by witnesses, it's better to be set as a system parameter, and adjustable by committee proposals.
+1
Witnesses should have no control over this parameter.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Can the new pull be disabled in the config?

I prefer a simple price feed. ( also I'm not an economist )
As a witness, you must understand the market engine. a bad parameter will break the peg.
All witness must publish these parameters,
My suggest is set short_squeeze_ratio between 1001 to 1100. this parameter is very important,
when it's 1100
SQP   = FEED / 1.1
when it's 1050
SQP = FEED /1.05



A margin call will occur any time the highest bid is less than the CALL PRICE and greater than SQP

FEED = Settlement Price
SWAN = DEBT / COLLATERAL  - the point at which the network is insolvent.
CALL   = SWAN * 1.75
SQP   = FEED / 1.5

1.75 and 1.5 are specified as two parameters to the price feed. 

If you would like the feed to provide additional protection to the shorts, then ask the witnesses to adjust their feed publishing scripts to use SQP of FEED / 1.1.

Just beware that the consequence of protecting the shorts against thin markets is the following:

1. Shorts will end up posting less collateral
2. Greater dependence upon the feed vs the market
3. If there are no bids above the SQP price then margin will not get called even if the Feed Price is below the Call price.
Thanks for the info.
However I don't think this parameter should be DECIDED by witnesses, it's better to be set as a system parameter, and adjustable by committee proposals.
« Last Edit: October 16, 2015, 12:43:56 pm by abit »
BitShares committee member: abit
BitShares witness: in.abit

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
totally correct, 1.5 is unreasonable, please update it
My economist first statement!

The short_squeeze_ratio is a mechanism to allow for the spread between bid and ask and help prevent forced settlement.

iHashFury

  • Guest
My economist first statement!

The short_squeeze_ratio is a mechanism to allow for the spread between bid and ask and help prevent forced settlement.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
yes, you are right.
all witness please think about it,  set short_squeeze_ratio between 1001 to 1100.

iHashFury

  • Guest
So setting short_squeeze_ratio to 1000

SQP   = FEED / 1 = old feed price = no short_squeeze projection

If my noob economist calculations are correct
« Last Edit: October 16, 2015, 11:05:26 am by iHashFury »

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
Can the new pull be disabled in the config?

I prefer a simple price feed. ( also I'm not an economist )
As a witness, you must understand the market engine. a bad parameter will break the peg.
All witness must publish these parameters,
My suggest is set short_squeeze_ratio between 1001 to 1100. this parameter is very important,
when it's 1100
SQP   = FEED / 1.1
when it's 1050
SQP = FEED /1.05



A margin call will occur any time the highest bid is less than the CALL PRICE and greater than SQP

FEED = Settlement Price
SWAN = DEBT / COLLATERAL  - the point at which the network is insolvent.
CALL   = SWAN * 1.75
SQP   = FEED / 1.5

1.75 and 1.5 are specified as two parameters to the price feed. 

If you would like the feed to provide additional protection to the shorts, then ask the witnesses to adjust their feed publishing scripts to use SQP of FEED / 1.1.

Just beware that the consequence of protecting the shorts against thin markets is the following:

1. Shorts will end up posting less collateral
2. Greater dependence upon the feed vs the market
3. If there are no bids above the SQP price then margin will not get called even if the Feed Price is below the Call price.
« Last Edit: October 16, 2015, 11:41:10 am by alt »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
git reset 0ac7697

I recommend every witness publishing a price feed informs themsselves about the consequences of posting their prices feeds:
https://bitsharestalk.org/index.php/topic,19102.msg245609.html#msg245609

iHashFury

  • Guest
Can the new pull be disabled in the config?

I prefer a simple price feed. ( also I'm not an economist )
« Last Edit: October 16, 2015, 09:33:32 am by iHashFury »