|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.commerce.zocalo.market.Market
public abstract class Market
a Market in a claim; always supports book orders, sometimes supports a marketMaker. Responsibilities include reporting on price levels and book contents as well as buying claims.
Field Summary | |
---|---|
protected Price |
maxPrice
|
Method Summary | |
---|---|
Price |
asPrice(java.math.BigDecimal decimal)
|
Price |
asPrice(Quantity q)
|
protected abstract void |
buyAtMarketPrice(Position pos,
Price price,
Quantity quantity,
User user)
|
protected abstract void |
buyOrAddBookOrder(Position pos,
Price price,
Quantity quantity,
User user)
|
abstract Quantity |
buyWithCostLimit(Position position,
Price price,
Quantity costLimit,
User user,
boolean isBuy)
|
void |
close()
|
Price |
currentPrice(Position position)
|
Probability |
currentProbability(Position position)
|
Quantity |
decideClaimAndRecord(Position pos)
|
java.lang.String |
describeOutcome()
|
protected boolean |
gateKeeper(Position pos,
Price price,
Quantity quantity,
User user,
boolean marketOrder)
|
Book |
getBook()
|
abstract Claim |
getClaim()
|
java.util.Date |
getLastTrade()
|
Price |
getMaxPrice()
Deprecated. |
java.lang.String |
getName()
|
Outcome |
getOutcome()
Deprecated. |
User |
getOwner()
|
boolean |
hasMaker()
|
boolean |
identifyCouponBank(CouponBank bank)
|
boolean |
isOpen()
|
void |
limitOrder(Position pos,
Price price,
Quantity quantity,
User user)
buy TOTALQUANTITY of coupons, while not raising the price above PRICE. |
abstract void |
marketCallBack(MarketCallback callback)
|
void |
marketOrder(Position pos,
Price price,
Quantity quantity,
User user)
buy TOTALQUANTITY of coupons, while not raising the price above PRICE. |
abstract Price |
maxPrice()
|
Quantity |
mintBalance()
|
void |
open()
|
Probability |
outcome(Position pos)
|
boolean |
outcomeIsContinuous()
|
Coupons[] |
printNewCouponSets(Quantity quantity,
Funds bothFunds)
|
abstract void |
recordBookTrade(User acceptor,
Price price,
Quantity quantity,
Position position)
|
abstract void |
recordLimitTrade(Order order,
Quantity quantityTraded,
Position position)
|
Quantity |
requiredReserves(User user)
|
boolean |
requireReserves()
|
void |
resetBook()
|
Price |
scaleToPrice(Quantity price)
|
void |
sellHoldings(User user,
Position position)
|
abstract void |
setClaim(Claim claim)
|
abstract void |
setMaker(MarketMaker mm)
|
void |
setMaxPrice(Price maxP)
Deprecated. |
void |
setOutcome(Outcome outcome)
Deprecated. |
void |
setOwner(SecureUser owner)
Deprecated. |
void |
setRequireReserves(boolean requireReserves)
Deprecated. |
protected void |
setReserveVerifier(ReserveVerifier reserveVerifier)
|
Accounts |
settle(Quantity quantity,
java.util.Map couponsMap)
|
void |
setWholeShareTradingOnly()
|
boolean |
verifyPriceRange(Quantity price)
|
protected boolean |
verifyReserves(User user,
Position pos,
Price price,
Quantity quantity)
|
boolean |
wholeShareTradingOnly()
|
void |
withholdReserves(Order order,
Quantity quantity,
Position position)
|
protected void |
withholdReserves(User user,
Quantity quantityPurchased,
Position pos)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Price maxPrice
Method Detail |
---|
public Book getBook()
public Probability currentProbability(Position position)
public Price currentPrice(Position position)
public java.lang.String getName()
public abstract void setClaim(Claim claim)
public abstract Claim getClaim()
public abstract void setMaker(MarketMaker mm)
public abstract void recordLimitTrade(Order order, Quantity quantityTraded, Position position)
public abstract void recordBookTrade(User acceptor, Price price, Quantity quantity, Position position)
public abstract Price maxPrice()
public boolean verifyPriceRange(Quantity price)
public Price asPrice(Quantity q)
public Price asPrice(java.math.BigDecimal decimal)
public Price scaleToPrice(Quantity price)
public boolean hasMaker()
public void limitOrder(Position pos, Price price, Quantity quantity, User user) throws DuplicateOrderException
DuplicateOrderException
public void marketOrder(Position pos, Price price, Quantity quantity, User user)
protected abstract void buyAtMarketPrice(Position pos, Price price, Quantity quantity, User user)
protected abstract void buyOrAddBookOrder(Position pos, Price price, Quantity quantity, User user) throws DuplicateOrderException
DuplicateOrderException
protected boolean gateKeeper(Position pos, Price price, Quantity quantity, User user, boolean marketOrder)
public abstract Quantity buyWithCostLimit(Position position, Price price, Quantity costLimit, User user, boolean isBuy)
public void sellHoldings(User user, Position position)
public void close()
public void open()
public boolean isOpen()
public void resetBook()
public java.util.Date getLastTrade()
public Accounts settle(Quantity quantity, java.util.Map couponsMap)
public Coupons[] printNewCouponSets(Quantity quantity, Funds bothFunds)
public Quantity decideClaimAndRecord(Position pos)
public void setWholeShareTradingOnly()
public boolean wholeShareTradingOnly()
public boolean requireReserves()
protected void withholdReserves(User user, Quantity quantityPurchased, Position pos)
public void withholdReserves(Order order, Quantity quantity, Position position)
protected boolean verifyReserves(User user, Position pos, Price price, Quantity quantity)
public Quantity requiredReserves(User user) throws ScoreException
ScoreException
protected void setReserveVerifier(ReserveVerifier reserveVerifier)
public void setRequireReserves(boolean requireReserves)
public User getOwner()
public void setOwner(SecureUser owner)
public Outcome getOutcome()
public void setOutcome(Outcome outcome)
public boolean identifyCouponBank(CouponBank bank)
public Quantity mintBalance()
public Probability outcome(Position pos)
public boolean outcomeIsContinuous()
public java.lang.String describeOutcome()
public abstract void marketCallBack(MarketCallback callback)
public void setMaxPrice(Price maxP)
public Price getMaxPrice()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |