Skip to content

Instantly share code, notes, and snippets.

@erin-koen
erin-koen / MelonBot.MagicFunction.ts
Last active January 7, 2021 03:24
The Melon Bot's Magic Function
public fortuneTeller(expectedPrice: PriceQueryResult) {
// this is my sophisticated trading strategy. you could build
// something more elaborate with the PriceQueryResult object passed in.
return Math.random() > 0.5;
}
public async makeMeRich() {
// call the getFundHoldings method which returns an array of holdings.
const balances = await this.accountingContract.getFundHoldings();
@erin-koen
erin-koen / LocalDeployment
Last active December 9, 2021 15:35
How to run a local fork of mainnet along with the associated subgraphs
### PROTOCOL
- confirm node url:
ETHEREUM_NODE_MAINNET=https://eth-mainnet.alchemyapi.io/v2/ALxM6coYqWo1MUS12C4vQGTRVD0JfvYx
- `yarn`, `yarn compile`, `yarn build`
- `yarn hardhat node --export ../subgraphs/deployments/local/v4.json --hostname 0.0.0.0`
### SUBGRAPHS
- `yarn` in parent dir