diff --git a/src/opensesim/world/Account.java b/src/opensesim/world/Account.java index 7687f45..7bc7f91 100644 --- a/src/opensesim/world/Account.java +++ b/src/opensesim/world/Account.java @@ -33,10 +33,11 @@ import java.util.Map; */ public interface Account { /** - * Get a list of assets in this account + * Get a list of assets accumulated in this account * @return Map of assets */ public Map getAssets(); + /** * Get the exchange this accounts belongs to * @return Exchange diff --git a/src/opensesim/world/TradingEngine.java b/src/opensesim/world/TradingEngine.java index b9a9870..95dc1b9 100644 --- a/src/opensesim/world/TradingEngine.java +++ b/src/opensesim/world/TradingEngine.java @@ -48,7 +48,7 @@ class TradingEngine implements TradingAPI { * Construct a trading engine for an asset pair * * @param pair The AssetPair object to create the trading engine for - * @param outer Outer class - points to an Exchange object thins trading + * @param outer Outer class - points to an Exchange object this trading * engine belongs to. */ TradingEngine(AssetPair pair, final Exchange outer) { @@ -287,8 +287,9 @@ class TradingEngine implements TradingAPI { // Update available currency for the buyer. // For sellers there is no need to update. - double avdiff = b.limit * volume - price * volume; + double avdiff; // b.account.addAvail(assetpair.getCurrency(), avdiff); + avdiff = b.limit * volume - price * volume; // Unbind @@ -374,7 +375,7 @@ class TradingEngine implements TradingAPI { return b.limit; } - // Last price is grater ask, so return the current ask + // Last price is greater than ask, so return the current ask if (last_quote.price > a.limit) { return a.limit; }