Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/epic/relayer-config' int…
Browse files Browse the repository at this point in the history
…o pablo/relayer-config
  • Loading branch information
md0x committed Dec 11, 2024
2 parents 313b9c5 + e9d2866 commit df92cfa
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 55 deletions.
4 changes: 2 additions & 2 deletions api-docs-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ paths:
Calldata passed to the `recipient` if `recipient` is a contract
address. This calldata is passed to the recipient via the
recipient's handleAcrossMessage() public function. The length of
this value is constrained by the API to ~4096 chars minus the length
of the full URL.
this value is constrained by the API to ~12288 chars (12KB) minus
the length of the full URL.
_Example:_ 0xABC123
Expand Down
103 changes: 50 additions & 53 deletions api/_types/exclusivity.types.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,56 @@
export type RelayerFillLimit = {
maxFillSize?: number;
originChainId: number;
inputToken: string;
destinationChainId: number;
outputToken: string;
minOutputAmount?: number;
maxOutputAmount?: number;
minExclusivityPeriod?: number;
minProfitThreshold?: number;
balanceMultiplier?: number;
msgFill?: boolean;
};

export type RelayerFillConfig = Required<RelayerFillLimit> & {
originChainIds: number[];
tokens: {
[inputToken: string]: RelayerFillLimit & {
originChainIds: number[];
[originChainId: number] : {
[destinationChainId: number]: RelayerFillLimit & {
[outputToken: string]: { [maxFillSize: number]: number };
};
};
};
};
};

POST: api/relayer/config/<token>/<originChainId>



export const SampleConfig: RelayerFillConfig = {
originChainIds: [1, 10, 137],
maxFillSize: 10_000, // USD
minProfitThreshold: 0.0001, // 1bps
balanceMultiplier: 0.5,





tokens: {
USDC: {
balanceMultiplier: 0.3,
10: {
42161: {
USDC: {
100: 0.0001,
1000: 0.0002,
10000: 0.0005,
},
"USDC.e": {
100: 0.0002,
1000: 0.0006,
}
},
59144: {
"USDC": {
100: 0.0002,
1000: 0.0005,
}
}
},
},
// Example config.
export const RelayerConfigUpdate: RelayerFillLimit[] = [
{
originChainId: 1,
inputToken: "",
destinationChainId: 42161,
outputToken: "",
minExclusivityPeriod: 20,
minProfitThreshold: 0.0003,
balanceMultiplier: 0.6,
maxOutputAmount: 2500,
},
};
{
originChainId: 10,
inputToken: "",
destinationChainId: 42161,
outputToken: "",
minExclusivityPeriod: 5,
minProfitThreshold: 0.0003,
balanceMultiplier: 0.6,
maxOutputAmount: 2500,
},
{
originChainId: 137,
inputToken: "",
destinationChainId: 42161,
outputToken: "",
minExclusivityPeriod: 5,
minProfitThreshold: 0.0003,
balanceMultiplier: 0.6,
maxOutputAmount: 2500,
},
{
originChainId: 324,
inputToken: "",
destinationChainId: 42161,
outputToken: "",
minExclusivityPeriod: 5,
minProfitThreshold: 0.0003,
balanceMultiplier: 0.6,
maxOutputAmount: 2500,
},
];

0 comments on commit df92cfa

Please sign in to comment.