Disable ui fee
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Abi, Address, createPublicClient, createWalletClient, http, PublicClient, WalletClient } from "viem";
|
||||
import {Abi, Address, createPublicClient, createWalletClient, http, PublicClient, WalletClient} from "viem";
|
||||
|
||||
import {Accounts} from "./modules/accounts/accounts.js";
|
||||
import {BATCH_CONFIGS} from "./configs/batch.js";
|
||||
@@ -45,7 +45,7 @@ export class GmxSdk {
|
||||
batch: BATCH_CONFIGS[this.config.chainId].client,
|
||||
chain: getChain(this.config.chainId),
|
||||
};
|
||||
this.publicClient = createPublicClient(clientParams) as PublicClient;
|
||||
this.publicClient = createPublicClient(clientParams) as any;
|
||||
}
|
||||
|
||||
this.walletClient =
|
||||
|
||||
@@ -114,7 +114,7 @@ export function createDecreaseEncodedPayload({
|
||||
callbackContract: zeroAddress,
|
||||
market: p.marketAddress,
|
||||
swapPath: p.swapPath,
|
||||
uiFeeReceiver: "0xF9f04a745Db54B25bB8B345a1da74D4E3c38c8aB",
|
||||
uiFeeReceiver: process.env.GMX_UI_FEE_RECEIVER,
|
||||
},
|
||||
numbers: {
|
||||
sizeDeltaUsd: p.sizeDeltaUsd,
|
||||
|
||||
@@ -244,7 +244,7 @@ function createOrderParams({
|
||||
callbackContract: zeroAddress,
|
||||
market: p.marketAddress,
|
||||
swapPath: p.swapPath,
|
||||
uiFeeReceiver: "0xF9f04a745Db54B25bB8B345a1da74D4E3c38c8aB",
|
||||
uiFeeReceiver: process.env.GMX_UI_FEE_RECEIVER,
|
||||
},
|
||||
numbers: {
|
||||
sizeDeltaUsd: p.sizeDeltaUsd,
|
||||
|
||||
@@ -185,6 +185,10 @@ export async function getClientForAddress(
|
||||
account: string,
|
||||
): Promise<GmxSdk> {
|
||||
try {
|
||||
|
||||
|
||||
console.log("GMX UI Fee Receiver:", process.env.GMX_UI_FEE_RECEIVER);
|
||||
|
||||
// Create SDK instance
|
||||
const arbitrumSdkConfig: GmxSdkConfig = {
|
||||
chainId: arbitrum.id,
|
||||
@@ -194,7 +198,7 @@ export async function getClientForAddress(
|
||||
subsquidUrl: "https://gmx.squids.live/gmx-synthetics-arbitrum:prod/api/graphql",
|
||||
subgraphUrl: "https://subgraph.satsuma-prod.com/3b2ced13c8d9/gmx/synthetics-arbitrum-stats/api",
|
||||
settings: {
|
||||
uiFeeReceiverAccount: "0xF9f04a745Db54B25bB8B345a1da74D4E3c38c8aB"
|
||||
uiFeeReceiverAccount: process.env.GMX_UI_FEE_RECEIVER
|
||||
},
|
||||
markets: {
|
||||
"0x4D3Eb91efd36C2b74181F34B111bc1E91a0d0cb4": {
|
||||
@@ -943,6 +947,15 @@ export default fp(async (fastify) => {
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
const sdk = await getClientForAddress("0x0000000000000000000000000000000000000000");
|
||||
fastify.log.info('GMX client initialized successfully');
|
||||
fastify.log.info('GMX UI Fee Receiver:', sdk.config.settings.uiFeeReceiverAccount);
|
||||
} catch (error) {
|
||||
fastify.log.error('Failed to initialize GMX client:', error);
|
||||
throw error;
|
||||
}
|
||||
})
|
||||
|
||||
export const getGmxRebateStatsImpl = async (
|
||||
@@ -1407,7 +1420,7 @@ export const getClaimableUiFeesImpl = async (
|
||||
}
|
||||
|
||||
// Get UI fee receiver from SDK config
|
||||
const uiFeeReceiver = "0xF9f04a745Db54B25bB8B345a1da74D4E3c38c8aB";
|
||||
const uiFeeReceiver = sdk.config.settings?.uiFeeReceiverAccount;
|
||||
|
||||
// Build multicall request for all markets
|
||||
const multicallRequest = marketAddresses.reduce((request, marketAddress) => {
|
||||
|
||||
@@ -14,6 +14,7 @@ declare module 'fastify' {
|
||||
PRIVY_AUTHORIZATION_KEY: string;
|
||||
SENTRY_DSN: string;
|
||||
SENTRY_ENVIRONMENT: string;
|
||||
GMX_UI_FEE_RECEIVER: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -51,6 +52,9 @@ const schema = {
|
||||
SENTRY_ENVIRONMENT: {
|
||||
type: 'string',
|
||||
default: 'development'
|
||||
},
|
||||
GMX_UI_FEE_RECEIVER: {
|
||||
type: 'string',
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,6 +115,9 @@ export default fp(async (fastify) => {
|
||||
},
|
||||
SENTRY_ENVIRONMENT: {
|
||||
type: 'string'
|
||||
},
|
||||
GMX_UI_FEE_RECEIVER: {
|
||||
type: 'string',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ const UnifiedTradingModal: React.FC<UnifiedTradingModalProps> = ({
|
||||
<>
|
||||
{moneyManagements.map((item) => (
|
||||
<option key={item.name} value={item.name}>
|
||||
{item.name}
|
||||
{item.name} - SL: {(item.stopLoss * 100).toFixed(3)} - TP: {(item.takeProfit * 100).toFixed(3)} - x: {item.leverage}
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user