Skip to content

Commit

Permalink
update per-day-amt
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth2207 committed Aug 8, 2024
1 parent 09803c4 commit 84ad1fb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 33 deletions.
21 changes: 8 additions & 13 deletions strategies/flare/wflr-streaming-dca.rain
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,13 @@ scenarios:
# If the order's input-output token are NOT paired on the uniswap v3 pool, then set to reserve.
quote-multiplier: '''quote-multiplier-identity'

# Number of output tokens offered per second.
# Total number of output tokens offered / Total time duration.
# Eg : 100 tokens cost averaged in 1 hours: 100/3600 = 0.027777777777777778
per-second-rate: 0.01
# Number of output tokens offered per day.
per-day-output: 120

# Unix timestamp for strating of the strategy.
# Ideally set it 15 minutes ahead of the whatever the timestamp is while you're deploying the order.
# https://www.epochconverter.com/
strat-start-time: 1723114226
strat-start-time: 1723131051

# Bounty amount denominated in input tokens
#
Expand Down Expand Up @@ -122,9 +120,6 @@ charts:
buy-streaming-dca:
scenario: streaming-dca.buy-wflr.chart
metrics:
- label: USDT Per second rate
value: 0.6.0
description: Amount of USDT tokens sold per second.
- label: USDT sold per hour
value: 0.6.1
description: Amount of USDT tokens sold per hour.
Expand Down Expand Up @@ -178,7 +173,7 @@ charts:
#bounty-min !Minimum bounty to offer for each trade in USD.
#bounty-max !Maximum bounty that can be offered.

#per-second-rate !The rate of stable denominated distributed tokens distributed per second.
#per-day-output !The rate of stable denominated distributed tokens distributed per second.
#strat-start-time !Strategy start timestamp
#get-last-time !Binding to get last time and current time
#plottables !Binding for charting metrics.
Expand Down Expand Up @@ -236,9 +231,9 @@ charts:
output-to-input: call<'quote-multiplier>(output-to-reserve);

#plottables-plot
_: per-second-rate,
tokens-per-hour: mul(per-second-rate 3600),
tokens-per-day: mul(per-second-rate 86400),
_: per-day-output,
tokens-per-hour: div(mul(per-day-output 3600) 86400),
tokens-per-day: per-day-output,
_: bounty-min,
_: bounty-max,
_: auction-start-time,
Expand Down Expand Up @@ -276,7 +271,7 @@ charts:

current-time last-time: call<'get-last-time>(),
elapsed-time: saturating-sub(current-time last-time),
current-budget: mul(per-second-rate elapsed-time),
current-budget: mul(per-day-output div(elapsed-time 86400)),
bounty-amount: call<'bounty-auction>(current-time last-time),
input-amount: call<'calculate-budget-input>(current-budget),
max-amount: current-budget,
Expand Down
27 changes: 10 additions & 17 deletions strategies/wlth/wlth-dca-streaming.rain
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,13 @@ scenarios:
# If the order's input-output token are NOT paired on the uniswap v3 pool, then set to reserve.
quote-multiplier: '''quote-multiplier-identity'

# Number of output tokens offered per second.
# Total number of output tokens offered / Total time duration.
# Eg : 100 tokens cost averaged in 1 hours: 100/3600 = 0.027777777777777778
per-second-rate: 0.277777777777777778
# Number of output tokens offered per day.
per-day-output: 10000

# Unix timestamp for strating of the strategy.
# Ideally set it 15 minutes ahead of the whatever the timestamp is while you're deploying the order.
# https://www.epochconverter.com/
strat-start-time: 1723106176
strat-start-time: 1723131051

# Bounty amount denominated in input tokens
#
Expand Down Expand Up @@ -172,10 +170,8 @@ scenarios:
# If the order's input-output token are NOT paired on the uniswap v3 pool, then set to reserve.
quote-multiplier: '''quote-multiplier-identity'

# Number of output tokens offered per second.
# Total number of output tokens offered / Total time duration.
# Eg : 100 tokens cost averaged in 1 hours: 100/3600 = 0.027777777777777778
per-second-rate: 0.01
# Number of output tokens offered per day.
per-day-output: 120

# Unix timestamp for strating of the strategy.
# Ideally set it 15 minutes ahead of the whatever the timestamp is while you're deploying the order.
Expand Down Expand Up @@ -231,9 +227,6 @@ charts:
sell-streaming-dca:
scenario: streaming-dca.sell-wlth.chart
metrics:
- label: WLTH Per second rate
value: 0.6.0
description: Amount of WLTH tokens sold per second.
- label: WLTH sold per hour
value: 0.6.1
description: Amount of WLTH tokens sold per hour.
Expand Down Expand Up @@ -340,7 +333,7 @@ deployments:
#bounty-min !Minimum bounty to offer for each trade in USD.
#bounty-max !Maximum bounty that can be offered.

#per-second-rate !The rate of stable denominated distributed tokens distributed per second.
#per-day-output !The rate of stable denominated distributed tokens distributed per second.
#strat-start-time !Strategy start timestamp
#get-last-time !Binding to get last time and current time
#plottables !Binding for charting metrics.
Expand Down Expand Up @@ -396,9 +389,9 @@ deployments:
output-to-input: call<'quote-multiplier>(output-to-reserve);

#plottables-plot
_: per-second-rate,
tokens-per-hour: mul(per-second-rate 3600),
tokens-per-day: mul(per-second-rate 86400),
_: per-day-output,
tokens-per-hour: div(mul(per-day-output 3600) 86400),
tokens-per-day: per-day-output,
_: bounty-min,
_: bounty-max,
_: auction-start-time,
Expand Down Expand Up @@ -436,7 +429,7 @@ deployments:

current-time last-time: call<'get-last-time>(),
elapsed-time: saturating-sub(current-time last-time),
current-budget: mul(per-second-rate elapsed-time),
current-budget: mul(per-day-output div(elapsed-time 86400)),
bounty-amount: call<'bounty-auction>(current-time last-time),
input-amount: call<'calculate-budget-input>(current-budget),
max-amount: current-budget,
Expand Down
6 changes: 3 additions & 3 deletions test/Flare/FlrStreamingTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ contract FlrStreamingTest is StrategyTests {
IO[] memory outputVaults = new IO[](1);
outputVaults[0] = flareEusdtIo();

uint256 expectedRatio = 60.176793418949736058e18;
uint256 expectedAmount = 9e18;
uint256 expectedRatio = 60.098521370017216084e18;
uint256 expectedAmount = 4999999999999999920;

LibStrategyDeployment.StrategyDeployment memory strategy = LibStrategyDeployment.StrategyDeployment(
"",
Expand All @@ -99,7 +99,7 @@ contract FlrStreamingTest is StrategyTests {

OrderV3 memory order = addOrderDepositOutputTokens(strategy);

vm.warp(block.timestamp + 900);
vm.warp(block.timestamp + 3600);

{
vm.recordLogs();
Expand Down

0 comments on commit 84ad1fb

Please sign in to comment.