Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ block_id.number = "1256209"
[profile.dev.cairo]
unstable-add-statements-code-locations-debug-info = true
unstable-add-statements-functions-debug-info = true
inlining-strategy = "avoid"
inlining-strategy = "avoid"
23 changes: 13 additions & 10 deletions scripts/vesu_rebalance/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ async function main() {
// const acc = getAccount(ACCOUNT_NAME);
const acc = new Account(getRpcProvider(), process.env.ADDRESS!, process.env.PK!, "1", '0x3');

const depositCalls = await vesuRebalance.depositCall(
{
tokenInfo: vesuRebalance.asset(),
amount: new Web3Number(0.01, 6)
}, ContractAddr.from(acc.address)
);
console.log(depositCalls)
const gas = await acc.estimateInvokeFee(depositCalls);
console.log(`Estimated gas: `, gas);
// const depositCalls = await vesuRebalance.depositCall(
// {
// tokenInfo: vesuRebalance.asset(),
// amount: new Web3Number(0.01, 6)
// }, ContractAddr.from(acc.address)
// );
// console.log(depositCalls)
// const gas = await acc.estimateInvokeFee(depositCalls);
// console.log(`Estimated gas: `, gas);

const fees = await vesuRebalance.getFee(await vesuRebalance.getPools());
console.log(`Fees: ${JSON.stringify(fees)}`);
// const tx = await acc.execute(depositCalls);
// console.log(tx.transaction_hash);
// await getRpcProvider().waitForTransaction(tx.transaction_hash, {
Expand Down Expand Up @@ -79,7 +82,7 @@ async function harvest() {
const call = await vesuRebalance.harvest(riskAcc);
calls.push(...call);
}
const _calls = [...calls.slice(0, 3)]; // ! TODO Ensure I switch to all calls later
const _calls = [...calls.slice(0, 4)];
const gas = await riskAcc.estimateInvokeFee(_calls);
const tx = await riskAcc.execute(_calls);
console.log(`Harvest tx: ${tx.transaction_hash}`);
Expand Down
6 changes: 5 additions & 1 deletion src/helpers/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ pub const BASIS_POINTS_FACTOR: u32 = 10000;
pub const TWO_POWER_128: u128 = 0xffffffffffffffffffffffffffffffff;
pub const TWO_POWER_256: u256 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

pub const MAX_SLIPPAGE_BPS: u32 = 300; // 3%
pub const MAX_SLIPPAGE_BPS: u32 = 300; // 3%

pub fn VESU_SINGLETON_ADDRESS() -> ContractAddress {
contract_address_const::<0x2545b2e5d519fc230e9cd781046d3a64e092114f07e44771e0d719d148725ef>()
}

pub fn EKUBO_FEE_COLLECTOR() -> ContractAddress {
contract_address_const::<0x053c69eDcB1a65A8687Ec7Ad8fC23fD7cc815186fE4380bb6A5bf31df52361FF>()
}

pub fn RE7_XSTRK_POOL() -> ContractAddress {
contract_address_const::<0x52fb52363939c3aa848f8f4ac28f0a51379f8d1b971d8444de25fbd77d8f161>()
}
Expand Down
Loading
Loading