Ejemplo n.º 1
0
        public void TestEmptyBookMarketOrder()
        {
            InitExchange();

            var baseSymbol  = DomainSettings.StakingTokenSymbol;
            var quoteSymbol = maxDivTokenSymbol;

            var buyer  = new ExchangeUser(baseSymbol, quoteSymbol);
            var seller = new ExchangeUser(baseSymbol, quoteSymbol);

            buyer.FundQuoteToken(quantity: 2m, fundFuel: true);
            seller.FundBaseToken(quantity: 2m, fundFuel: true);

            Assert.IsTrue(buyer.OpenMarketOrder(1, Buy) == 0, "Should not have bought anything");
        }
Ejemplo n.º 2
0
        public void TestMarketOrderPartialFill()
        {
            InitExchange();

            var baseSymbol  = DomainSettings.StakingTokenSymbol;
            var quoteSymbol = maxDivTokenSymbol;

            var buyer  = new ExchangeUser(baseSymbol, quoteSymbol);
            var seller = new ExchangeUser(baseSymbol, quoteSymbol);

            buyer.FundQuoteToken(quantity: 2m, fundFuel: true);
            seller.FundBaseToken(quantity: 2m, fundFuel: true);

            seller.OpenLimitOrder(0.2m, 1m, Sell);
            Assert.IsTrue(buyer.OpenMarketOrder(0.3m, Buy) == 0.2m, "");
        }
Ejemplo n.º 3
0
        public void TestMarketOrderTotalFillNoOrderbookWipe()
        {
            InitExchange();

            var baseSymbol  = Nexus.StakingTokenSymbol;
            var quoteSymbol = maxDivTokenSymbol;

            var buyer  = new ExchangeUser(baseSymbol, quoteSymbol);
            var seller = new ExchangeUser(baseSymbol, quoteSymbol);

            buyer.FundQuoteToken(quantity: 2m, fundFuel: true);
            seller.FundBaseToken(quantity: 2m, fundFuel: true);

            seller.OpenLimitOrder(0.1m, 1m, Sell);
            seller.OpenLimitOrder(0.1m, 2m, Sell);
            Assert.IsTrue(buyer.OpenMarketOrder(0.25m, Buy) == 0.175m, "");
        }