Closed mrsantran closed 6 years ago
Having trouble seeing what is going wrong here
Many times return bids price great than asks price
I cannot reproduce this problem Try using this code, this will display the order book like on their webpage. More importantly, the depth cache gets sorted before display
$api->depthCache("ETHBTC", function($api, $symbol, $depth) {
echo "{$symbol} depth cache update".PHP_EOL;
//print_r($depth); // Print all depth data
$limit = 11; // Show only the closest asks/bids
$sorted = $api->sortDepth($symbol, $limit);
$bid = $api->first($sorted['bids']);
$ask = $api->first($sorted['asks']);
echo $api->displayDepth($sorted);
echo "ask: {$ask}".PHP_EOL;
echo "bid: {$bid}".PHP_EOL;
});
Bid price great than Ask price