Skip to content

Commit

Permalink
Merge pull request #34 from h20liquidity/2024-01-05-scripts-update
Browse files Browse the repository at this point in the history
scripts update
  • Loading branch information
Siddharth2207 authored Jan 5, 2024
2 parents 1ca7165 + e21744c commit d309a05
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions scripts-v3/deployLimitOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function main(argv){
.requiredOption("-t --to <network-name>",`Target network to deploy order to. Any of [${supportedNetworks}]`)
.requiredOption("-s --sell-ratio <Sell Ratio>",`Limit Sell Order Ratio`)
.requiredOption("-b --buy-ratio <Buy Ratio>",`Limit Buy Order Ratio`)
.requiredOption("-v --vault <vault>",`Hexadecimal string representing the vault id.`)
.description([
"Deploy Limit Orders"
].join("\n"))
Expand All @@ -25,12 +26,10 @@ async function main(argv){
const toNetwork = cmdOptions.to
const sellRatio = cmdOptions.sellRatio
const buyRatio = cmdOptions.buyRatio

const vaultId = cmdOptions.vault

console.log(`\n>>>> Deploying limit orders to ${toNetwork.toUpperCase()}...`)

// const vaultId = randomUint256().toString()
const vaultId = "82212972147442832250651702525296904327619221408273464764340702831835315043991"


await deployLimitStrategy(toNetwork,vaultId,sellRatio,buyRatio)
Expand Down
6 changes: 3 additions & 3 deletions scripts-v3/deployStrategyNP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ async function main(argv){

const cmdOptions = new Command()
.requiredOption("-t --to <network-name>",`Target network to deploy order to. Any of [${supportedNetworks}]`)
.requiredOption("-v --vault <vault>",`Hexadecimal string representing the vault id.`)
.description([
"Deploy Strategy to target network"
].join("\n"))
.parse(argv)
.opts();

const toNetwork = cmdOptions.to
const toNetwork = cmdOptions.to
const vaultId = cmdOptions.vault

console.log(`\n>>>> Deploying strategy to ${toNetwork.toUpperCase()}...`)

const vaultId = randomUint256().toString()

await deployPilotBinomialStrategy(toNetwork,vaultId)

Expand Down
3 changes: 1 addition & 2 deletions test/4SushiV2StratBinomial.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import "test/lib/OrderBookNPE2Real.sol";

uint256 constant CONTEXT_VAULT_IO_ROWS = 5;

string constant FORK_RPC = "https://polygon.llamarpc.com";
uint256 constant FORK_BLOCK_NUMBER = 50715909;
uint256 constant VAULT_ID = uint256(keccak256("vault"));

Expand All @@ -70,7 +69,7 @@ contract Test4SushiV2StratBinomial is OrderBookNPE2Real {
using LibFixedPointDecimalScale for uint256;

function selectPolygonFork() internal {
uint256 fork = vm.createFork(FORK_RPC);
uint256 fork = vm.createFork(vm.envString("RPC_URL_POLYGON"));
vm.selectFork(fork);
vm.rollFork(FORK_BLOCK_NUMBER);
}
Expand Down
3 changes: 1 addition & 2 deletions test/5SushiV2LimitOrder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ contract Test4SushiV2LimitOrder is Test5SushiV2LimitOrderUtil {
using LibFixedPointDecimalArithmeticOpenZeppelin for uint256;
using LibFixedPointDecimalScale for uint256;

string constant FORK_RPC = "https://polygon.llamarpc.com";
uint256 constant FORK_BLOCK_NUMBER = 50848263;

uint32 constant RESERVE_TIMESTAMP = 1701608565;
Expand All @@ -69,7 +68,7 @@ contract Test4SushiV2LimitOrder is Test5SushiV2LimitOrderUtil {
uint256 constant CONTEXT_VAULT_IO_ROWS = 5;

function selectPolygonFork() internal {
uint256 fork = vm.createFork(FORK_RPC);
uint256 fork = vm.createFork(vm.envString("RPC_URL_POLYGON"));
vm.selectFork(fork);
vm.rollFork(FORK_BLOCK_NUMBER);
}
Expand Down

0 comments on commit d309a05

Please sign in to comment.