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
| pragma solidity ^0.5.0; | |
| pragma experimental ABIEncoderV2; | |
| import "./aave/FlashLoanReceiverBase.sol"; | |
| import "./aave/ILendingPoolAddressesProvider.sol"; | |
| import "./aave/ILendingPool.sol"; | |
| import "./IKyberNetworkProxy.sol"; | |
| import "./IUniswapExchange.sol"; | |
| import "./IUniswapFactory.sol"; |
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
| #!/usr/bin/python | |
| import ccxt | |
| import calendar | |
| from datetime import datetim | |
| binance = ccxt.binance() | |
| now = datetime.utcnow() | |
| unixtime = calendar.timegm(now.utctimetuple()) | |
| since = (unixtime - 60*60) * 1000 # UTC timestamp in milliseconds |
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
| curl -X POST --data '{ | |
| "jsonrpc": "2.0", | |
| "method": "info.getNodeID", | |
| "params":{}, | |
| "id": 1 | |
| }' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info | |
| {"jsonrpc":"2.0","result":{"nodeID":"NodeID-EggGmnQFaTffeRNG1Kzs9dXJzFGdxac3D"},"id":1} |
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
| const ethers = require('ethers'); | |
| const { FlashbotsBundleProvider} = require('@flashbots/ethers-provider-bundle') | |
| // Standard json rpc provider directly from ethers.js. For example you can use Infura, Alchemy, or your own node. | |
| // This sample uses one of the default provider goerli | |
| const provider = new ethers.getDefaultProvider("goerli"); | |
| // `authSigner` is an Ethereum private key that does NOT store funds and is NOT your bot's primary key. | |
| // This is an identifying key for signing payloads to establish reputation and whitelisting | |
| const authSigner = new ethers.Wallet( |
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 backtesting import Strategy | |
| from backtesting.lib import crossover | |
| def EMA_Backtesting(values, n): | |
| """ | |
| Return exponential moving average of `values`, at | |
| each step taking into account `n` previous values. | |
| """ | |
| close = pd.Series(values) | |
| return talib.EMA(close, timeperiod=n) |
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: MIT | |
| pragma solidity ^0.8.20; | |
| import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
| import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
| import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract MyToken is ERC721, ERC721URIStorage, ERC721Burnable, Ownable { | |
| constructor(address initialOwner) |
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: MIT | |
| pragma solidity ^0.8.20; | |
| import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
| import "@openzeppelin/contracts/utils/Counters.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
| contract Marketplace is ReentrancyGuard, Ownable { | |
| using Counters for Counters.Counter; |
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: UNLICENSED | |
| pragma solidity >=0.6.6 <0.8.0; | |
| import './utils/SafeMath.sol'; | |
| import './UniswapV2Library.sol'; | |
| import './interfaces/IERC20.sol'; | |
| import './interfaces/IUniswapV2Pair.sol'; | |
| import './interfaces/IUniswapV2Factory.sol'; | |
| import './interfaces/IUniswapV2Router02.sol'; |
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
| function startArbitrage( | |
| address token0, | |
| address token1, | |
| uint amount0, | |
| uint amount1 | |
| ) external { | |
| address pairAddress = IUniswapV2Factory(pancakeFactory).getPair(token0, token1); | |
| require(pairAddress != address(0), 'This pool does not exist'); | |
| IUniswapV2Pair(pairAddress).swap( |
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
| def Ichimoku(df): | |
| df1 = df.copy() | |
| max_9 = df1.high.rolling(window=9).max() | |
| min_9 = df1.high.rolling(window=9).min() | |
| df1["tenkan"] = (max_9+min_9)/2 | |
| df1["base"] = (df1.high.rolling(window=26).max()+df1.high.rolling(window=26).min())/2 | |
| xdate = [x.date() for x in df1.index] | |
| plt.figure(figsize=(15,5)) | |
| plt.grid() | |
| plt.plot(xdate, df1.close, color="b", lw=1, linestyle="dotted", label="original") |
NewerOlder