-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
514 additions
and
256 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { BeanstalkSDK } from "@beanstalk/sdk"; | ||
import chalk from "chalk"; | ||
|
||
export const getDeltaB = async (sdk: BeanstalkSDK) => { | ||
const deltaB = await sdk.bean.getDeltaB(); | ||
console.log(`${chalk.bold.whiteBright("DeltaB: ")} ${chalk.greenBright(deltaB.toHuman())}`); | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { BeanstalkSDK } from "@beanstalk/sdk"; | ||
import { BlockchainUtils } from "@beanstalk/sdk/dist/types/utils/TestUtils"; | ||
import chalk from "chalk"; | ||
import { table } from "table"; | ||
|
||
export const setDeltaB = async (sdk: BeanstalkSDK, chain: BlockchainUtils, direction: string, amount) => { | ||
const multiplier = amount === "50000" ? 2 : amount; | ||
if (direction === "down") { | ||
await chain.setPriceUnder1(multiplier); | ||
} else if (direction === "up") { | ||
await chain.setPriceOver1(multiplier); | ||
} else { | ||
console.log(`unknown input: ${direction}. Expected "up", or "down"`); | ||
} | ||
|
||
const deltaB = await sdk.bean.getDeltaB(); | ||
console.log(`${chalk.bold.whiteBright("New DeltaB: ")} ${chalk.greenBright(deltaB.toHuman())}`); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { TokenValue } from "@beanstalk/sdk-core"; | ||
import { account as _account, impersonate, chain } from "./setup"; | ||
import { defaultAbiCoder } from "ethers/lib/utils"; | ||
|
||
main().catch((e) => { | ||
console.log("FAILED:"); | ||
console.log(e); | ||
}); | ||
|
||
async function main() { | ||
const account = process.argv[3] || _account; | ||
const { sdk, stop } = await impersonate(account); | ||
sdk.DEBUG = false; | ||
|
||
let deltaB = await sdk.bean.getDeltaB(); | ||
|
||
if (deltaB.gte(TokenValue.ZERO)) { | ||
await chain.setPriceUnder1(); | ||
} else { | ||
await chain.setPriceOver1(); | ||
} | ||
// chain.mine() | ||
deltaB = await sdk.bean.getDeltaB(); | ||
console.log("New DeltaB: ", deltaB.toHuman()); | ||
} |
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
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.