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 { DydxClient } = require('@dydxprotocol/v3-client') | |
const Web3 = require('web3') | |
const web31 = new Web3(process.env.RPC_NODE) | |
const web32 = new Web3(process.env.RPC_NODE) | |
const signer1 = web31.eth.accounts.wallet.add(process.env.TRADING_ZERO_PVT_KEY) | |
const signer2 = web32.eth.accounts.wallet.add(process.env.TRADING_ONE_PVT_KEY) | |
const { dateutils } = require('../utils') | |
const { iso8601, dateNowUTC, timeFmtDb } = dateutils |
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
Working with Curve Source Repo, Including running from Brownie. | |
For starters, there is a pdf manual for brownie that should be found and utilized. | |
The way to configure the infura or whatever provider is via the command line, | |
in there you will want to set your mnemonic as well as your infura key or private RPC | |
$ brownie networks list true | |
$ brownie networks modify mainnet-fork mnemonic="\"your twelve word mnemonic\"" | |
$ brownie networks modify mainnet host=https://rinkeby.infura.io/v3/dklfjh0g8og8ohg845jhsgr98 |
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
/* | |
* initDeliverable.js | |
* | |
* Storefront example application where user purchases ERC20, 721 and | |
* pays fees in the network's native fee curency. | |
* This is not a complete application, hence a gist. | |
* Modified version of community-points::transaction.js | |
* See also | |
* [email protected] | |
*/ |
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
/* | |
* deliverableWithFee.js | |
* | |
* Storefront application where user purchases ERC20, 721 and | |
* pays fees in the network's native fee curency. | |
* Modified version of community-points::transaction.js | |
* See also | |
* [email protected] | |
*/ |
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 chalk = require('chalk'); | |
const player = require('play-sound')(); | |
const eventManager = require('../operations/eventManager'); | |
const diagnostics = require('../utilities/diagnostics.js'); | |
const request = require('request'); | |
let executeTrades = true; | |
let lastBalanceTime = 0; | |
let lastBalance; |
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
// Note: internal implementation. This does not use the snowsignals-api npm package, examples coming soon | |
// see also http://snowsignals.com:3333/apiDocs | |
const signalsApi = require('../api.js'); | |
module.exports = { | |
whatThink: function(job){ | |
return new Promise(async (resolve, reject) => { | |
job.emaslowemaw = 40; |
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
module.exports = { | |
// given an array of timestamps only, returns a set of relevant timestamps | |
// to previous hours, only allowing one timestamp per hour | |
hourlyTimestamps: function (array){ | |
const now = new Date().getTime(); | |
let msh = 3.6e+6; // milliseconds per hour | |
let hoursGone = 0; | |
let theseHours = []; // array of representative data on an hourly basis, 0 if no data | |
let analysisDuration = 168; // hours in a given week. |
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
function digits(n) { | |
return Math.floor(Math.log(n) / Math.log(10)); | |
} | |
function round10(value, exp) { | |
return decimalAdjust('round', value, exp); | |
} | |
function decimalAdjust(type, value, exp) { |
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
median: function (high_array, low_array) { | |
let error = false; | |
const highs = trimArrayTailToSize(high_array, 100); | |
const lowArr = trimArrayTailToSize(low_array, 100); | |
const lows = detectBadLowData(lowArr); | |
const precision = findPrecision(highs); |
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
Group A: tokens with 3 or greater buy indicators | |
11:BCHABCBTC Rank: 3 Last Price: 0.04130400 triggerPrice: 0.04151000 difference: -0.00020600 duration: 5 gain: -0.50 prevStatus: 2 prevDuration: 1 | |
42:ZRXBTC Rank: 43 Last Price: 0.00007254 triggerPrice: 0.00007254 difference: 0.00000000 duration: 1 gain: 0.00 prevStatus: 1 prevDuration: 1 | |
111:POEBTC Rank: 58 Last Price: 0.00000137 triggerPrice: 0.00000137 difference: 0.00000000 duration: 1 gain: 0.00 prevStatus: 0 prevDuration: 58 | |
141:DGDBTC Rank: 68 Last Price: 0.00459100 triggerPrice: 0.00453400 difference: 0.00005700 duration: 3 gain: 1.26 prevStatus: 1 prevDuration: 1 | |
Group B tokens with 2 buy indicators | |
7:TNTBTC Rank: 4 Thresh B: Last Price: 0.00000530 triggerPrice: 0.00000466 difference: 0.00000064 duration: 3 gain: 13.73 prevStatus: 0 prevDuration: 5 | |
16:ELFBTC Rank: 38 Thresh B: Last Price: 0.00004409 triggerPrice: 0.00004505 difference: -0.00000096 duration: 4 gain: -2.13 prevStatus: 0 prevDuration: 1 | |
17:BNBBTC Rank: 1 Thresh B: Last Price: 0.004141 |