Skip to content

Commit c419013

Browse files
committed
chore: replace isNewMarket flag
1 parent d65bd14 commit c419013

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,8 +1733,8 @@ import llamalend from "@curvefi/llamalend-api";
17331733
### Leverage for Legacy `mintMarket` (Deprecated)
17341734

17351735
These methods apply only to the legacy `mintMarket`.
1736-
Use `mintMarket.isNewMarket` to check whether the market is new.
1737-
If `mintMarket.isNewMarket === false`, use the methods listed below.
1736+
Use `mintMarket.isDeleverageSupported` to check whether the market is new.
1737+
If `mintMarket.isDeleverageSupported === false`, use the methods listed below.
17381738
```ts
17391739
(async () => {
17401740

src/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface ILlamma {
3333
default_bands: number,
3434
A: number,
3535
monetary_policy_abi: any
36-
is_new_market?: boolean
36+
is_deleverage_supported?: boolean
3737
index?: number
3838
}
3939

src/llamalend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ class Llamalend implements ILlamalend {
315315

316316
const network = await this.provider.getNetwork();
317317
this.chainId = Number(network.chainId) === 133 || Number(network.chainId) === 31337 ? 1 : Number(network.chainId) as IChainId;
318-
console.log("CURVE-LENDING-JS IS CONNECTED TO NETWORK:", { name: network.name.toUpperCase(), chainId: Number(this.chainId) });
318+
console.log("CURVE-LLAMALEND-JS IS CONNECTED TO NETWORK:", { name: network.name.toUpperCase(), chainId: Number(this.chainId) });
319319

320320
if(this.chainId === 42161) {
321321
this.constantOptions = { gasLimit: 1125899906842624 } // https://arbiscan.io/chart/gaslimit
@@ -474,7 +474,7 @@ class Llamalend implements ILlamalend {
474474
default_bands: 10,
475475
A: AParams[i],
476476
monetary_policy_abi: MonetaryPolicy2ABI,
477-
is_new_market: true,
477+
is_deleverage_supported: true,
478478
index: N1 + i,
479479
}
480480
}

src/mintMarkets/MintMarketTemplate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class MintMarketTemplate {
4444
defaultBands: number;
4545
A: number;
4646
tickSpace: number; // %
47-
isNewMarket: boolean;
47+
isDeleverageSupported: boolean;
4848
index?: number;
4949
swapDataCache: IDict<IQuoteOdos> = {}
5050
estimateGas: {
@@ -113,7 +113,7 @@ export class MintMarketTemplate {
113113
this.defaultBands = llammaData.default_bands;
114114
this.A = llammaData.A;
115115
this.tickSpace = 1 / llammaData.A * 100;
116-
this.isNewMarket = llammaData.is_new_market ?? false;
116+
this.isDeleverageSupported = llammaData.is_deleverage_supported ?? false;
117117
this.index = llammaData.index;
118118
this.estimateGas = {
119119
createLoanApprove: this.createLoanApproveEstimateGas.bind(this),
@@ -243,7 +243,7 @@ export class MintMarketTemplate {
243243
// ---------------- STATS ----------------
244244

245245
private _getMarketId = (): number => {
246-
if(!this.isNewMarket) {
246+
if(!this.isDeleverageSupported) {
247247
throw Error('For old markets use deprecatedLeverage')
248248
}
249249

@@ -1668,7 +1668,7 @@ export class MintMarketTemplate {
16681668

16691669

16701670
private hasLeverage = (): boolean => {
1671-
return llamalend.constants.ALIASES.leverage_zap !== llamalend.constants.ZERO_ADDRESS && this.isNewMarket
1671+
return llamalend.constants.ALIASES.leverage_zap !== llamalend.constants.ZERO_ADDRESS && this.isDeleverageSupported
16721672
}
16731673

16741674
private _checkLeverageZap(): void {

0 commit comments

Comments
 (0)