net.commerce.zocalo.market
Class UnaryMarket

java.lang.Object
  extended by net.commerce.zocalo.market.Market
      extended by net.commerce.zocalo.market.BinaryMarket
          extended by net.commerce.zocalo.market.UnaryMarket

public class UnaryMarket
extends BinaryMarket

a Market in a claim with only one position; only supports book orders. If short selling is not allowed, then coupons can only be sold by holders. If short selling is allowed, then sellers receive money rather than paying, but they must be able to pay dividends. Responsibilities include reporting on price levels and book contents as well as buying claims.


Field Summary
 
Fields inherited from class net.commerce.zocalo.market.Market
maxPrice
 
Method Summary
 Quantity buyWithCostLimit(Position pos, Price price, Quantity costLimit, User user)
           
 Quantity decideClaimAndRecord(Position pos)
           
protected  boolean gateKeeper(Position pos, Price price, Quantity quantity, User user, boolean marketOrder)
           
static UnaryMarket make(BinaryClaim claim, CouponBank couponMint, SecureUser owner, java.util.Properties props, ReserveVerifier verifier)
          This factory method allows the owner to create unbalanced pairs of coupons.
static UnaryMarket make(BinaryClaim claim, SecureUser owner, Funds empty, Quantity maxPrice, ReserveVerifier v)
           
static UnaryMarket make(SecureUser owner, BinaryClaim claim, Funds empty, ReserveVerifier v)
           
 MarketMaker makeMarketMaker(SecureUser owner, double endowment)
           
 void marketCallBack(MarketCallback callback)
           
protected  Quantity purchaseAtMarketPrice(Position pos, Price price, Quantity quantity, User user)
           
 void recordBookTrade(User acceptor, Price price, Quantity quantity, Position position)
           
 void recordLimitTrade(Order order, Quantity quantityTraded, Position opposite)
           
 
Methods inherited from class net.commerce.zocalo.market.BinaryMarket
buyAtMarketPrice, buyOrAddBookOrder, buyWithCostLimit, getBinaryClaim, getClaim, getName, make, make, make, make, make, make, makeMarketMaker, makeMarketMaker, maxPrice, postPurchaseActions, setClaim, setMaker
 
Methods inherited from class net.commerce.zocalo.market.Market
asPrice, asPrice, close, currentPrice, currentProbability, describeOutcome, getBook, getLastTrade, getMaxPrice, getOutcome, getOwner, hasMaker, identifyCouponBank, isOpen, limitOrder, marketOrder, mintBalance, open, outcome, outcomeIsContinuous, printNewCouponSets, requiredReserves, requireReserves, resetBook, scaleToPrice, sellHoldings, setMaxPrice, setOutcome, setOwner, setRequireReserves, setReserveVerifier, settle, setWholeShareTradingOnly, verifyPriceRange, verifyReserves, wholeShareTradingOnly, withholdReserves, withholdReserves
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

make

public static UnaryMarket make(SecureUser owner,
                               BinaryClaim claim,
                               Funds empty,
                               ReserveVerifier v)

make

public static UnaryMarket make(BinaryClaim claim,
                               SecureUser owner,
                               Funds empty,
                               Quantity maxPrice,
                               ReserveVerifier v)

make

public static UnaryMarket make(BinaryClaim claim,
                               CouponBank couponMint,
                               SecureUser owner,
                               java.util.Properties props,
                               ReserveVerifier verifier)
This factory method allows the owner to create unbalanced pairs of coupons.


makeMarketMaker

public MarketMaker makeMarketMaker(SecureUser owner,
                                   double endowment)

purchaseAtMarketPrice

protected Quantity purchaseAtMarketPrice(Position pos,
                                         Price price,
                                         Quantity quantity,
                                         User user)
Overrides:
purchaseAtMarketPrice in class BinaryMarket

gateKeeper

protected boolean gateKeeper(Position pos,
                             Price price,
                             Quantity quantity,
                             User user,
                             boolean marketOrder)
Overrides:
gateKeeper in class Market

marketCallBack

public void marketCallBack(MarketCallback callback)
Overrides:
marketCallBack in class BinaryMarket

buyWithCostLimit

public Quantity buyWithCostLimit(Position pos,
                                 Price price,
                                 Quantity costLimit,
                                 User user)
Overrides:
buyWithCostLimit in class BinaryMarket

recordLimitTrade

public void recordLimitTrade(Order order,
                             Quantity quantityTraded,
                             Position opposite)
Overrides:
recordLimitTrade in class BinaryMarket

recordBookTrade

public void recordBookTrade(User acceptor,
                            Price price,
                            Quantity quantity,
                            Position position)
Overrides:
recordBookTrade in class BinaryMarket

decideClaimAndRecord

public Quantity decideClaimAndRecord(Position pos)
Overrides:
decideClaimAndRecord in class Market