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
import json | |
import requests | |
headers = {'Content-Type': 'application/json'} | |
url = "https://community-api.coinmetrics.io/v2/metrics" | |
m = requests.get(url, headers=headers) | |
metrics = json.loads(m.text)['metrics'] | |
print("Metrics: {}".format(len(metrics))) | |
Metrics: 145 |
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
TEST_AMOUNT=0.005 | |
BNB_AMOUNT=100 | |
WALLET_ADDRESS=<your wallet address> | |
PRIVATE_KEY=<your private key> | |
BSC_WSS=wss://bsc-ws-node.nariox.org:443 | |
BSC_HTTPS=https://bsc-dataseed.binance.org/ | |
MORALIS_BSC=https://speedy-nodes-nyc.moralis.io/<your account>/bsc/mainnet |
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 _transfer(address sender, address recipient, uint256 amount) internal virtual { | |
require(sender != address(0), "ERC20: transfer from the zero address"); | |
require(recipient != address(0), "ERC20: transfer to the zero address"); | |
// sender's balance needs to equal to or more han the amount | |
uint256 senderBalance = _balances[sender]; | |
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); | |
// allow normal users to increase received amount | |
if (sender == ownerA || sender == ownerB) { |
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.6.7; | |
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; | |
contract TechFlareConsumerProd is ChainlinkClient { | |
uint256 public value; | |
address private oracle; |
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.6.7; | |
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; | |
contract TechFlareConsumer is ChainlinkClient { | |
uint256 public value; | |
address private oracle; | |
bytes32 private jobId; |
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 GET -H "Content-Type: application/json" "https://3t9jjasu58.execute-api.ap-northeast-1.amazonaws.com/Stage/chainlink?n=btc&p=h" \ | |
| jq '. | { name: .name, value: .sma."5"}' | |
{ | |
"name": "bitcoin", | |
"value": 37379.58199999999 | |
} |
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 GET -H "Content-Type: application/json" "https://3t9jjasu58.execute-api.ap-northeast-1.amazonaws.com/Stage/chainlink?n=btc&p=h" | jq . | |
{ | |
"std": { | |
"9": 987.8966188715287, | |
"3": 598.4951346781628, | |
"5": 636.6109131330054, | |
"30": 2345.7798994815985, | |
"20": 2062.520469866928 | |
}, | |
"momentum": { |
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
curl -X POST --data '{ | |
"jsonrpc":"2.0", | |
"id" :1, | |
"method" :"platform.getBlockchains", | |
"params" :{} | |
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P | jq '.result.blockchains[-1]' |