-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: v4 subgraph on Sepelia in routing cron (#808)
chore(logging): add logging for 500 errors (#806) * chore(logging): log 500 error details * add exception error log * npm run fix:prettier Co-authored-by: xrsv <[email protected]>
- Loading branch information
Showing
11 changed files
with
284 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
lib/handlers/marshalling/pool-marshaller.ts → ...andlers/marshalling/v3/pool-marshaller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Pool } from '@uniswap/v4-sdk' | ||
import { FeeAmount } from '@uniswap/v3-sdk/dist/constants' | ||
import { MarshalledToken, TokenMarshaller } from '../token-marshaller' | ||
import { Protocol } from '@uniswap/router-sdk' | ||
|
||
export interface MarshalledPool { | ||
protocol: Protocol | ||
token0: MarshalledToken | ||
token1: MarshalledToken | ||
fee: FeeAmount | ||
tickSpacing: number | ||
hooks: string | ||
sqrtRatioX96: string | ||
liquidity: string | ||
tickCurrent: number | ||
} | ||
|
||
export class PoolMarshaller { | ||
public static marshal(pool: Pool): MarshalledPool { | ||
return { | ||
protocol: Protocol.V4, | ||
// TODO: ROUTE-217 - Support native currency routing in V4 | ||
// V4 we should not just wrap | ||
token0: TokenMarshaller.marshal(pool.token0.wrapped), | ||
token1: TokenMarshaller.marshal(pool.token1.wrapped), | ||
fee: pool.fee, | ||
tickSpacing: pool.tickSpacing, | ||
hooks: pool.hooks, | ||
sqrtRatioX96: pool.sqrtRatioX96.toString(), | ||
liquidity: pool.liquidity.toString(), | ||
tickCurrent: pool.tickCurrent, | ||
} | ||
} | ||
|
||
public static unmarshal(marshalledPool: MarshalledPool): Pool { | ||
return new Pool( | ||
TokenMarshaller.unmarshal(marshalledPool.token0), | ||
TokenMarshaller.unmarshal(marshalledPool.token1), | ||
marshalledPool.fee, | ||
marshalledPool.tickSpacing, | ||
marshalledPool.hooks, | ||
marshalledPool.sqrtRatioX96, | ||
marshalledPool.liquidity, | ||
marshalledPool.tickCurrent | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.