Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth2207 committed Jun 18, 2024
1 parent 1f7801f commit 878cfd7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/wip/streaming-dca.rain
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,21 @@ scenarios:
strat-strat-time
);

#calculate-budget-input
current-budget: ,
_: uniswap-v3-quote-exact-input(
output-token-address input-token-address
current-budget twap-io-fee
);

#calculate-io
using-words-from uniswap-words orderbook-subparser

current-time last-time: call<'get-last-time>(),
elapsed-time: saturating-sub(current-time last-time),
current-budget: mul(per-second-rate elapsed-time),
bounty-amount: call<'bounty-auction>(elapsed-time),
input-amount: uniswap-v3-quote-exact-input(output-token-address input-token-address current-budget twap-io-fee),
input-amount: call<'calculate-budget-input>(current-budget),
max-amount: current-budget,
io-ratio: div(saturating-sub(input-amount bounty-amount) current-budget),
:ensure(
Expand Down

0 comments on commit 878cfd7

Please sign in to comment.