[Python] Price Feed Script for BitShares 2.0

Started by xeroc, October 09, 2015, 02:24:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maqifrnswa

Quote from: alt on October 16, 2015, 11:39:42 AM
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: [url="https://launchpad.net/~showard314/+archive/ubuntu/bitshares"]https://launchpad.net/~showard314/+archive/ubuntu/bitshares[/url] [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true

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

alt

here is the pull request:
https://github.com/pch957/python-graphenelib/commit/30cb48559fc1436ecf46ce64d371ca27e3b4d746

Quote from: Xeldal on October 16, 2015, 02:06:24 PM
Quote from: xeroc on October 16, 2015, 04:00:02 AM
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.

################################################################################
## 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

Quote from: xeroc on October 16, 2015, 04:00:02 AM
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.

################################################################################
## 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



alt

agree,  include the three parameters: core_exchange_factor , maintenance_collateral_ratio, short_squeeze_ratio

Quote from: abit on October 16, 2015, 12:38:42 PM
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.

maqifrnswa

Quote from: abit on October 16, 2015, 12:38:42 PM
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: [url="https://launchpad.net/~showard314/+archive/ubuntu/bitshares"]https://launchpad.net/~showard314/+archive/ubuntu/bitshares[/url] [15% delegate] wallet_account_set_approval maqifrnswa true [50% delegate] wallet_account_set_approval delegate1.maqifrnswa true

emski

Quote from: abit on October 16, 2015, 12:38:42 PM
Quote from: alt on October 16, 2015, 10:39:13 AM
Quote from: iHashFury on October 16, 2015, 09:31:41 AM
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

Quote from: bytemaster on October 15, 2015, 09:15:42 PM


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.
[url="https://bitsharestalk.org/index.php/topic,9857.0.html"]https://bitsharestalk.org/index.php/topic,9857.0.html[/url]

abit

#25
Quote from: alt on October 16, 2015, 10:39:13 AM
Quote from: iHashFury on October 16, 2015, 09:31:41 AM
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

Quote from: bytemaster on October 15, 2015, 09:15:42 PM


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.
BitShares committee member: abit
BitShares witness: in.abit

alt

totally correct, 1.5 is unreasonable, please update it
Quote from: iHashFury on October 16, 2015, 12:04:55 PM
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

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.

alt

yes, you are right.
all witness please think about it,  set short_squeeze_ratio between 1001 to 1100.

iHashFury

#21
So setting short_squeeze_ratio to 1000

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

If my noob economist calculations are correct

alt

#20
Quote from: iHashFury on October 16, 2015, 09:31:41 AM
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

Quote from: bytemaster on October 15, 2015, 09:15:42 PM


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.

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

#18
Can the new pull be disabled in the config?

I prefer a simple price feed. ( also I'm not an economist )