diff --git a/packages/solana-usdc-usdt-swap/src/hexapool.ts b/packages/solana-usdc-usdt-swap/src/hexapool.ts index d69479c13..a0ce394f3 100644 --- a/packages/solana-usdc-usdt-swap/src/hexapool.ts +++ b/packages/solana-usdc-usdt-swap/src/hexapool.ts @@ -1,7 +1,7 @@ import { PublicKey } from "@solana/web3.js"; -import type { SwimPoolConstantState } from "@swim-io/solana"; +import type { SolanaPoolConstantState } from "@swim-io/solana"; -export interface SwimPoolConstantProperties { +export interface SolanaPoolConstantProperties { readonly numberOfTokens: number; readonly programId: PublicKey; readonly stateKey: PublicKey; @@ -9,33 +9,34 @@ export interface SwimPoolConstantProperties { readonly feeDecimals: number; } -export const hexapool: SwimPoolConstantProperties & SwimPoolConstantState = { - numberOfTokens: 6, - programId: new PublicKey("SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC"), - stateKey: new PublicKey("8cUvGTFvSWx9WPebYYfDxwiJPdGx2EJUtpve6jP9SBma"), - nonce: 0, - authorityKey: new PublicKey("AfhhYsLMXXyDxQ1B7tNqLTXXDHYtDxCzPcnXWXzHAvDb"), - lpMintKey: new PublicKey("BJUH9GJLaMSLV1E7B3SQLCy9eCfyr6zsrwGcpS2MkqR1"), - feeDecimals: 6, - lpDecimalEqualizer: 0, - tokenMintKeys: [ - new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), // solana-usdc - new PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"), // solana-usdt - new PublicKey("A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM"), // ethereum-usdc - new PublicKey("Dn4noZ5jgGfkntzcQSUZ8czkreiZ1ForXYoV2H8Dm7S1"), // ethereum-usdt - new PublicKey("5RpUwQ8wtdPCZHhu6MERp2RGrpobsbZ6MH5dDHkUjs2"), // bnb-busd - new PublicKey("8qJSyQprMC57TWKaYEmetUR3UUiTP2M3hXdcvFhkZdmv"), // bnb-usdt - ], - tokenDecimalEqualizers: [2, 2, 2, 2, 0, 0], - tokenKeys: [ - new PublicKey("5uBU2zUG8xTLA6XwwcTFWib1p7EjCBzWbiy44eVASTfV"), // solana-usdc - new PublicKey("Hv7yPYnGs6fpN3o1NZvkima9mKDrRDJtNxf23oKLCjau"), // solana-usdt - new PublicKey("4R6b4aibi46JzAnuA8ZWXrHAsR1oZBTZ8dqkuer3LsbS"), // ethereum-usdc - new PublicKey("2DMUL42YEb4g1HAKXhUxL3Yjfgoj4VvRqKwheorfFcPV"), // ethereum-usdt - new PublicKey("DukQAFyxR41nbbq2FBUDMyrtF2CRmWBREjZaTVj4u9As"), // bnb-busd - new PublicKey("9KMH3p8cUocvQRbJfKRAStKG52xCCWNmEPsJm5gc8fzw"), // bnb-usdt - ], -}; +export const hexapool: SolanaPoolConstantProperties & SolanaPoolConstantState = + { + numberOfTokens: 6, + programId: new PublicKey("SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC"), + stateKey: new PublicKey("8cUvGTFvSWx9WPebYYfDxwiJPdGx2EJUtpve6jP9SBma"), + nonce: 0, + authorityKey: new PublicKey("AfhhYsLMXXyDxQ1B7tNqLTXXDHYtDxCzPcnXWXzHAvDb"), + lpMintKey: new PublicKey("BJUH9GJLaMSLV1E7B3SQLCy9eCfyr6zsrwGcpS2MkqR1"), + feeDecimals: 6, + lpDecimalEqualizer: 0, + tokenMintKeys: [ + new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), // solana-usdc + new PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"), // solana-usdt + new PublicKey("A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM"), // ethereum-usdc + new PublicKey("Dn4noZ5jgGfkntzcQSUZ8czkreiZ1ForXYoV2H8Dm7S1"), // ethereum-usdt + new PublicKey("5RpUwQ8wtdPCZHhu6MERp2RGrpobsbZ6MH5dDHkUjs2"), // bnb-busd + new PublicKey("8qJSyQprMC57TWKaYEmetUR3UUiTP2M3hXdcvFhkZdmv"), // bnb-usdt + ], + tokenDecimalEqualizers: [2, 2, 2, 2, 0, 0], + tokenKeys: [ + new PublicKey("5uBU2zUG8xTLA6XwwcTFWib1p7EjCBzWbiy44eVASTfV"), // solana-usdc + new PublicKey("Hv7yPYnGs6fpN3o1NZvkima9mKDrRDJtNxf23oKLCjau"), // solana-usdt + new PublicKey("4R6b4aibi46JzAnuA8ZWXrHAsR1oZBTZ8dqkuer3LsbS"), // ethereum-usdc + new PublicKey("2DMUL42YEb4g1HAKXhUxL3Yjfgoj4VvRqKwheorfFcPV"), // ethereum-usdt + new PublicKey("DukQAFyxR41nbbq2FBUDMyrtF2CRmWBREjZaTVj4u9As"), // bnb-busd + new PublicKey("9KMH3p8cUocvQRbJfKRAStKG52xCCWNmEPsJm5gc8fzw"), // bnb-usdt + ], + }; export const initialGovernanceFeeKey = new PublicKey( "9Yau6DnqYasBUKcyxQJQZqThvUnqZ32ZQuUCcC2AdT9P", diff --git a/packages/solana-usdc-usdt-swap/src/state.ts b/packages/solana-usdc-usdt-swap/src/state.ts index 015d93ae1..24bbf33c8 100644 --- a/packages/solana-usdc-usdt-swap/src/state.ts +++ b/packages/solana-usdc-usdt-swap/src/state.ts @@ -1,18 +1,18 @@ import type { Connection, PublicKey } from "@solana/web3.js"; -import type { SwimPoolState } from "@swim-io/solana"; -import { deserializeSwimPool } from "@swim-io/solana"; +import type { SolanaPoolState } from "@swim-io/solana"; +import { deserializeSolanaPool } from "@swim-io/solana"; import Decimal from "decimal.js"; -import type { SwimPoolConstantProperties } from "./hexapool"; +import type { SolanaPoolConstantProperties } from "./hexapool"; import { hexapool } from "./hexapool"; -interface SwimPoolBalances { +interface SolanaPoolBalances { readonly tokenBalances: readonly Decimal[]; } -export type SwimPool = SwimPoolConstantProperties & - SwimPoolState & - SwimPoolBalances; +export type SwimPool = SolanaPoolConstantProperties & + SolanaPoolState & + SolanaPoolBalances; const fetchTokenBalances = async ( solanaConnection: Connection, @@ -36,7 +36,7 @@ export const fetchSwimPool = async ( if (accountInfo === null) { throw new Error("Could not retrieve account info"); } - const poolState = deserializeSwimPool( + const poolState = deserializeSolanaPool( hexapool.numberOfTokens, accountInfo.data, );