Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
9cfa2ee
Multichain add gmx acc gm deposit
midas-myth Jul 22, 2025
249df5c
Implement crosschain deposit functionality
midas-myth Aug 1, 2025
e070a1a
Multichain lp
midas-myth Aug 5, 2025
337610d
Refactor multichain deposit
midas-myth Aug 6, 2025
2134728
Multichain fix tests
midas-myth Aug 6, 2025
b35d637
GmDepositWithdrawalBox remove unused state
midas-myth Aug 6, 2025
359f9cf
Refactor multichain deposit
midas-myth Aug 7, 2025
7d97554
multichain gm eth
midas-myth Aug 7, 2025
7927495
Refactor GmDepositWithdrawalBox
midas-myth Aug 8, 2025
5fe5fec
Multichain update contracts addresses
midas-myth Aug 14, 2025
6fb9b7b
Merge branch 'release-82' of github.com:gmx-io/gmx-interface into mul…
midas-myth Sep 15, 2025
7ac49de
Multichain lp mark correct pay source for second token in pair
midas-myth Sep 15, 2025
646f99c
Multichain lp reset pay source on gm tradebox change
midas-myth Sep 15, 2025
c8ad488
Multichain lp rename pay source type
midas-myth Sep 15, 2025
b8f7233
Multichain change pools header
midas-myth Sep 15, 2025
a27dda4
Sync translations
midas-myth Sep 15, 2025
671626b
Multichain LP big txn refactor
midas-myth Sep 18, 2025
11e6322
Merge branch 'release-82' of github.com:gmx-io/gmx-interface into mul…
midas-myth Sep 18, 2025
70f24d0
Multichain LP init all txn
midas-myth Sep 22, 2025
9e54846
Multichain LP single sell
midas-myth Sep 23, 2025
a6d08b2
Merge branch 'release-83' of github.com:gmx-io/gmx-interface into mul…
midas-myth Sep 25, 2025
20c56d8
Replace icon components
midas-myth Sep 25, 2025
641583a
Merge branch 'master' of github.com:gmx-io/gmx-interface into multich…
midas-myth Sep 25, 2025
f3cbcef
Multichain lp glv sell to single
midas-myth Sep 25, 2025
6f6425f
Refactor expressTransactionBuilder condition for clarity
midas-myth Sep 26, 2025
ebdbc71
pass signature to setClaims no matter what type of account is used
hubert-de-lalye Oct 10, 2025
cac640e
Merge branch 'release-85' of github.com:gmx-io/gmx-interface into mul…
midas-myth Oct 10, 2025
80dbe52
Merge branch 'release-85' into multichain-lp
midas-myth Oct 10, 2025
be9924f
Merge branch 'release-85' of github.com:gmx-io/gmx-interface into mul…
midas-myth Oct 10, 2025
3768399
Merge branch 'release-86' of github.com:gmx-io/gmx-interface into mul…
midas-myth Oct 14, 2025
6f09be7
Multichain LP enhancement
midas-myth Oct 20, 2025
806a89a
Merge branch 'release-86' of github.com:gmx-io/gmx-interface into mul…
midas-myth Oct 20, 2025
3d824b3
Multichain fix lint errors
midas-myth Oct 20, 2025
b4d06e6
Multichain enhancements
midas-myth Oct 21, 2025
3a89e55
Sync translations
midas-myth Oct 21, 2025
75bc286
Multichain LP enhancement
midas-myth Oct 21, 2025
a3a9b96
Merge pull request #1967 from gmx-io/release-86
qwinndev Oct 23, 2025
c3a5b97
added limits for subsquid queries on homepage
hubert-de-lalye Oct 23, 2025
c999f7d
Merge pull request #1990 from gmx-io/hotfix-squid-queries-on-homepage
hubert-de-lalye Oct 23, 2025
81659af
Merge branch 'master' into hotfix-safe-multisig
hubert-de-lalye Oct 24, 2025
c97dc68
Merge pull request #1955 from gmx-io/hotfix-safe-multisig
qwinndev Oct 24, 2025
221c4ca
fixed types in useAccountType
hubert-de-lalye Oct 24, 2025
91b70aa
Merge pull request #1992 from gmx-io/hotfix-safe-multisig
hubert-de-lalye Oct 24, 2025
4c1a867
Fix price chart timestamp
qwinndev Oct 24, 2025
0d7deca
Merge pull request #1993 from gmx-io/hotfix-price-chart-timestamp
qwinndev Oct 24, 2025
7a1c367
Hotfix footer links
qwinndev Oct 24, 2025
98af48e
Merge pull request #1994 from gmx-io/hotfix-footer-links
qwinndev Oct 24, 2025
0a4397f
Hotfix colorful banners across app
qwinndev Oct 24, 2025
a848d49
Update withdrawal view banner
qwinndev Oct 25, 2025
0bb81cb
Merge pull request #1995 from gmx-io/hotfix-colorful-banners-across-app
qwinndev Oct 27, 2025
9d0598c
fixed SDK's readme
hubert-de-lalye Oct 27, 2025
eecd922
Merge pull request #1996 from gmx-io/hotfix-sdk-readme
hubert-de-lalye Oct 27, 2025
44445ea
used LLM to improve SDK's readme wording
hubert-de-lalye Oct 27, 2025
3ac206f
Merge pull request #1997 from gmx-io/hotfix-sdk-readme
hubert-de-lalye Oct 28, 2025
8cf029b
Merge pull request #1999 from gmx-io/master
qwinndev Oct 28, 2025
181c079
Merge branch 'release-87' of github.com:gmx-io/gmx-interface into mul…
midas-myth Oct 28, 2025
f1ab7b2
Refactor PoolsDetailsContext: Migrate hooks and selectors to improve …
midas-myth Oct 28, 2025
1226c0c
Enhance deposit and withdrawal transaction handling: Introduce flags …
midas-myth Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .yarn/patches/viem-npm-2.37.1-7013552341
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ index 2fa2d166d6e708ad2adea724a2e20f40b0b9ac88..032498f54ab08dfba43dd125637f0c70
export type ByteArray = Uint8Array;
-export type Hex = `0x${string}`;
+export type Hex = string
export type Hash = `0x${string}`;
-export type Hash = `0x${string}`;
+export type Hash = string;
export type LogTopic = Hex | Hex[] | null;
export type SignableMessage = string | {
diff --git a/types/misc.ts b/types/misc.ts
Expand All @@ -20,6 +21,7 @@ index 625ba085cc64d197faff2f981ff06e706c2898a0..59e49bec00ac4a7a2f351c1406a35676
export type ByteArray = Uint8Array
-export type Hex = `0x${string}`
+export type Hex = string
export type Hash = `0x${string}`
-export type Hash = `0x${string}`
+export type Hash = string
export type LogTopic = Hex | Hex[] | null
export type SignableMessage =
4 changes: 2 additions & 2 deletions landing/src/pages/Home/hooks/usePoolsData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ function useApysByChainId(chainId: number) {
const marketInfoQuery = {
query: gql`
query MarketInfos {
marketInfos(orderBy: poolValue_DESC, where: { isDisabled_eq: false }) {
marketInfos(orderBy: poolValue_DESC, where: { isDisabled_eq: false }, limit: 1000) {
poolValue
longOpenInterestUsd
shortOpenInterestUsd
id
}
platformStats {
platformStats(limit: 1) {
depositedUsers
}
}
Expand Down
74 changes: 37 additions & 37 deletions sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# <img src="https://app.gmx.io/favicon/apple-icon-144x144.png" width="28" height="28"> GMX SDK

## Install
## Installation

```bash
yarn add @gmx-io/sdk # or
npm install --save @gmx-io/sdk
```

## Usage
## Getting Started

```typescript
import { GmxSdk } from "@gmx-io/sdk";
Expand Down Expand Up @@ -37,50 +37,50 @@ sdk.positions
});
```

## Documentation
## API Reference

### Read methods
### Read Methods

### Markets

- `getMarkets(offset?: number, limit?: number): Promise<Market[]>` - returns a list of markets
- `getMarketsInfo(): Promise<{ marketsInfoData: MarketInfoData[], tokensData: TokenData[] }>` - returns a list of markets info and tokens data
- `getDailyVolumes(): Promise<{market: string; volume: bigint}[]>` - returns markets' daily volume data
- `getMarkets(offset?: number, limit?: number): Promise<Market[]>` - fetches a list of available markets
- `getMarketsInfo(): Promise<{ marketsInfoData: MarketInfoData[], tokensData: TokenData[] }>` - retrieves detailed market information along with token data
- `getDailyVolumes(): Promise<{market: string; volume: bigint}[]>` - gets daily trading volume for each market

### Positions

- `getPositions(): Promise<Position[]>` - returns a list of positions
- `getPositions(): Promise<Position[]>` - retrieves all open positions

### Tokens

- `getTokensData(): Promise<TokenData[]>` - returns a list of tokens data
- `getTokensData(): Promise<TokenData[]>` - fetches data for all available tokens

### Orders

- `getOrders(): Promise<Order[]>` - returns a list of orders
- `getOrders(): Promise<Order[]>` - retrieves all active orders

### Trades

- `getTradeHistory(p: Parameters): Promise<TradeAction[]>` - returns a list of trades
- `getTradeHistory(p: Parameters): Promise<TradeAction[]>` - fetches historical trade data

### Write methods
### Write Methods

### Orders

#### Quick methods:
#### Quick Methods:

- `long(p: Parameters)` - creates long positions (see [examples](#helpers))
- `short(p: Parameters)` - creates short positions (see [examples](#helpers))
- `swap(p: Parameters)` - creates a swap order (see [examples](#helpers))
- `long(p: Parameters)` - opens a long position (see [examples](#helpers))
- `short(p: Parameters)` - opens a short position (see [examples](#helpers))
- `swap(p: Parameters)` - executes a token swap (see [examples](#helpers))

#### Full methods:
#### Full Methods:

- `cancelOrders(orderKeys: string[])` - cancels orders by order keys
- `createIncreaseOrder(p: Parameters)` - creates an increase order (see [examples](#examples))
- `createDecreaseOrder(p: Parameters)` - creates a decrease order (see [examples](#examples))
- `createSwapOrder(p: Parameters)` - creates a swap order (see [examples](#examples))
- `cancelOrders(orderKeys: string[])` - cancels one or more orders using their keys
- `createIncreaseOrder(p: Parameters)` - creates an order to increase position size (see [examples](#examples))
- `createDecreaseOrder(p: Parameters)` - creates an order to decrease position size (see [examples](#examples))
- `createSwapOrder(p: Parameters)` - creates a token swap order (see [examples](#examples))

## Configuration
## Configuration Options

```typescript
interface GmxSdkConfig {
Expand All @@ -101,9 +101,9 @@ interface GmxSdkConfig {
}
```

### Custom Viem clients
### Setting Up Custom Viem Clients

When using custom Viem clients, pass batching configuration to the client.
When working with custom Viem clients, make sure to include the batching configuration:

```typescript
import { BATCH_CONFIGS } from "@gmx-io/sdk/configs/batch";
Expand All @@ -114,15 +114,15 @@ const publicClient = createPublicClient({
});
```

### Urls
### Network URLs

- RPC URLs - use preferred RPC URL
- [Actual Oracle URLs](https://github.com/gmx-io/gmx-interface/blob/master/src/config/oracleKeeper.ts#L5-L11)
- [Actual Subsquid/Subgraph URLs](https://github.com/gmx-io/gmx-interface/blob/master/src/config/subgraph.ts#L5) (subgraph url is `synthetics-stats` field)
- RPC URLs - use your preferred RPC endpoint
- [Current Oracle URLs](https://github.com/gmx-io/gmx-interface/blob/master/src/config/oracleKeeper.ts#L5-L11)
- [Current Subsquid/Subgraph URLs](https://github.com/gmx-io/gmx-interface/blob/master/src/config/subgraph.ts#L5) (the subgraph url corresponds to the `synthetics-stats` field)

### Tokens customization
### Customizing Token Data

If you need to override some field in tokens, just pass extension object in SDK config:
You can override default token properties by passing an extension object in the SDK configuration:

```typescript
const sdk = new GmxSdk({
Expand All @@ -135,11 +135,11 @@ const sdk = new GmxSdk({
});
```

Here and further, `name` field in tokens data object will be taken from the extension object.
With this configuration, the `name` field for this token will use your custom value throughout the SDK.

### Markets customization
### Customizing Market Availability

To enable/disable market in SDK use config field `markets
To control which markets are available in the SDK, use the `markets` configuration field:

```typescript
const sdk = new GmxSdk({
Expand All @@ -152,9 +152,9 @@ const sdk = new GmxSdk({
});
```

## Examples
## Usage Examples

### Open long position
### Opening a Long Position

```typescript
import type { IncreasePositionAmounts } from "@gmx-io/sdk/types/orders";
Expand Down Expand Up @@ -209,7 +209,7 @@ sdk.orders.createIncreaseOrder({

### Helpers

Helpers are a set of functions that help you create orders without manually calculating the amounts, swap paths, etc. By default helpers will fetch the latest data from the API, but you can pass both `marketsInfoData` and `tokensData` to the helpers to avoid extra calls to the API.
Helper functions simplify order creation by automatically calculating amounts, swap paths, and other parameters. By default, helpers fetch the latest data from the API, but you can optionally pass `marketsInfoData` and `tokensData` yourself to reduce API calls.

```typescript
sdk.orders.long({
Expand All @@ -229,4 +229,4 @@ sdk.orders.swap({
});
```

Pay attention to the `payTokenAddress` and `collateralTokenAddress` fields. They are the addresses of ERC20 tokens that you are paying for and receiving, respectively, some markets may have synthetic tokens in these fields, so you need to pass the correct address. For instance BTC/USD [WETH-USDC] market has synthetic BTC token in `indexTokenAddress` so you need to pass WBTC address instead of BTC.
Note the distinction between `payTokenAddress` and `collateralTokenAddress`. These represent the ERC20 token addresses for payment and collateral respectively. Some markets use synthetic tokens, so you'll need to provide the correct underlying token address. For example, the BTC/USD [WETH-USDC] market has a synthetic BTC token as its `indexTokenAddress`, so you should pass the WBTC address instead of BTC.
Loading