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 MONTHLY_PAYMENT = 558; | |
const BORROW_APR = 0.2607; | |
const REWARD_APR = 0.446; | |
const TARGET_LTV = 0.3; | |
const ETH_STAKING_APR = 0.0483; | |
let collateral = 100000; | |
let debt = 30000; | |
let cost = 0; |
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 axios = require("axios"); | |
const { table } = require("table"); | |
const pair = "ETH/USD"; | |
const initialAmount = 1.0; | |
const numberOfWeeks = 26; | |
const firstSellTimestamp = 1609473600; | |
const firstBuyTimestamp = 1609747200; | |
const interval = 7 * 24 * 60 * 60; // a week |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// ethers.js doesn't seem to support generating 24-word mnemonic phrases. Instead, we use | |
// terra.js to generate the phrases, and use ethers to convert them to Ethereum addresses. | |
// | |
// How to use: | |
// | |
// > npm install ethers @terra-money/terra.js | |
// > node generate.js | |
// | |
const { MnemonicKey } = require("@terra-money/terra.js"); | |
const { Wallet } = require("ethers"); |
NewerOlder