Skip to content

Instantly share code, notes, and snippets.

View richwednesday's full-sized avatar
😀
exploring

Joseph Iwok richwednesday

😀
exploring
View GitHub Profile
@richwednesday
richwednesday / fix_stream_price.js
Last active August 16, 2020 20:42
Streaming Price of Bitcoin from FTX> https://docs.ftx.com/#websocket-api
import WebSocket from 'ws';
const ws = new WebSocket('wss://ftx.com/ws/');
let ping;
function open() {
ws.on('open', function open() {
ws.send(JSON.stringify({
op: 'subscribe',
channel: 'ticker',
market: 'BTC-PERP'
pragma solidity >=0.7.0 <0.9.0;
interface cETH {
// define functions of COMPOUND we'll be using
function mint() external payable; // to deposit to compound
function redeem(uint redeemTokens) external returns (uint); // to withdraw from compound