Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
94a8d4c
MEX-966: add XOXNO aggregator service, models and mock
claudiulataretu Mar 5, 2026
0a40f99
MEX-966: add XOXNO feature flag and SmartSwapModel schema changes
claudiulataretu Mar 5, 2026
d7f8cb1
MEX-966: integrate XOXNO into swap strategy selection
claudiulataretu Mar 5, 2026
74c11ae
MEX-966: track XOXNO source in swap evaluation schema
claudiulataretu Mar 5, 2026
279bfb4
MEX-966: add XOXNO unit and integration tests
claudiulataretu Mar 5, 2026
02f5b07
MEX-966: fix XOXNO to SmartSwapModel mapping
claudiulataretu Mar 5, 2026
22f3725
MEX-966: introduce SmartSwapPairModel for unified swap routes
claudiulataretu Mar 5, 2026
9111c25
MEX-966: small fixes on auto-router service
claudiulataretu Mar 9, 2026
54c4a02
MEX-966: add missing test provider
claudiulataretu Mar 9, 2026
0595eaf
MEX-966: use default sender on xoxno aggregator
claudiulataretu Mar 10, 2026
85eff23
MEX-966: remove unused method from xoxno aggregator service
claudiulataretu Mar 10, 2026
e85e8fc
MEX-966: small fixes on xoxno aggregator integration
claudiulataretu Mar 10, 2026
660a976
MEX-966: added xoxno referral id
claudiulataretu Mar 10, 2026
5d1846a
MEX-966: fix xoxno aggregator unit tests
claudiulataretu Mar 10, 2026
36733ec
MEX-966: added platform fees for xoxno aggregator
claudiulataretu Mar 11, 2026
e47135e
MEX-966: fix xoxno fee percentage
claudiulataretu Mar 11, 2026
0576021
MEX-966: return full ESDT token for fee token field
claudiulataretu Mar 11, 2026
854ff95
MEX-966: fix xoxno aggregator bug fixes from code review
claudiulataretu Mar 12, 2026
1335498
MEX-966: fix xoxno price impact mapping
claudiulataretu Mar 12, 2026
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
8 changes: 8 additions & 0 deletions src/helpers/api.config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,12 @@ export class ApiConfigService {
}
return url;
}

getXoxnoReferralID(): number | undefined {
const id = this.configService.get<number>('XOXNO_REFERRAL_ID');
if (id === undefined || id === null) {
return undefined;
}
return id;
}
}
2 changes: 2 additions & 0 deletions src/modules/auto-router/auto-router.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { TokenModule } from '../tokens/token.module';
import { ComposableTasksModule } from '../composable-tasks/composable.tasks.module';
import { SmartRouterService } from './services/smart.router.service';
import { SmartRouterEvaluationModule } from '../smart-router-evaluation/smart.router.evaluation.module';
import { XoxnoAggregatorService } from './services/xoxno-aggregator.service';

@Module({
imports: [
Expand All @@ -39,6 +40,7 @@ import { SmartRouterEvaluationModule } from '../smart-router-evaluation/smart.ro
AutoRouterTransactionService,
PairTransactionService,
SmartRouterService,
XoxnoAggregatorService,
],
exports: [AutoRouterService, AutoRouterTransactionService],
})
Expand Down
30 changes: 30 additions & 0 deletions src/modules/auto-router/mocks/xoxno-aggregator.service.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Injectable } from '@nestjs/common';
import { XoxnoQuoteModel } from '../models/xoxno-aggregator.model';
import { XoxnoAggregatorService } from '../services/xoxno-aggregator.service';

@Injectable()
export class XoxnoAggregatorServiceMock {
async getQuote(
tokenIn: string,
tokenOut: string,
amountIn: string,
slippage: number,
sender?: string,
): Promise<XoxnoQuoteModel | undefined> {
return undefined;
}

async getAmountOut(
tokenIn: string,
tokenOut: string,
amountIn: string,
slippage: number,
): Promise<string | undefined> {
return undefined;
}
}

export const XoxnoAggregatorServiceProvider = {
provide: XoxnoAggregatorService,
useClass: XoxnoAggregatorServiceMock,
};
44 changes: 41 additions & 3 deletions src/modules/auto-router/models/auto-route.model.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { ObjectType, Field } from '@nestjs/graphql';
import { ObjectType, Field, registerEnumType } from '@nestjs/graphql';
import { nestedFieldComplexity } from 'src/helpers/complexity/field.estimators';
import { TransactionModel } from 'src/models/transaction.model';
import { PairModel } from 'src/modules/pair/models/pair.model';
import { EsdtToken } from 'src/modules/tokens/models/esdtToken.model';
import { ParallelRouteSwap } from './smart.router.types';

export enum SmartSwapSource {
INTERNAL = 'internal',
XOXNO = 'xoxno',
}

registerEnumType(SmartSwapSource, {
name: 'SmartSwapSource',
description: 'Source of the smart swap route computation',
});

@ObjectType()
export class SwapRouteModel {
@Field()
Expand Down Expand Up @@ -97,11 +108,36 @@ export class SmartSwapModel {
@Field()
feeAmount: string;

@Field({ complexity: nestedFieldComplexity })
feeToken: EsdtToken;

@Field(() => SmartSwapSource)
source: SmartSwapSource;

constructor(init?: Partial<SmartSwapModel>) {
Object.assign(this, init);
}
}

@ObjectType()
export class SmartSwapPairModel {
@Field()
address: string;

@Field()
dex: string;

@Field({ complexity: nestedFieldComplexity })
firstToken: EsdtToken;

@Field({ complexity: nestedFieldComplexity })
secondToken: EsdtToken;

constructor(init?: Partial<SmartSwapPairModel>) {
Object.assign(this, init);
}
}

@ObjectType()
export class SmartSwapRoute {
@Field(() => [String])
Expand All @@ -116,8 +152,8 @@ export class SmartSwapRoute {
@Field(() => [String])
pricesImpact: string[];

@Field(() => [PairModel], { complexity: nestedFieldComplexity })
pairs: PairModel[];
@Field(() => [SmartSwapPairModel], { complexity: nestedFieldComplexity })
pairs: SmartSwapPairModel[];

constructor(init?: Partial<SmartSwapRoute>) {
Object.assign(this, init);
Expand All @@ -139,6 +175,8 @@ export class AutoRouteModel extends SwapRouteModel {
})
smartSwap?: SmartSwapModel;

xoxnoAmountOut?: string;

constructor(init?: Partial<AutoRouteModel>) {
super(init);
Object.assign(this, init);
Expand Down
34 changes: 34 additions & 0 deletions src/modules/auto-router/models/xoxno-aggregator.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { TransactionModel } from 'src/models/transaction.model';

export interface XoxnoSwapModel {
dex: string;
pairId?: number;
address: string;
from: string;
to: string;
amountIn: string;
amountOut: string;
}

export interface XoxnoPathModel {
amountIn: string;
amountOut: string;
swaps: XoxnoSwapModel[];
}

export interface XoxnoQuoteModel {
from: string;
to: string;
amountIn: string;
amountOut: string;
amountOutMin: string;
slippage: number;
priceImpact: number;
rate: number;
feePercentage: number;
feeAmount: string;
feeAmountShort: number;
feeToken: string;
paths: XoxnoPathModel[];
transaction?: TransactionModel;
}
Loading
Loading