Skip to content

Commit ee21c5f

Browse files
committed
fix: max leverage to 10x
1 parent ff780a7 commit ee21c5f

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

packages/apps/ability-hyperliquid/src/generated/lit-action.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"ipfsCid": "QmbWiHwBJq3X59qeibfGmjBPVKj4ti6hFUxCvCnw1r84Ec"
2+
"ipfsCid": "QmTE5cjdcMp8teZyni4D6SA9LVsSsH2HuKwfwQpUskqG8E"
33
}

packages/apps/ability-hyperliquid/src/lib/ability-helpers/execute-perp-order.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ export interface PerpTradeParams {
2828
orderType?: { type: 'limit'; tif: TimeInForce } | { type: 'market' };
2929
/**
3030
* Leverage configuration.
31-
* @default { leverage: 2, isCross: true }
31+
* Required parameter - must specify leverage (1-10x) and margin type.
3232
*/
33-
leverage?: {
34-
leverage: number; // 1-50x
33+
leverage: {
34+
leverage: number; // 1-10x
3535
isCross: boolean; // true for cross margin, false for isolated
3636
};
3737
}

packages/apps/ability-hyperliquid/src/lib/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const perpTradeParamsSchema = z.object({
6262
symbol: z.string().describe('Perpetual symbol (e.g., "ETH")'),
6363
price: z.string().describe('Limit price'),
6464
size: z.string().describe('Order size in base asset'),
65-
leverage: z.number().min(1).max(50).optional().describe('Leverage multiplier (default: 2x)'),
65+
leverage: z.number().min(1).max(10).describe('Leverage multiplier (1-10x)'),
6666
isCross: z.boolean().optional().describe('Cross leverage (default: true)'),
6767
reduceOnly: z
6868
.boolean()

packages/apps/ability-hyperliquid/src/lib/vincent-ability.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,12 +457,10 @@ export const vincentAbility = createVincentAbility({
457457
isLong: action === 'perpLong',
458458
reduceOnly: abilityParams.perp.reduceOnly,
459459
orderType: abilityParams.perp.orderType,
460-
leverage: abilityParams.perp.leverage
461-
? {
462-
leverage: abilityParams.perp.leverage,
463-
isCross: abilityParams.perp.isCross ?? true,
464-
}
465-
: undefined,
460+
leverage: {
461+
leverage: abilityParams.perp.leverage,
462+
isCross: abilityParams.perp.isCross ?? true,
463+
},
466464
},
467465
useTestnet,
468466
});

packages/apps/ability-hyperliquid/test/e2e/perp/long.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ describe('Hyperliquid Ability E2E Perp Long Tests', () => {
228228
size: longSize,
229229
leverage: LEVERAGE,
230230
isCross: IS_CROSS,
231-
reduceOnly: true,
232231
orderType: { type: OrderType.MARKET },
233232
},
234233
},

0 commit comments

Comments
 (0)