Skip to content

Commit 7b67364

Browse files
committed
📝 Set repermit freshness defaults to 50
1 parent cd88273 commit 7b67364

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎script/input/repermit.skeleton.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@
176176
"chainid": "<CHAIN_ID>",
177177
"exclusivity": 0,
178178
"epoch": "<EPOCH_SECONDS>",
179-
"slippage": "<SLIPPAGE_BPS>",
180-
"freshness": 60,
179+
"slippage": 500,
180+
"freshness": 50,
181181
"input": {
182182
"token": "<INPUT_TOKEN>",
183183
"amount": "<INPUT_AMOUNT>",

‎skill/assets/repermit.template.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@
176176
"chainid": "<CHAIN_ID>",
177177
"exclusivity": 0,
178178
"epoch": "<EPOCH_SECONDS>",
179-
"slippage": "<SLIPPAGE_BPS>",
180-
"freshness": 60,
179+
"slippage": 500,
180+
"freshness": 50,
181181
"input": {
182182
"token": "<INPUT_TOKEN>",
183183
"amount": "<INPUT_AMOUNT>",

‎skill/references/examples.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Mix limit, trigger, and delay fields as needed.
3333
"exclusivity": 0,
3434
"epoch": 0,
3535
"slippage": 500,
36-
"freshness": 60,
36+
"freshness": 50,
3737
"input": {
3838
"token": "0x1111111111111111111111111111111111111111",
3939
"amount": "1000000",
@@ -81,7 +81,7 @@ Mix limit, trigger, and delay fields as needed.
8181
"exclusivity": 0,
8282
"epoch": 0,
8383
"slippage": 500,
84-
"freshness": 60,
84+
"freshness": 50,
8585
"input": {
8686
"token": "0x4444444444444444444444444444444444444444",
8787
"amount": "5000000000000000000",
@@ -129,7 +129,7 @@ Mix limit, trigger, and delay fields as needed.
129129
"exclusivity": 0,
130130
"epoch": 300,
131131
"slippage": 500,
132-
"freshness": 60,
132+
"freshness": 50,
133133
"input": {
134134
"token": "0x7777777777777777777777777777777777777777",
135135
"amount": "3000000",

‎skill/references/params.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
Use this file for field semantics, order-shape mapping, defaults, validation, and local normalization.
44

55
1. Required: `chainId`, `swapper`, `input.token`, `input.amount`, `output.token`.
6-
2. Optional: `input.maxAmount`, `nonce`, `start`, `deadline`, `epoch`, `slippage`, `output.limit`, `output.triggerLower`, `output.triggerUpper`, `output.recipient`.
6+
2. Optional: `input.maxAmount`, `nonce`, `start`, `deadline`, `epoch`, `freshness`, `slippage`, `output.limit`, `output.triggerLower`, `output.triggerUpper`, `output.recipient`.
77
3. Common order-shape fields: market = `output.limit = 0`; limit = `output.limit > 0`; stop-loss = `output.triggerLower > 0`; take-profit = `output.triggerUpper > 0`; delayed-start = future `start`; chunked or TWAP = `input.amount < input.maxAmount`; recurring chunked = `epoch > 0`; back to native output = `output.token = 0x0000000000000000000000000000000000000000`.
88
4. `input.amount` is the fixed per-chunk size. `input.maxAmount` is the total requested size. If omitted, it defaults to `input.amount`. If it is not divisible by `input.amount`, round it down to a whole number of chunks before building `typedData`.
99
5. `output.limit`, `output.triggerLower`, and `output.triggerUpper` are output-token amounts per chunk, encoded in the output token's smallest unit. When `output.token` is an ERC-20, encode them in that token's decimals. When `output.token = 0x0000000000000000000000000000000000000000`, encode them in native `wei` with 18 decimals.
1010
6. Input and output units are independent. Always encode `input.amount` and `input.maxAmount` in `input.token` decimals, even for back-to-native orders; encode `output.limit`, `output.triggerLower`, and `output.triggerUpper` in `output.token` units. For example, USDC-to-native uses USDC decimals for input amounts and native `wei` for output triggers.
1111
7. Future `start` delays the first fill. `epoch` is the delay between chunks, but it is not exact: each chunk can fill anywhere inside its epoch window, only once. Large `epoch` is not a delayed order by itself.
1212
8. Chunked orders should use `epoch > 0`; with `epoch = 0`, only the first chunk can fill.
1313
9. Defaults:
14-
`input.maxAmount = input.amount`, `nonce = now`, `start = now`, `epoch = 0` for single orders, `epoch = 60` for chunked orders, `deadline = start + 300 + chunkCount * epoch`, `slippage = 500`, `output.limit = 0`, `output.triggerLower = 0`, `output.triggerUpper = 0`, `output.recipient = swapper`.
14+
`input.maxAmount = input.amount`, `nonce = now`, `start = now`, `epoch = 0` for single orders, `epoch = 60` for chunked orders, `freshness = 50`, `deadline = start + 300 + chunkCount * epoch`, `slippage = 500`, `output.limit = 0`, `output.triggerLower = 0`, `output.triggerUpper = 0`, `output.recipient = swapper`. When replacing `<EPOCH_SECONDS>` for a recurring order, choose a value greater than `freshness`.
1515
10. Validation:
16-
`start != 0`, `input.amount != 0`, `input.amount <= input.maxAmount`, `input.token != output.token`, `output.triggerLower <= output.triggerUpper` when `triggerUpper != 0`, `slippage <= 5000`, non-zero `epoch >= 31`, and `freshness = 30 < epoch` when `epoch != 0`.
16+
`start != 0`, `input.amount != 0`, `input.amount <= input.maxAmount`, `input.token != output.token`, `output.triggerLower <= output.triggerUpper` when `triggerUpper != 0`, `slippage <= 5000`, `freshness != 0`, `freshness < epoch` when `epoch != 0`, and non-zero `epoch >= 60`.
1717
11. Higher slippage is still protected by oracle pricing and offchain executors.
1818
12. `output.recipient` is dangerous to change away from `swapper`.
1919
13. Native input is not supported. Wrap to WNATIVE first. Native output, including back-to-native orders, is supported directly with `output.token = 0x0000000000000000000000000000000000000000`.

0 commit comments

Comments
 (0)