Skip to content

Commit

Permalink
fix(lemma-finance): xUSDL price and underlying token (Zapper-fi#1892)
Browse files Browse the repository at this point in the history
* fix(lemma-finance): Cleanup

* fix(lemma-finance): Fix xUSDL underlying token and price
  • Loading branch information
wpoulin authored and 0xdapper committed Feb 28, 2023
1 parent 063a241 commit eb6d48f
Show file tree
Hide file tree
Showing 45 changed files with 556 additions and 572 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi
import type { Listener, Provider } from '@ethersproject/providers';
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common';

export interface LemmaSynthInterface extends utils.Interface {
export interface SynthInterface extends utils.Interface {
functions: {
'ADMIN_ROLE()': FunctionFragment;
'DEFAULT_ADMIN_ROLE()': FunctionFragment;
Expand Down Expand Up @@ -433,12 +433,12 @@ export type WithdrawToEvent = TypedEvent<[string, string, string, BigNumber, Big

export type WithdrawToEventFilter = TypedEventFilter<WithdrawToEvent>;

export interface LemmaSynth extends BaseContract {
export interface Synth extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;

interface: LemmaSynthInterface;
interface: SynthInterface;

queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi
import type { Listener, Provider } from '@ethersproject/providers';
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common';

export interface XLemmaSynthInterface extends utils.Interface {
export interface XSynthInterface extends utils.Interface {
functions: {
'DOMAIN_SEPARATOR()': FunctionFragment;
'allowance(address,address)': FunctionFragment;
Expand Down Expand Up @@ -318,12 +318,12 @@ export type WithdrawEvent = TypedEvent<[string, string, BigNumber, BigNumber], W

export type WithdrawEventFilter = TypedEventFilter<WithdrawEvent>;

export interface XLemmaSynth extends BaseContract {
export interface XSynth extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;

interface: XLemmaSynthInterface;
interface: XSynthInterface;

queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi
import type { Listener, Provider } from '@ethersproject/providers';
import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common';

export interface XusdlInterface extends utils.Interface {
export interface XUsdlInterface extends utils.Interface {
functions: {
'DOMAIN_SEPARATOR()': FunctionFragment;
'allowance(address,address)': FunctionFragment;
Expand Down Expand Up @@ -312,12 +312,12 @@ export type WithdrawEvent = TypedEvent<[string, string, BigNumber, BigNumber], W

export type WithdrawEventFilter = TypedEventFilter<WithdrawEvent>;

export interface Xusdl extends BaseContract {
export interface XUsdl extends BaseContract {
connect(signerOrProvider: Signer | Provider | string): this;
attach(addressOrName: string): this;
deployed(): Promise<this>;

interface: XusdlInterface;
interface: XUsdlInterface;

queryFilter<TEvent extends TypedEvent>(
event: TypedEventFilter<TEvent>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { Contract, Signer, utils } from 'ethers';
import type { Provider } from '@ethersproject/providers';
import type { LemmaSynth, LemmaSynthInterface } from '../LemmaSynth';
import type { Synth, SynthInterface } from '../Synth';

const _abi = [
{
Expand Down Expand Up @@ -1205,12 +1205,12 @@ const _abi = [
},
];

export class LemmaSynth__factory {
export class Synth__factory {
static readonly abi = _abi;
static createInterface(): LemmaSynthInterface {
return new utils.Interface(_abi) as LemmaSynthInterface;
static createInterface(): SynthInterface {
return new utils.Interface(_abi) as SynthInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): LemmaSynth {
return new Contract(address, _abi, signerOrProvider) as LemmaSynth;
static connect(address: string, signerOrProvider: Signer | Provider): Synth {
return new Contract(address, _abi, signerOrProvider) as Synth;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { Contract, Signer, utils } from 'ethers';
import type { Provider } from '@ethersproject/providers';
import type { XLemmaSynth, XLemmaSynthInterface } from '../XLemmaSynth';
import type { XSynth, XSynthInterface } from '../XSynth';

const _abi = [
{
Expand Down Expand Up @@ -929,12 +929,12 @@ const _abi = [
},
];

export class XLemmaSynth__factory {
export class XSynth__factory {
static readonly abi = _abi;
static createInterface(): XLemmaSynthInterface {
return new utils.Interface(_abi) as XLemmaSynthInterface;
static createInterface(): XSynthInterface {
return new utils.Interface(_abi) as XSynthInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): XLemmaSynth {
return new Contract(address, _abi, signerOrProvider) as XLemmaSynth;
static connect(address: string, signerOrProvider: Signer | Provider): XSynth {
return new Contract(address, _abi, signerOrProvider) as XSynth;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { Contract, Signer, utils } from 'ethers';
import type { Provider } from '@ethersproject/providers';
import type { Xusdl, XusdlInterface } from '../Xusdl';
import type { XUsdl, XUsdlInterface } from '../XUsdl';

const _abi = [
{
Expand Down Expand Up @@ -919,12 +919,12 @@ const _abi = [
},
];

export class Xusdl__factory {
export class XUsdl__factory {
static readonly abi = _abi;
static createInterface(): XusdlInterface {
return new utils.Interface(_abi) as XusdlInterface;
static createInterface(): XUsdlInterface {
return new utils.Interface(_abi) as XUsdlInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): Xusdl {
return new Contract(address, _abi, signerOrProvider) as Xusdl;
static connect(address: string, signerOrProvider: Signer | Provider): XUsdl {
return new Contract(address, _abi, signerOrProvider) as XUsdl;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export { LemmaSynth__factory } from './LemmaSynth__factory';
export { PerpLemma__factory } from './PerpLemma__factory';
export { Synth__factory } from './Synth__factory';
export { Usdl__factory } from './Usdl__factory';
export { XLemmaSynth__factory } from './XLemmaSynth__factory';
export { Xusdl__factory } from './Xusdl__factory';
export { XSynth__factory } from './XSynth__factory';
export { XUsdl__factory } from './XUsdl__factory';
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
export type { LemmaSynth } from './LemmaSynth';
export type { PerpLemma } from './PerpLemma';
export type { Synth } from './Synth';
export type { Usdl } from './Usdl';
export type { XLemmaSynth } from './XLemmaSynth';
export type { Xusdl } from './Xusdl';
export type { XSynth } from './XSynth';
export type { XUsdl } from './XUsdl';
export * as factories from './factories';
export { LemmaSynth__factory } from './factories/LemmaSynth__factory';
export { PerpLemma__factory } from './factories/PerpLemma__factory';
export { Synth__factory } from './factories/Synth__factory';
export { Usdl__factory } from './factories/Usdl__factory';
export { XLemmaSynth__factory } from './factories/XLemmaSynth__factory';
export { Xusdl__factory } from './factories/Xusdl__factory';
export { XSynth__factory } from './factories/XSynth__factory';
export { XUsdl__factory } from './factories/XUsdl__factory';
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@ import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface';
import { ContractFactory } from '~contract/contracts';
import { Network } from '~types/network.interface';

import { LemmaSynth__factory } from './ethers';
import { PerpLemma__factory } from './ethers';
import { Synth__factory } from './ethers';
import { Usdl__factory } from './ethers';
import { XLemmaSynth__factory } from './ethers';
import { Xusdl__factory } from './ethers';
import { XSynth__factory } from './ethers';
import { XUsdl__factory } from './ethers';

// eslint-disable-next-line
type ContractOpts = { address: string; network: Network };

@Injectable()
export class LemmafinanceContractFactory extends ContractFactory {
export class LemmaFinanceContractFactory extends ContractFactory {
constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {
super((network: Network) => appToolkit.getNetworkProvider(network));
}

lemmaSynth({ address, network }: ContractOpts) {
return LemmaSynth__factory.connect(address, this.appToolkit.getNetworkProvider(network));
}
perpLemma({ address, network }: ContractOpts) {
return PerpLemma__factory.connect(address, this.appToolkit.getNetworkProvider(network));
}
synth({ address, network }: ContractOpts) {
return Synth__factory.connect(address, this.appToolkit.getNetworkProvider(network));
}
usdl({ address, network }: ContractOpts) {
return Usdl__factory.connect(address, this.appToolkit.getNetworkProvider(network));
}
xLemmaSynth({ address, network }: ContractOpts) {
return XLemmaSynth__factory.connect(address, this.appToolkit.getNetworkProvider(network));
xSynth({ address, network }: ContractOpts) {
return XSynth__factory.connect(address, this.appToolkit.getNetworkProvider(network));
}
xusdl({ address, network }: ContractOpts) {
return Xusdl__factory.connect(address, this.appToolkit.getNetworkProvider(network));
xUsdl({ address, network }: ContractOpts) {
return XUsdl__factory.connect(address, this.appToolkit.getNetworkProvider(network));
}
}

export type { LemmaSynth } from './ethers';
export type { PerpLemma } from './ethers';
export type { Synth } from './ethers';
export type { Usdl } from './ethers';
export type { XLemmaSynth } from './ethers';
export type { Xusdl } from './ethers';
export type { XSynth } from './ethers';
export type { XUsdl } from './ethers';
3 changes: 3 additions & 0 deletions src/apps/lemma-finance/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { LEMMA_FINANCE_DEFINITION, LemmaFinanceAppDefinition } from './lemma-finance.definition';
export { LemmaFinanceAppModule } from './lemma-finance.module';
export { LemmaFinanceContractFactory } from './contracts';
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { appDefinition, AppDefinition } from '~app/app.definition';
import { AppAction, AppTag, GroupType } from '~app/app.interface';
import { Network } from '~types/network.interface';

export const LEMMAFINANCE_DEFINITION = appDefinition({
id: 'lemmafinance',
name: 'LemmaFinance',
export const LEMMA_FINANCE_DEFINITION = appDefinition({
id: 'lemma-finance',
name: 'Lemma Finance',
description: 'A basis trading stablecoin protocol.',
url: 'https://v2.lemma.finance/',

Expand All @@ -15,26 +15,29 @@ export const LEMMAFINANCE_DEFINITION = appDefinition({
type: GroupType.TOKEN,
label: 'USDL',
},
xusdl: {
id: 'xusdl',
xUsdl: {
id: 'x-usdl',
type: GroupType.TOKEN,
label: 'xUSDL',
},
LemmaSynth: {
id: 'LemmaSynth',
synth: {
id: 'synth',
type: GroupType.TOKEN,
label: 'LemmaSynth',
label: 'Synth',
},
xLemmaSynth: {
id: 'xLemmaSynth',
xSynth: {
id: 'x-synth',
type: GroupType.TOKEN,
label: 'xLemmaSynth',
label: 'xSynth',
},
},

tags: [AppTag.ALGORITHMIC_STABLECOIN],
keywords: [],
links: {},
links: {
discord: 'https://discord.com/invite/AvCEkVbtQt',
twitter: 'https://twitter.com/LemmaFinance',
},

supportedNetworks: {
[Network.OPTIMISM_MAINNET]: [AppAction.VIEW],
Expand All @@ -43,11 +46,11 @@ export const LEMMAFINANCE_DEFINITION = appDefinition({
primaryColor: '#fff',
});

@Register.AppDefinition(LEMMAFINANCE_DEFINITION.id)
export class LemmafinanceAppDefinition extends AppDefinition {
@Register.AppDefinition(LEMMA_FINANCE_DEFINITION.id)
export class LemmaFinanceAppDefinition extends AppDefinition {
constructor() {
super(LEMMAFINANCE_DEFINITION);
super(LEMMA_FINANCE_DEFINITION);
}
}

export default LEMMAFINANCE_DEFINITION;
export default LEMMA_FINANCE_DEFINITION;
25 changes: 25 additions & 0 deletions src/apps/lemma-finance/lemma-finance.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Register } from '~app-toolkit/decorators';
import { AbstractApp } from '~app/app.dynamic-module';

import { LemmaFinanceContractFactory } from './contracts';
import { LemmaFinanceAppDefinition, LEMMA_FINANCE_DEFINITION } from './lemma-finance.definition';
import { OptimismLemmaFinanceBalanceFetcher } from './optimism/lemma-finance.balance-fetcher';
import { OptimismLemmaFinanceLemmaSynthTokenFetcher } from './optimism/lemma-finance.synth.token-fetcher';
import { OptimismLemmaFinanceUsdlTokenFetcher } from './optimism/lemma-finance.usdl.token-fetcher';
import { OptimismLemmaFinanceXSynthTokenFetcher } from './optimism/lemma-finance.x-synth.token-fetcher';
import { OptimismLemmaFinanceXUsdlTokenFetcher } from './optimism/lemma-finance.x-usdl.token-fetcher';

@Register.AppModule({
appId: LEMMA_FINANCE_DEFINITION.id,
providers: [
LemmaFinanceAppDefinition,
LemmaFinanceContractFactory,
// Optimism
OptimismLemmaFinanceBalanceFetcher,
OptimismLemmaFinanceLemmaSynthTokenFetcher,
OptimismLemmaFinanceUsdlTokenFetcher,
OptimismLemmaFinanceXSynthTokenFetcher,
OptimismLemmaFinanceXUsdlTokenFetcher,
],
})
export class LemmaFinanceAppModule extends AbstractApp() {}
Loading

0 comments on commit eb6d48f

Please sign in to comment.