Skip to content

Commit b321fa3

Browse files
committed
chore: Change ymax fixed fee to 30 BLD
1 parent 539438c commit b321fa3

File tree

4 files changed

+58
-57
lines changed

4 files changed

+58
-57
lines changed

packages/portfolio-contract/src/plan-solve.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,12 @@ export const rebalanceMinCostFlowSteps = (
436436
case 'gmpTransfer':
437437
// TODO: Rather than hard-code, derive from Axelar `estimateGasFee`.
438438
// https://docs.axelar.dev/dev/axelarjs-sdk/axelar-query-api#estimategasfee
439-
details = { fee: AmountMath.make(graph.feeBrand, 15_000_000n) };
439+
details = { fee: AmountMath.make(graph.feeBrand, 30_000_000n) };
440440
break;
441441
case 'gmpCall':
442442
// TODO: Rather than hard-code, derive from Axelar `estimateGasFee`.
443443
// https://docs.axelar.dev/dev/axelarjs-sdk/axelar-query-api#estimategasfee
444-
details = { fee: AmountMath.make(graph.feeBrand, 15_000_000n) };
444+
details = { fee: AmountMath.make(graph.feeBrand, 30_000_000n) };
445445
break;
446446
case 'toUSDN': {
447447
// NOTE USDN transfer incurs a fee on output amount in basis points

packages/portfolio-contract/test/rebalance.test.ts

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const { brand: FEE_BRAND } = (() => ({ brand: Far('BLD') as Brand<'nat'> }))();
3030
const token = (v: bigint) => AmountMath.make(TOK_BRAND, v);
3131
const fee = (v: bigint) => AmountMath.make(FEE_BRAND, v);
3232
const ZERO = token(0n);
33+
const fixedFee = fee(30_000_000n);
3334

3435
// Pools
3536
const A = 'Aave_Arbitrum';
@@ -70,17 +71,17 @@ testWithAllModes('solver simple 2-pool case (A -> B 30)', async (t, mode) => {
7071

7172
t.deepEqual(steps, [
7273
// leaf -> hub
73-
{ src: A, dest: '@Arbitrum', amount: token(30n), fee: fee(15_000_000n) },
74+
{ src: A, dest: '@Arbitrum', amount: token(30n), fee: fixedFee },
7475
// hub -> hub legs
7576
{ src: '@Arbitrum', dest: '@noble', amount: token(30n) },
7677
{
7778
src: '@noble',
7879
dest: '@Avalanche',
7980
amount: token(30n),
80-
fee: fee(15_000_000n),
81+
fee: fixedFee,
8182
},
8283
// hub -> leaf
83-
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fee(15_000_000n) },
84+
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fixedFee },
8485
]);
8586
});
8687

@@ -102,24 +103,24 @@ testWithAllModes(
102103
const amt33 = token(33n);
103104
t.deepEqual(steps, [
104105
// leaf -> hub (aggregated outflow from A)
105-
{ src: A, dest: '@Arbitrum', amount: amt66, fee: fee(15_000_000n) },
106+
{ src: A, dest: '@Arbitrum', amount: amt66, fee: fixedFee },
106107
// hub -> hub aggregated then split
107108
{ src: '@Arbitrum', dest: '@noble', amount: amt66 },
108109
{
109110
src: '@noble',
110111
dest: '@Avalanche',
111112
amount: amt33,
112-
fee: fee(15_000_000n),
113+
fee: fixedFee,
113114
},
114115
{
115116
src: '@noble',
116117
dest: '@Ethereum',
117118
amount: amt33,
118-
fee: fee(15_000_000n),
119+
fee: fixedFee,
119120
},
120121
// hub -> leaf
121-
{ src: '@Avalanche', dest: B, amount: amt33, fee: fee(15_000_000n) },
122-
{ src: '@Ethereum', dest: C, amount: amt33, fee: fee(15_000_000n) },
122+
{ src: '@Avalanche', dest: B, amount: amt33, fee: fixedFee },
123+
{ src: '@Ethereum', dest: C, amount: amt33, fee: fixedFee },
123124
]);
124125
},
125126
);
@@ -149,17 +150,17 @@ testWithAllModes('solver all to one (B + C -> A)', async (t, mode) => {
149150
feeBrand: FEE_BRAND,
150151
});
151152
t.deepEqual(steps, [
152-
{ src: B, dest: '@Avalanche', amount: token(20n), fee: fee(15_000_000n) },
153+
{ src: B, dest: '@Avalanche', amount: token(20n), fee: fixedFee },
153154
{ src: '@Avalanche', dest: '@noble', amount: token(20n) },
154-
{ src: C, dest: '@Ethereum', amount: token(70n), fee: fee(15_000_000n) },
155+
{ src: C, dest: '@Ethereum', amount: token(70n), fee: fixedFee },
155156
{ src: '@Ethereum', dest: '@noble', amount: token(70n) },
156157
{
157158
src: '@noble',
158159
dest: '@Arbitrum',
159160
amount: token(90n),
160-
fee: fee(15_000_000n),
161+
fee: fixedFee,
161162
},
162-
{ src: '@Arbitrum', dest: A, amount: token(90n), fee: fee(15_000_000n) },
163+
{ src: '@Arbitrum', dest: A, amount: token(90n), fee: fixedFee },
163164
]);
164165
});
165166

