Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
negative_cycles_market_test.cc File Reference

Real Binance quotes through the cycle searches, against an exact oracle. More...

#include <gtest/gtest.h>
#include <gmp.h>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <functional>
#include <limits>
#include <set>
#include <string>
#include <vector>
#include <Howard_Min_Mean_Cycle.H>
#include <Min_Mean_Cycle.H>
#include <Negative_Cycles.H>
#include <tpl_graph.H>
#include "negative_cycles_market_snapshots.H"
Include dependency graph for negative_cycles_market_test.cc:

Go to the source code of this file.

Functions

 TEST (NegativeCyclesMarketTest, TheOracleCountsEveryCycleOfTheCompleteMarket)
 
 TEST (NegativeCyclesMarketTest, RealQuotesAgreeWithTheExhaustiveOracle)
 
 TEST (NegativeCyclesMarketTest, ARaisedFeeNeverImprovesTheBestCycle)
 
 TEST (NegativeCyclesMarketTest, QuietStatesOnlyOfferTheRoundTripThatCostsTwoFees)
 
 TEST (NegativeCyclesMarketTest, TheFreshBurstReproducesTheEpisodesOfTheDay)
 
 TEST (NegativeCyclesMarketTest, TrianglesUnderestimateTheFourLegOpportunityOfTheBurst)
 
 TEST (NegativeCyclesMarketTest, StaleQuotesOverstateTheBurstAndFakeTheBiggestProfitOfTheDay)
 
 TEST (NegativeCyclesMarketTest, TheRelaxedBoundLeavesAGapOnARealState)
 
 TEST (NegativeCyclesMarketTest, TheNearBreakEvenStateIsAnUnprofitableTriangle)
 

Detailed Description

Real Binance quotes through the cycle searches, against an exact oracle.

The fixture (negative_cycles_market_snapshots.H) holds eighteen states of a six-asset market taken from a 24-hour capture. Each one becomes a digraph whose arcs weigh -ln(rate) - ln(1 - fee), for four fees, with and without hiding the quotes that are stale or whose coverage is not confirmed (the arc filter an application would use). The oracle enumerates every simple cycle of the visible arcs (409 in the complete market) and adds the double weights as exact rationals, so it shares nothing with the library. It is compared with most_negative_cycle_up_to_3(), most_negative_cycle_bounded(), find_disjoint_negative_cycles(), howard_minimum_mean_cycle() and karp_minimum_mean_cycle(). The sign of the best cycle is also checked against the money it moves, with integer arithmetic on the quoted prices.

Definition in file negative_cycles_market_test.cc.

Function Documentation

◆ TEST() [1/9]

TEST ( NegativeCyclesMarketTest  ,
ARaisedFeeNeverImprovesTheBestCycle   
)

◆ TEST() [2/9]

TEST ( NegativeCyclesMarketTest  ,
QuietStatesOnlyOfferTheRoundTripThatCostsTwoFees   
)

◆ TEST() [3/9]

TEST ( NegativeCyclesMarketTest  ,
RealQuotesAgreeWithTheExhaustiveOracle   
)

◆ TEST() [4/9]

TEST ( NegativeCyclesMarketTest  ,
StaleQuotesOverstateTheBurstAndFakeTheBiggestProfitOfTheDay   
)

Definition at line 719 of file negative_cycles_market_test.cc.

References Aleph::all(), and Aleph::enumerate().

◆ TEST() [5/9]

TEST ( NegativeCyclesMarketTest  ,
TheFreshBurstReproducesTheEpisodesOfTheDay   
)

Definition at line 650 of file negative_cycles_market_test.cc.

References Aleph::enumerate(), and m.

◆ TEST() [6/9]

TEST ( NegativeCyclesMarketTest  ,
TheNearBreakEvenStateIsAnUnprofitableTriangle   
)

Definition at line 791 of file negative_cycles_market_test.cc.

References Aleph::enumerate(), m, and r.

◆ TEST() [7/9]

TEST ( NegativeCyclesMarketTest  ,
TheOracleCountsEveryCycleOfTheCompleteMarket   
)

◆ TEST() [8/9]

TEST ( NegativeCyclesMarketTest  ,
TheRelaxedBoundLeavesAGapOnARealState   
)

Definition at line 761 of file negative_cycles_market_test.cc.

References Aleph::enumerate(), m, and r.

◆ TEST() [9/9]

TEST ( NegativeCyclesMarketTest  ,
TrianglesUnderestimateTheFourLegOpportunityOfTheBurst   
)

Definition at line 683 of file negative_cycles_market_test.cc.

References Aleph::enumerate(), and m.