This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from libc.stdint cimport uint32_t | |
| from mm_toolbox.time.time cimport time_s | |
| from .engine cimport OrderAction | |
| cdef class RateLimitCounter: | |
| cdef: | |
| uint32_t tokens_per_sec | |
| uint32_t tokens_remaining |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: AGPL-3.0-or-later | |
| // The ABI encoder is necessary, but older Solidity versions should work | |
| pragma solidity ^0.7.0; | |
| pragma experimental ABIEncoderV2; | |
| // These definitions are taken from across multiple dydx contracts, and are | |
| // limited to just the bare minimum necessary to make flash loans work. | |
| library Types { | |
| enum AssetDenomination { Wei, Par } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string> | |
| #include <vector> | |
| #include <thread> | |
| #include <iostream> | |
| #include <unistd.h> | |
| using namespace std; | |
| class IObserver | |
| { | |
| public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string> | |
| #include <vector> | |
| #include <thread> | |
| #include <iostream> | |
| #include <unistd.h> | |
| using namespace std; | |
| mutex mtxData; | |
| class Consumer | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Example program | |
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <time.h> | |
| // *********************************** | |
| // This is for measuring CPU clocks | |
| #if defined(__i386__) | |
| static __inline__ unsigned long long rdtsc(void) |