@@ -177,22 +178,22 @@ testWithAllModes(
177178
feeBrand: FEE_BRAND,
178179
});
179180
t.deepEqual(steps, [
180-
{ src: A, dest: '@Arbitrum', amount: token(100n), fee: fee(15_000_000n) },
181+
{ src: A, dest: '@Arbitrum', amount: token(100n), fee: fixedFee },
181182
{ src: '@Arbitrum', dest: '@noble', amount: token(100n) },
182183
{
183184
src: '@noble',
184185
dest: '@Avalanche',
185186
amount: token(60n),
186-
fee: fee(15_000_000n),
187+
fee: fixedFee,
187188
},
188189
{
189190
src: '@noble',
190191
dest: '@Ethereum',
191192
amount: token(40n),
192-
fee: fee(15_000_000n),
193+
fee: fixedFee,
193194
},
194-
{ src: '@Avalanche', dest: B, amount: token(60n), fee: fee(15_000_000n) },
195-
{ src: '@Ethereum', dest: C, amount: token(40n), fee: fee(15_000_000n) },
195+
{ src: '@Avalanche', dest: B, amount: token(60n), fee: fixedFee },
196+
{ src: '@Ethereum', dest: C, amount: token(40n), fee: fixedFee },
196197
]);
197198
},
198199
);
@@ -210,17 +211,17 @@ testWithAllModes(
210211
feeBrand: FEE_BRAND,
211212
});
212213
t.deepEqual(steps, [
213-
{ src: B, dest: '@Avalanche', amount: token(30n), fee: fee(15_000_000n) },
214+
{ src: B, dest: '@Avalanche', amount: token(30n), fee: fixedFee },
214215
{ src: '@Avalanche', dest: '@noble', amount: token(30n) },
215-
{ src: C, dest: '@Ethereum', amount: token(70n), fee: fee(15_000_000n) },
216+
{ src: C, dest: '@Ethereum', amount: token(70n), fee: fixedFee },
216217
{ src: '@Ethereum', dest: '@noble', amount: token(70n) },
217218
{
218219
src: '@noble',
219220
dest: '@Arbitrum',
220221
amount: token(100n),
221-
fee: fee(15_000_000n),
222+
fee: fixedFee,
222223
},
223-
{ src: '@Arbitrum', dest: A, amount: token(100n), fee: fee(15_000_000n) },
224+
{ src: '@Arbitrum', dest: A, amount: token(100n), fee: fixedFee },
224225
]);
225226
},
226227
);
@@ -244,16 +245,16 @@ testWithAllModes(
244245
src: '@noble',
245246
dest: '@Arbitrum',
246247
amount: token(70n),
247-
fee: fee(15_000_000n),
248+
fee: fixedFee,
248249
},
249250
{
250251
src: '@noble',
251252
dest: '@Avalanche',
252253
amount: token(30n),
253-
fee: fee(15_000_000n),
254+
fee: fixedFee,
254255
},
255-
{ src: '@Arbitrum', dest: A, amount: token(70n), fee: fee(15_000_000n) },
256-
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fee(15_000_000n) },
256+
{ src: '@Arbitrum', dest: A, amount: token(70n), fee: fixedFee },
257+
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fixedFee },
257258
]);
258259
},
259260
);
@@ -279,16 +280,16 @@ testWithAllModes(
279280
src: '@noble',
280281
dest: '@Arbitrum',
281282
amount: token(70n),
282-
fee: fee(15_000_000n),
283+
fee: fixedFee,
283284
},
284285
{
285286
src: '@noble',
286287
dest: '@Avalanche',
287288
amount: token(30n),
288-
fee: fee(15_000_000n),
289+
fee: fixedFee,
289290
},
290-
{ src: '@Arbitrum', dest: A, amount: token(70n), fee: fee(15_000_000n) },
291-
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fee(15_000_000n) },
291+
{ src: '@Arbitrum', dest: A, amount: token(70n), fee: fixedFee },
292+
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fixedFee },
292293
]);
293294
},
294295
);
@@ -306,9 +307,9 @@ testWithAllModes(
306307
feeBrand: FEE_BRAND,
307308
});
308309
t.deepEqual(steps, [
309-
{ src: A, dest: '@Arbitrum', amount: token(50n), fee: fee(15_000_000n) },
310+
{ src: A, dest: '@Arbitrum', amount: token(50n), fee: fixedFee },
310311
{ src: '@Arbitrum', dest: '@noble', amount: token(50n) },
311-
{ src: B, dest: '@Avalanche', amount: token(30n), fee: fee(15_000_000n) },
312+
{ src: B, dest: '@Avalanche', amount: token(30n), fee: fixedFee },
312313
{ src: '@Avalanche', dest: '@noble', amount: token(30n) },
313314
{ src: '@noble', dest: '@agoric', amount: token(80n) },
314315
{ src: '@agoric', dest: '<Cash>', amount: token(80n) },
@@ -343,15 +344,15 @@ testWithAllModes(
343344
feeBrand: FEE_BRAND,
344345
});
345346
t.deepEqual(steps, [
346-
{ src: '@Arbitrum', dest: A, amount: token(30n), fee: fee(15_000_000n) },
347-
{ src: '@Avalanche', dest: B, amount: token(20n), fee: fee(15_000_000n) },
347+
{ src: '@Arbitrum', dest: A, amount: token(30n), fee: fixedFee },
348+
{ src: '@Avalanche', dest: B, amount: token(20n), fee: fixedFee },
348349
{
349350
src: '@noble',
350351
dest: '@Ethereum',
351352
amount: token(20n),
352-
fee: fee(15_000_000n),
353+
fee: fixedFee,
353354
},
354-
{ src: '@Ethereum', dest: C, amount: token(20n), fee: fee(15_000_000n) },
355+
{ src: '@Ethereum', dest: C, amount: token(20n), fee: fixedFee },
355356
]);
356357
},
357358
);
@@ -394,16 +395,16 @@ testWithAllModes(
394395
src: '@noble',
395396
dest: '@Arbitrum',
396397
amount: token(300n),
397-
fee: fee(15_000_000n),
398+
fee: fixedFee,
398399
},
399400
{
400401
src: '@noble',
401402
dest: '@Ethereum',
402403
amount: token(200n),
403-
fee: fee(15_000_000n),
404+
fee: fixedFee,
404405
},
405-
{ src: '@Arbitrum', dest: A, amount: token(300n), fee: fee(15_000_000n) },
406-
{ src: '@Ethereum', dest: C, amount: token(200n), fee: fee(15_000_000n) },
406+
{ src: '@Arbitrum', dest: A, amount: token(300n), fee: fixedFee },
407+
{ src: '@Ethereum', dest: C, amount: token(200n), fee: fixedFee },
407408
]);
408409
},
409410
);
@@ -448,16 +449,16 @@ testWithAllModes(
448449
src: '@noble',
449450
dest: '@Arbitrum',
450451
amount: token(220n),
451-
fee: fee(15_000_000n),
452+
fee: fixedFee,
452453
},
453454
{
454455
src: '@noble',
455456
dest: '@Ethereum',
456457
amount: token(160n),
457-
fee: fee(15_000_000n),
458+
fee: fixedFee,
458459
},
459-
{ src: '@Arbitrum', dest: A, amount: token(220n), fee: fee(15_000_000n) },
460-
{ src: '@Ethereum', dest: C, amount: token(160n), fee: fee(15_000_000n) },
460+
{ src: '@Arbitrum', dest: A, amount: token(220n), fee: fixedFee },
461+
{ src: '@Ethereum', dest: C, amount: token(160n), fee: fixedFee },
461462
]);
462463
},
463464
);
@@ -506,15 +507,15 @@ testWithAllModes(
506507

507508
// Identical to the 2-pool case; no steps to/from C
508509
t.deepEqual(steps, [
509-
{ src: A, dest: '@Arbitrum', amount: token(30n), fee: fee(15_000_000n) },
510+
{ src: A, dest: '@Arbitrum', amount: token(30n), fee: fixedFee },
510511
{ src: '@Arbitrum', dest: '@noble', amount: token(30n) },
511512
{
512513
src: '@noble',
513514
dest: '@Avalanche',
514515
amount: token(30n),
515-
fee: fee(15_000_000n),
516+
fee: fixedFee,
516517
},
517-
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fee(15_000_000n) },
518+
{ src: '@Avalanche', dest: B, amount: token(30n), fee: fixedFee },
518519
]);
519520
},
520521
);
@@ -576,7 +577,7 @@ test.failing('solver differentiates cheapest vs. fastest', async t => {
576577
src: '@agoric',
577578
dest: '@External',
578579
amount: token(100n),
579-
fee: fee(15_000_000n),
580+
fee: fixedFee,
580581
},
581582
{ src: '@External', dest: 'Sink_External', amount: token(100n) },
582583
]);
@@ -600,7 +601,7 @@ test.failing('solver differentiates cheapest vs. fastest', async t => {
600601
src: '@agoric',
601602
dest: '@External',
602603
amount: token(100n),
603-
fee: fee(15_000_000n),
604+
fee: fixedFee,
604605
},
605606
{ src: '@External', dest: 'Sink_External', amount: token(100n) },
606607
]);

