This file contains 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
{ | |
"status": "pending-simulation", | |
"monitorId": "Geth_1_F_PROD", | |
"monitorVersion": "0.117.1", | |
"pendingTimeStamp": "2022-11-07T10:47:51.244Z", | |
"pendingBlockNumber": 15917644, | |
"hash": "0x4d3ba81f78b1da44994b7d0a36a2b074cb502b01bc3890a34285131abbde17d2", | |
"from": "0x4065149108A615930114Bb511818fc0909AA9269", | |
"to": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", | |
"value": "0", |
This file contains 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
import { task, HardhatUserConfig } from 'hardhat/config'; | |
import '@typechain/hardhat'; | |
import '@nomiclabs/hardhat-waffle'; | |
import deployer from './.secret'; | |
require("dotenv").config(); | |
const BSC_ENDPOINT = process.env.BSC_ENDPOINT; | |
const config: HardhatUserConfig = { |
This file contains 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
#!/usr/bin/python | |
import ccxt | |
import calendar | |
from datetime import datetime, date, timedelta | |
binance = ccxt.binance() | |
def min_ohlcv(dt, pair, limit): | |
# UTC native object | |
since = calendar.timegm(dt.utctimetuple())*1000 |
This file contains 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
/** | |
* @type import('hardhat/config').HardhatUserConfig | |
*/ | |
require("@nomiclabs/hardhat-ethers"); | |
require("@nomiclabs/hardhat-waffle"); | |
require("@nomiclabs/hardhat-etherscan"); | |
require("dotenv").config(); | |
const mainnetEndpoint = process.env.MAINNET_ENDPOINT; |
This file contains 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: UNLICENSED | |
pragma solidity >=0.6.6 <0.8.0; | |
import './UniswapV2Library.sol'; | |
import './interfaces/IERC20.sol'; | |
import './interfaces/IUniswapV2Pair.sol'; | |
import './interfaces/IUniswapV2Factory.sol'; | |
import './interfaces/IUniswapV2Router02.sol'; |
This file contains 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
... | |
const oneSplitRates = { | |
buy: new BigNumber(oneSplitResult1.returnAmount * unitRate).shiftedBy(-toTokenDecimals[j]).toString(), | |
sell: new BigNumber(oneSplitResult2.returnAmount).shiftedBy(-fromTokenDecimals[i]).toString() | |
} | |
console.log(`1inch Exchange ${targetTokens[j]}/${fromTokens[i]}: ${JSON.stringify(oneSplitRates)}`); | |
let profit = (oneSplitRates.sell - oneSplitRates.buy); | |
// profit needs to be eth price | |
if (fromTokens[i] != 'WETH') { |
This file contains 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 scipy import stats | |
print('Skewness is {0} and Kurtosis is {1}'.format(stats.skew(a), stats.kurtosis(a, fisher=False))) | |
Skewness is 0.07652272048424928 and Kurtosis is 2.772732673807923 | |
print('Skewness is {0} and Kurtosis is {1}'.format(stats.skew(b), stats.kurtosis(b, fisher=False))) | |
Skewness is -0.03504745242988745 and Kurtosis is 1.7525462915557393 | |
stats.describe(a) | |
DescribeResult(nobs=1000, minmax=(-2.8249022278040115, 3.0569511100204605), mean=-0.053648592943343135, | |
variance=0.9768884437369372, skewness=0.07652272048424928, kurtosis=-0.2272673261920768) |
This file contains 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
// test a flashloan in Multipler V1 | |
require('dotenv').config(); | |
const Web3 = require('web3'); | |
const BigNumber = require('bignumber.js'); | |
const abis = require('./abis'); | |
const instance = require('./build/contracts/Flashloan.json'); | |
const web3 = new Web3( | |
new Web3.providers.HttpProvider(process.env.BSC_HTTPS) | |
); |
This file contains 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
pragma solidity ^0.5.0; | |
import "./base/FlashLoanReceiverBase.sol"; | |
import "./interfaces/ILendingPoolAddressesProvider.sol"; | |
import "./interfaces/ILendingPool.sol"; | |
contract Flashloan is FlashLoanReceiverBase { | |
address public receiver = address(this); | |
address public constant BNB_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; |