@mento-protocol/mento-sdk 1.17.1-beta.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -254,7 +254,7 @@ export declare class Mento {
254
254
  getRateFeedTradingMode(rateFeedId: Address): Promise<TradingMode>;
255
255
  /**
256
256
  * Checks if a trading pair is currently tradable (i.e., all rate feeds in the path are in BIDIRECTIONAL mode)
257
- * For multi-hop routes (e.g., CELO → cUSD → USDT), checks that all intermediate rate feeds are tradable
257
+ * For multi-hop routes (e.g., CELO → USDm → USDT), checks that all intermediate rate feeds are tradable
258
258
  * @param tokenIn the address of the token to sell
259
259
  * @param tokenOut the address of the token to buy
260
260
  * @returns true if the pair is tradable (all rate feeds in BIDIRECTIONAL mode), false otherwise
package/dist/esm/mento.js CHANGED
@@ -583,7 +583,7 @@ export class Mento {
583
583
  }
584
584
  /**
585
585
  * Checks if a trading pair is currently tradable (i.e., all rate feeds in the path are in BIDIRECTIONAL mode)
586
- * For multi-hop routes (e.g., CELO → cUSD → USDT), checks that all intermediate rate feeds are tradable
586
+ * For multi-hop routes (e.g., CELO → USDm → USDT), checks that all intermediate rate feeds are tradable
587
587
  * @param tokenIn the address of the token to sell
588
588
  * @param tokenOut the address of the token to buy
589
589
  * @returns true if the pair is tradable (all rate feeds in BIDIRECTIONAL mode), false otherwise
@@ -33,15 +33,15 @@ interface ExchangeDetails {
33
33
  *
34
34
  * CONCRETE EXAMPLE:
35
35
  * Given these direct trading pairs:
36
- * - cUSD ↔ CELO (direct exchange exists)
37
- * - CELO ↔ cEUR (direct exchange exists)
38
- * - cUSDcREAL (direct exchange exists)
36
+ * - USDm ↔ CELO (direct exchange exists)
37
+ * - CELO ↔ EURm (direct exchange exists)
38
+ * - USDmBRLm (direct exchange exists)
39
39
  *
40
40
  * How route finding works:
41
- * - Direct route: cUSDcEUR? Check token graph: cUSD connects to [CELO, cREAL], none is cEUR → No direct route
42
- * - Two-hop route: cUSD → ? → cEUR?
43
- * - cUSD connects to CELO, CELO connects to cEUR → Found route: cUSD → CELO → cEUR
44
- * - cUSD connects to cREAL, cREAL connects to [cUSD] → No route via cREAL
41
+ * - Direct route: USDmEURm? Check token graph: USDm connects to [CELO, BRLm], none is EURm → No direct route
42
+ * - Two-hop route: USDm → ? → EURm?
43
+ * - USDm connects to CELO, CELO connects to EURm → Found route: USDm → CELO → EURm
44
+ * - USDm connects to BRLm, BRLm connects to [USDm] → No route via BRLm
45
45
  *
46
46
  * The "connectivity" part means we can quickly traverse the network of
47
47
  * token connections to find all possible trading paths.
@@ -50,31 +50,31 @@ export interface ConnectivityData {
50
50
  /** Maps token address to symbol for efficient lookups
51
51
  *
52
52
  * ```
53
- * '0x765D...' → 'cUSD'
53
+ * '0x765D...' → 'USDm'
54
54
  * '0x471E...' → 'CELO'
55
- * '0xD876...' → 'cEUR'
55
+ * '0xD876...' → 'EURm'
56
56
  * ```
57
57
  */
58
58
  addrToSymbol: Map<Address, TokenSymbol>;
59
59
  /** Adjacency list mapping which tokens connect to which
60
60
  * Used for finding two-hop routes by traversing token → neighbor → neighbor.
61
61
  *
62
- * Example for a cUSD => cEUR swap: First we find cUSD → [CELO, cKES, ...]
63
- * Then we find CELO → [cUSD, cEUR, ...] = found route via cUSD → CELO → cEUR
62
+ * Example for a USDm => EURm swap: First we find USDm → [CELO, KESm, ...]
63
+ * Then we find CELO → [USDm, EURm, ...] = found route via USDm → CELO → EURm
64
64
  *
65
65
  * ```
66
- * 'cUSD_addr' → Set(['CELO_addr', 'cKES_addr']) // cUSD connects to CELO and cKES
67
- * 'CELO_addr' → Set(['cUSD_addr', 'cEUR_addr']) // CELO connects to cUSD and cEUR
68
- * 'cEUR_addr' → Set(['CELO_addr']) // cEUR connects to CELO
69
- * 'cKES_addr' → Set(['cUSD_addr']) // cKES connects to cUSD
66
+ * 'USDm_addr' → Set(['CELO_addr', 'KESm_addr']) // USDm connects to CELO and KESm
67
+ * 'CELO_addr' → Set(['USDm_addr', 'EURm_addr']) // CELO connects to USDm and EURm
68
+ * 'EURm_addr' → Set(['CELO_addr']) // EURm connects to CELO
69
+ * 'KESm_addr' → Set(['USDm_addr']) // KESm connects to USDm
70
70
  * ```
71
71
  */
72
72
  tokenGraph: Map<Address, Set<Address>>;
73
73
  /** Maps sorted token address pairs to their direct exchange hop details
74
74
  * ```
75
- * 'CELO_addr-cEUR_addr' → { exchange details for CELO ↔ cEUR }
76
- * 'CELO_addr-cUSD_addr' → { exchange details for CELO ↔ cUSD }
77
- * 'cUSD_addr-cKES_addr' → { exchange details for cUSDcKES }
75
+ * 'CELO_addr-EURm_addr' → { exchange details for CELO ↔ EURm }
76
+ * 'CELO_addr-USDm_addr' → { exchange details for CELO ↔ USDm }
77
+ * 'USDm_addr-KESm_addr' → { exchange details for USDmKESm }
78
78
  * ```
79
79
  */
80
80
  directPathMap: Map<TradablePairID, ExchangeDetails>;
@@ -91,23 +91,23 @@ export interface ConnectivityData {
91
91
  *
92
92
  * ```
93
93
  * Input: TradablePairs = [
94
- * { id: 'cUSD-CELO', assets: [cUSD, CELO], path: [exchange1_CELO_cUSD] },
95
- * { id: 'CELO-cEUR', assets: [CELO, cEUR], path: [exchange2_CELO_cEUR] }
94
+ * { id: 'USDm-CELO', assets: [USDm, CELO], path: [exchange1_CELO_USDm] },
95
+ * { id: 'CELO-EURm', assets: [CELO, EURm], path: [exchange2_CELO_EURm] }
96
96
  * ]
97
97
  *
98
98
  * Step 1 - Build addrToSymbol map:
99
- * cUSD.address → 'cUSD'
99
+ * USDm.address → 'USDm'
100
100
  * CELO.address → 'CELO'
101
- * cEUR.address → 'cEUR'
101
+ * EURm.address → 'EURm'
102
102
  *
103
103
  * Step 2 - Build directPathMap (sorted alphabetically for consistency):
104
- * 'CELO_addr-cEUR_addr' → exchange2_CELO_cEUR
105
- * 'CELO_addr-cUSD_addr' → exchange1_CELO_cUSD
104
+ * 'CELO_addr-EURm_addr' → exchange2_CELO_EURm
105
+ * 'CELO_addr-USDm_addr' → exchange1_CELO_USDm
106
106
  *
107
107
  * Step 3 - Build bidirectional tokenGraph:
108
- * cUSD.address → Set([CELO.address])
109
- * CELO.address → Set([cUSD.address, cEUR.address])
110
- * cEUR.address → Set([CELO.address])
108
+ * USDm.address → Set([CELO.address])
109
+ * CELO.address → Set([USDm.address, EURm.address])
110
+ * EURm.address → Set([CELO.address])
111
111
  * ```
112
112
  *
113
113
  * **Result**: We can now efficiently answer:
@@ -121,17 +121,17 @@ export interface ConnectivityData {
121
121
  * @example
122
122
  * ```typescript
123
123
  * const directPairs = [
124
- * { id: 'cUSD-CELO', assets: [cUSD, CELO], path: [exchange1] },
125
- * { id: 'CELO-cEUR', assets: [CELO, cEUR], path: [exchange2] }
124
+ * { id: 'USDm-CELO', assets: [USDm, CELO], path: [exchange1] },
125
+ * { id: 'CELO-EURm', assets: [CELO, EURm], path: [exchange2] }
126
126
  * ]
127
127
  *
128
128
  * const connectivityData = buildConnectivityStructures(directPairs)
129
129
  *
130
130
  * // Now we can efficiently find routes:
131
- * // 1. Check if cUSD connects to anything: connectivityData.tokenGraph.get(cUSD.address) → [CELO.address]
132
- * // 2. Check if CELO connects to cEUR: connectivityData.tokenGraph.get(CELO.address) → [cUSD.address, cEUR.address] ✓
133
- * // 3. Get exchange details: connectivityData.directPathMap.get('CELO_addr-cEUR_addr') → exchange2_CELO_cEUR
134
- * // Result: Found route cUSD → CELO → cEUR with exchange details
131
+ * // 1. Check if USDm connects to anything: connectivityData.tokenGraph.get(USDm.address) → [CELO.address]
132
+ * // 2. Check if CELO connects to EURm: connectivityData.tokenGraph.get(CELO.address) → [USDm.address, EURm.address] ✓
133
+ * // 3. Get exchange details: connectivityData.directPathMap.get('CELO_addr-EURm_addr') → exchange2_CELO_EURm
134
+ * // Result: Found route USDm → CELO → EURm with exchange details
135
135
  * ```
136
136
  */
137
137
  export declare function buildConnectivityStructures(directPairs: TradablePair[]): ConnectivityData;
@@ -151,21 +151,21 @@ export declare function buildConnectivityStructures(directPairs: TradablePair[])
151
151
  * the best one based on spread data or heuristics.
152
152
  *
153
153
  * **Canonical Pair IDs**: All pairs use alphabetically sorted symbols
154
- * (e.g., 'cEUR-cUSD' not 'cUSD-cEUR') for consistent identification.
154
+ * (e.g., 'EURm-USDm' not 'USDm-EURm') for consistent identification.
155
155
  *
156
156
  * @param connectivityData - The connectivity data from buildConnectivityStructures()
157
157
  * @returns Map of pair ID -> array of possible routes for that pair
158
158
  *
159
159
  * @example
160
160
  * ```typescript
161
- * // Given direct pairs: cUSD-CELO, CELO-cEUR, cUSD-USDC
161
+ * // Given direct pairs: USDm-CELO, CELO-EURm, USDm-USDC
162
162
  * const allRoutes = generateAllRoutes(connectivityData)
163
163
  *
164
164
  * // Results might include:
165
- * // 'cUSD-CELO' -> [{ path: [cUSD->CELO] }] // direct route
166
- * // 'cEUR-cUSD' -> [
167
- * // { path: [cUSD->USDC, USDC->cEUR] } // two-hop via USDC
168
- * // { path: [cUSD->CELO, CELO->cEUR] } // two-hop via CELO
165
+ * // 'USDm-CELO' -> [{ path: [USDm->CELO] }] // direct route
166
+ * // 'EURm-USDm' -> [
167
+ * // { path: [USDm->USDC, USDC->EURm] } // two-hop via USDC
168
+ * // { path: [USDm->CELO, CELO->EURm] } // two-hop via CELO
169
169
  * // ]
170
170
  * ```
171
171
  */
@@ -193,22 +193,22 @@ export declare function generateAllRoutes(connectivityData: ConnectivityData): M
193
193
  *
194
194
  * @example
195
195
  * ```typescript
196
- * // Create route: cUSD -> CELO -> cEUR
196
+ * // Create route: USDm -> CELO -> EURm
197
197
  * const pair = createTwoHopPair(
198
- * '0x765D...', // cUSD address
198
+ * '0x765D...', // USDm address
199
199
  * '0x471E...', // CELO address
200
- * '0xD876...', // cEUR address
200
+ * '0xD876...', // EURm address
201
201
  * addrToSymbol,
202
202
  * directPathMap
203
203
  * )
204
204
  *
205
205
  * // Result:
206
206
  * // {
207
- * // id: 'cEUR-cUSD', // alphabetical order
208
- * // assets: [cEUR, cUSD], // alphabetical order
207
+ * // id: 'EURm-USDm', // alphabetical order
208
+ * // assets: [EURm, USDm], // alphabetical order
209
209
  * // path: [ // actual routing path
210
- * // { cUSD->CELO exchange },
211
- * // { CELO->cEUR exchange }
210
+ * // { USDm->CELO exchange },
211
+ * // { CELO->EURm exchange }
212
212
  * // ]
213
213
  * // }
214
214
  * ```
@@ -239,17 +239,17 @@ export declare function createTwoHopPair(startToken: Address, intermediateToken:
239
239
  *
240
240
  * @example
241
241
  * ```typescript
242
- * // Multiple routes for cUSD-cEUR pair
242
+ * // Multiple routes for USDm-EURm pair
243
243
  * const candidates = new Map([
244
- * ['cEUR-cUSD', [
245
- * { path: [cUSD->CELO->cEUR], spreadData: { totalSpreadPercent: 0.5 } },
246
- * { path: [cUSD->cREAL->cEUR], spreadData: { totalSpreadPercent: 0.3 } },
247
- * { path: [cUSD->cEUR] } // direct route, no spread data
244
+ * ['EURm-USDm', [
245
+ * { path: [USDm->CELO->EURm], spreadData: { totalSpreadPercent: 0.5 } },
246
+ * { path: [USDm->BRLm->EURm], spreadData: { totalSpreadPercent: 0.3 } },
247
+ * { path: [USDm->EURm] } // direct route, no spread data
248
248
  * ]]
249
249
  * ])
250
250
  *
251
251
  * const optimal = selectOptimalRoutes(candidates, false, assetMap)
252
- * // Returns the cUSD->cREAL->cEUR route (lowest spread: 0.3%)
252
+ * // Returns the USDm->BRLm->EURm route (lowest spread: 0.3%)
253
253
  * ```
254
254
  */
255
255
  export declare function selectOptimalRoutes(allRoutes: Map<TradablePairID, TradablePair[]>, returnAllRoutes: boolean, addrToSymbol: Map<Address, TokenSymbol>): (TradablePair | TradablePairWithSpread)[];
@@ -270,7 +270,7 @@ export declare function selectOptimalRoutes(allRoutes: Map<TradablePairID, Trada
270
270
  *
271
271
  * **Tier 3 - Major Stablecoin Preference** (Final Fallback):
272
272
  * - For two-hop routes, prefer those going through major stablecoins
273
- * - Major FX currencies like cUSD and cEUR typically have better liquidity
273
+ * - Major FX currencies like USDm and EURm typically have better liquidity
274
274
  *
275
275
  * **Tier 4 - First Available** (Last Resort):
276
276
  * - If no other heuristics apply, use the first route found
@@ -8,23 +8,23 @@
8
8
  *
9
9
  * ```
10
10
  * Input: TradablePairs = [
11
- * { id: 'cUSD-CELO', assets: [cUSD, CELO], path: [exchange1_CELO_cUSD] },
12
- * { id: 'CELO-cEUR', assets: [CELO, cEUR], path: [exchange2_CELO_cEUR] }
11
+ * { id: 'USDm-CELO', assets: [USDm, CELO], path: [exchange1_CELO_USDm] },
12
+ * { id: 'CELO-EURm', assets: [CELO, EURm], path: [exchange2_CELO_EURm] }
13
13
  * ]
14
14
  *
15
15
  * Step 1 - Build addrToSymbol map:
16
- * cUSD.address → 'cUSD'
16
+ * USDm.address → 'USDm'
17
17
  * CELO.address → 'CELO'
18
- * cEUR.address → 'cEUR'
18
+ * EURm.address → 'EURm'
19
19
  *
20
20
  * Step 2 - Build directPathMap (sorted alphabetically for consistency):
21
- * 'CELO_addr-cEUR_addr' → exchange2_CELO_cEUR
22
- * 'CELO_addr-cUSD_addr' → exchange1_CELO_cUSD
21
+ * 'CELO_addr-EURm_addr' → exchange2_CELO_EURm
22
+ * 'CELO_addr-USDm_addr' → exchange1_CELO_USDm
23
23
  *
24
24
  * Step 3 - Build bidirectional tokenGraph:
25
- * cUSD.address → Set([CELO.address])
26
- * CELO.address → Set([cUSD.address, cEUR.address])
27
- * cEUR.address → Set([CELO.address])
25
+ * USDm.address → Set([CELO.address])
26
+ * CELO.address → Set([USDm.address, EURm.address])
27
+ * EURm.address → Set([CELO.address])
28
28
  * ```
29
29
  *
30
30
  * **Result**: We can now efficiently answer:
@@ -38,17 +38,17 @@
38
38
  * @example
39
39
  * ```typescript
40
40
  * const directPairs = [
41
- * { id: 'cUSD-CELO', assets: [cUSD, CELO], path: [exchange1] },
42
- * { id: 'CELO-cEUR', assets: [CELO, cEUR], path: [exchange2] }
41
+ * { id: 'USDm-CELO', assets: [USDm, CELO], path: [exchange1] },
42
+ * { id: 'CELO-EURm', assets: [CELO, EURm], path: [exchange2] }
43
43
  * ]
44
44
  *
45
45
  * const connectivityData = buildConnectivityStructures(directPairs)
46
46
  *
47
47
  * // Now we can efficiently find routes:
48
- * // 1. Check if cUSD connects to anything: connectivityData.tokenGraph.get(cUSD.address) → [CELO.address]
49
- * // 2. Check if CELO connects to cEUR: connectivityData.tokenGraph.get(CELO.address) → [cUSD.address, cEUR.address] ✓
50
- * // 3. Get exchange details: connectivityData.directPathMap.get('CELO_addr-cEUR_addr') → exchange2_CELO_cEUR
51
- * // Result: Found route cUSD → CELO → cEUR with exchange details
48
+ * // 1. Check if USDm connects to anything: connectivityData.tokenGraph.get(USDm.address) → [CELO.address]
49
+ * // 2. Check if CELO connects to EURm: connectivityData.tokenGraph.get(CELO.address) → [USDm.address, EURm.address] ✓
50
+ * // 3. Get exchange details: connectivityData.directPathMap.get('CELO_addr-EURm_addr') → exchange2_CELO_EURm
51
+ * // Result: Found route USDm → CELO → EURm with exchange details
52
52
  * ```
53
53
  */
54
54
  export function buildConnectivityStructures(directPairs) {
@@ -95,21 +95,21 @@ export function buildConnectivityStructures(directPairs) {
95
95
  * the best one based on spread data or heuristics.
96
96
  *
97
97
  * **Canonical Pair IDs**: All pairs use alphabetically sorted symbols
98
- * (e.g., 'cEUR-cUSD' not 'cUSD-cEUR') for consistent identification.
98
+ * (e.g., 'EURm-USDm' not 'USDm-EURm') for consistent identification.
99
99
  *
100
100
  * @param connectivityData - The connectivity data from buildConnectivityStructures()
101
101
  * @returns Map of pair ID -> array of possible routes for that pair
102
102
  *
103
103
  * @example
104
104
  * ```typescript
105
- * // Given direct pairs: cUSD-CELO, CELO-cEUR, cUSD-USDC
105
+ * // Given direct pairs: USDm-CELO, CELO-EURm, USDm-USDC
106
106
  * const allRoutes = generateAllRoutes(connectivityData)
107
107
  *
108
108
  * // Results might include:
109
- * // 'cUSD-CELO' -> [{ path: [cUSD->CELO] }] // direct route
110
- * // 'cEUR-cUSD' -> [
111
- * // { path: [cUSD->USDC, USDC->cEUR] } // two-hop via USDC
112
- * // { path: [cUSD->CELO, CELO->cEUR] } // two-hop via CELO
109
+ * // 'USDm-CELO' -> [{ path: [USDm->CELO] }] // direct route
110
+ * // 'EURm-USDm' -> [
111
+ * // { path: [USDm->USDC, USDC->EURm] } // two-hop via USDC
112
+ * // { path: [USDm->CELO, CELO->EURm] } // two-hop via CELO
113
113
  * // ]
114
114
  * ```
115
115
  */
@@ -125,23 +125,23 @@ export function generateAllRoutes(connectivityData) {
125
125
  }
126
126
  // Step 2: Generate two-hop pairs using graph traversal
127
127
  // Algorithm: For each token, explore all paths of length 2
128
- // OUTER LOOP: "For each starting token..." (e.g., cUSD, CELO, cEUR, etc.)
128
+ // OUTER LOOP: "For each starting token..." (e.g., USDm, CELO, EURm, etc.)
129
129
  for (const [start, neighbors] of tokenGraph.entries()) {
130
130
  // MIDDLE LOOP: "Where can I go from the starting token?" (first hop)
131
- // Example: If start = cUSD, neighbors might be [CELO, USDC, cKES]
131
+ // Example: If start = USDm, neighbors might be [CELO, USDC, KESm]
132
132
  for (const intermediate of neighbors) {
133
133
  // Get all tokens reachable from this intermediate token (second hop destinations)
134
134
  const secondHopNeighbors = tokenGraph.get(intermediate);
135
135
  if (!secondHopNeighbors)
136
136
  continue;
137
137
  // INNER LOOP: "From the intermediate token, where can I go?" (second hop)
138
- // Example: If intermediate = CELO, secondHopNeighbors might be [cUSD, cEUR, cBRL]
138
+ // Example: If intermediate = CELO, secondHopNeighbors might be [USDm, EURm, BRLm]
139
139
  for (const end of secondHopNeighbors) {
140
- // Skip circular routes like cUSD → CELO → cUSD (pointless)
140
+ // Skip circular routes like USDm → CELO → USDm (pointless)
141
141
  if (end === start)
142
142
  continue;
143
143
  // At this point we have a potential route: start → intermediate → end
144
- // Example: cUSD → CELO → cEUR
144
+ // Example: USDm → CELO → EURm
145
145
  // Try to create a valid two-hop trading pair from this route
146
146
  const twoHopPair = createTwoHopPair(start, intermediate, end, addrToSymbol, directPathMap);
147
147
  // If we successfully created the pair, add it to our collection
@@ -179,22 +179,22 @@ export function generateAllRoutes(connectivityData) {
179
179
  *
180
180
  * @example
181
181
  * ```typescript
182
- * // Create route: cUSD -> CELO -> cEUR
182
+ * // Create route: USDm -> CELO -> EURm
183
183
  * const pair = createTwoHopPair(
184
- * '0x765D...', // cUSD address
184
+ * '0x765D...', // USDm address
185
185
  * '0x471E...', // CELO address
186
- * '0xD876...', // cEUR address
186
+ * '0xD876...', // EURm address
187
187
  * addrToSymbol,
188
188
  * directPathMap
189
189
  * )
190
190
  *
191
191
  * // Result:
192
192
  * // {
193
- * // id: 'cEUR-cUSD', // alphabetical order
194
- * // assets: [cEUR, cUSD], // alphabetical order
193
+ * // id: 'EURm-USDm', // alphabetical order
194
+ * // assets: [EURm, USDm], // alphabetical order
195
195
  * // path: [ // actual routing path
196
- * // { cUSD->CELO exchange },
197
- * // { CELO->cEUR exchange }
196
+ * // { USDm->CELO exchange },
197
+ * // { CELO->EURm exchange }
198
198
  * // ]
199
199
  * // }
200
200
  * ```
@@ -249,17 +249,17 @@ export function createTwoHopPair(startToken, intermediateToken, endToken, addrTo
249
249
  *
250
250
  * @example
251
251
  * ```typescript
252
- * // Multiple routes for cUSD-cEUR pair
252
+ * // Multiple routes for USDm-EURm pair
253
253
  * const candidates = new Map([
254
- * ['cEUR-cUSD', [
255
- * { path: [cUSD->CELO->cEUR], spreadData: { totalSpreadPercent: 0.5 } },
256
- * { path: [cUSD->cREAL->cEUR], spreadData: { totalSpreadPercent: 0.3 } },
257
- * { path: [cUSD->cEUR] } // direct route, no spread data
254
+ * ['EURm-USDm', [
255
+ * { path: [USDm->CELO->EURm], spreadData: { totalSpreadPercent: 0.5 } },
256
+ * { path: [USDm->BRLm->EURm], spreadData: { totalSpreadPercent: 0.3 } },
257
+ * { path: [USDm->EURm] } // direct route, no spread data
258
258
  * ]]
259
259
  * ])
260
260
  *
261
261
  * const optimal = selectOptimalRoutes(candidates, false, assetMap)
262
- * // Returns the cUSD->cREAL->cEUR route (lowest spread: 0.3%)
262
+ * // Returns the USDm->BRLm->EURm route (lowest spread: 0.3%)
263
263
  * ```
264
264
  */
265
265
  export function selectOptimalRoutes(allRoutes, returnAllRoutes, addrToSymbol) {
@@ -300,7 +300,7 @@ export function selectOptimalRoutes(allRoutes, returnAllRoutes, addrToSymbol) {
300
300
  *
301
301
  * **Tier 3 - Major Stablecoin Preference** (Final Fallback):
302
302
  * - For two-hop routes, prefer those going through major stablecoins
303
- * - Major FX currencies like cUSD and cEUR typically have better liquidity
303
+ * - Major FX currencies like USDm and EURm typically have better liquidity
304
304
  *
305
305
  * **Tier 4 - First Available** (Last Resort):
306
306
  * - If no other heuristics apply, use the first route found
@@ -334,7 +334,7 @@ export function selectBestRoute(candidates, addrToSymbol) {
334
334
  if (directRoute)
335
335
  return directRoute;
336
336
  // Tier 3: Prefer routes through major stablecoins (better liquidity)
337
- const stablecoins = ['cUSD', 'cEUR', 'USDC', 'USDT'];
337
+ const stablecoins = ['USDm', 'EURm', 'USDC', 'USDT'];
338
338
  const routeWithStablecoin = candidates.find((candidate) => {
339
339
  const intermediateToken = getIntermediateToken(candidate);
340
340
  if (!intermediateToken)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mento-protocol/mento-sdk",
3
3
  "description": "Official SDK for interacting with the Mento Protocol",
4
- "version": "1.17.1-beta.0",
4
+ "version": "1.19.0",
5
5
  "license": "MIT",
6
6
  "author": "Mento Labs",
7
7
  "keywords": [