diff --git a/strategies/flare/wflr-streaming-dca.rain b/strategies/flare/wflr-streaming-dca.rain index 2768f2c..50f3293 100644 --- a/strategies/flare/wflr-streaming-dca.rain +++ b/strategies/flare/wflr-streaming-dca.rain @@ -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 # @@ -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. @@ -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. @@ -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, @@ -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, diff --git a/strategies/wlth/wlth-dca-streaming.rain b/strategies/wlth/wlth-dca-streaming.rain index b5af11a..10fc31a 100644 --- a/strategies/wlth/wlth-dca-streaming.rain +++ b/strategies/wlth/wlth-dca-streaming.rain @@ -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 # @@ -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. @@ -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. @@ -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. @@ -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, @@ -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, diff --git a/test/Flare/FlrStreamingTest.t.sol b/test/Flare/FlrStreamingTest.t.sol index 44c216e..13a31fb 100644 --- a/test/Flare/FlrStreamingTest.t.sol +++ b/test/Flare/FlrStreamingTest.t.sol @@ -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( "", @@ -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();