Skip to content

Commit

Permalink
double flappy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Sep 14, 2024
1 parent 5e096ed commit 78050c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/volatile/double-flappy-token.rain
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
raindex-version: 1c56209e411c3faaedd2bf6d62565201fbe607b3
raindex-version: 9fe04a07eb335d721287fe8d176f7313e49d6d5a

deployers:
base:
Expand Down Expand Up @@ -37,7 +37,7 @@ scenarios:
next-trade-multiplier: 1.01
history-cap: 1e50
amount-token: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
initial-io: 2392
initial-io: 2425
initial-output-token: 0x4200000000000000000000000000000000000006
initial-input-token: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Expand Down Expand Up @@ -169,8 +169,9 @@ _: if(call<'amount-is-output>() base-amount mul(base-amount inv(io)));
#io-for-epoch
epoch:,
last-io: call<'get-last-trade>(),
max-next-trade: mul(last-io next-trade-multiplier),
baseline: call<'get-cost-basis-io-ratio>(),
cost-basis-io: call<'get-cost-basis-io-ratio>(),
max-next-trade: mul(max(cost-basis-io last-io) next-trade-multiplier),
baseline: any(cost-basis-io last-io),
variable-component: sub(max-next-trade baseline),
decay: call<'halflife>(epoch),
above-baseline: mul(variable-component decay),
Expand All @@ -185,5 +186,5 @@ _: io,
:call<'set-last-trade>(io);

#handle-io
:ensure(greater-than-or-equal-to(output-vault-decrease() min-trade-amount) "Min trade amount."),
:ensure(greater-than-or-equal-to(if(call<'amount-is-output>() output-vault-decrease() input-vault-increase()) min-trade-amount) "Min trade amount."),
:call<'set-cost-basis-io-ratio>();

0 comments on commit 78050c2

Please sign in to comment.