Skip to content

Commit

Permalink
revert plan for camelotV3 to force fallback rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
mwamedacen committed Aug 4, 2023
1 parent 5377855 commit ecf95c6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/dex/algebra/algebra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,18 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {

if (!pool) return null;

if (this.config.forceRPC) {
const rpcPrice = await this.getPricingFromRpc(
_srcToken,
_destToken,
amounts,
side,
pool,
);

return rpcPrice;
}

let state = pool.getState(blockNumber);

if (state === null) {
Expand Down Expand Up @@ -769,6 +781,7 @@ export class Algebra extends SimpleExchange implements IDex<AlgebraData> {
initHash: this.config.initHash,
subgraphURL: this.config.subgraphURL,
version: this.config.version,
forceRPC: this.config.forceRPC,
};
return newConfig;
}
Expand Down
1 change: 1 addition & 0 deletions src/dex/algebra/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const AlgebraConfig: DexConfigMap<DexParams> = {
uniswapMulticall: '0x1F98415757620B543A52E61c46B32eB19261F984',
deployer: '0x6dd3fb9653b10e806650f107c3b5a0a6ff974f65',
version: 'v1.9',
forceRPC: true,
},
},
};
Expand Down
1 change: 1 addition & 0 deletions src/dex/algebra/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type DexParams = {
subgraphURL: string;
initHash: string;
version: 'v1.1' | 'v1.9';
forceRPC?: boolean;
};

export type TickBitMapMappingsWithBigNumber = {
Expand Down

0 comments on commit ecf95c6

Please sign in to comment.