services/ymax-planner/test/snapshots/deposit-tools.test.ts.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Generated by [AVA](https://avajs.dev).
4747
dest: '@Arbitrum',
4848
fee: {
4949
brand: Object @Alleged: fee brand (BLD) {},
50-
value: 15000000n,
50+
value: 30000000n,
5151
},
5252
src: '@noble',
5353
},
@@ -59,7 +59,7 @@ Generated by [AVA](https://avajs.dev).
5959
dest: 'Aave_Arbitrum',
6060
fee: {
6161
brand: Object @Alleged: fee brand (BLD) {},
62-
value: 15000000n,
62+
value: 30000000n,
6363
},
6464
src: '@Arbitrum',
6565
},
@@ -71,7 +71,7 @@ Generated by [AVA](https://avajs.dev).
7171
dest: 'Compound_Arbitrum',
7272
fee: {
7373
brand: Object @Alleged: fee brand (BLD) {},
74-
value: 15000000n,
74+
value: 30000000n,
7575
},
7676
src: '@Arbitrum',
7777
},
@@ -129,7 +129,7 @@ Generated by [AVA](https://avajs.dev).
129129
dest: '@Avalanche',
130130
fee: {
131131
brand: Object @Alleged: fee brand (BLD) {},
132-
value: 15000000n,
132+
value: 30000000n,
133133
},
134134
src: '@noble',
135135
},
@@ -141,7 +141,7 @@ Generated by [AVA](https://avajs.dev).
141141
dest: '@Ethereum',
142142
fee: {
143143
brand: Object @Alleged: fee brand (BLD) {},
144-
value: 15000000n,
144+
value: 30000000n,
145145
},
146146
src: '@noble',
147147
},
@@ -153,7 +153,7 @@ Generated by [AVA](https://avajs.dev).
153153
dest: 'Compound_Ethereum',
154154
fee: {
155155
brand: Object @Alleged: fee brand (BLD) {},
156-
value: 15000000n,
156+
value: 30000000n,
157157
},
158158
src: '@Ethereum',
159159
},
@@ -165,7 +165,7 @@ Generated by [AVA](https://avajs.dev).
165165
dest: 'Aave_Avalanche',
166166
fee: {
167167
brand: Object @Alleged: fee brand (BLD) {},
168-
value: 15000000n,
168+
value: 30000000n,
169169
},
170170
src: '@Avalanche',
171171
},
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)