Skip to content

Commit

Permalink
sdk: add missing poolid to user and spot markets (#1354)
Browse files Browse the repository at this point in the history
* sdk: add missing poolid to user and spot markets

* sdk: devnet-pool-id-1

* sdk: add new poolids

---------

Co-authored-by: 0xbigz <[email protected]>
  • Loading branch information
evanpipta and 0xbigz authored Dec 2, 2024
1 parent bf4f752 commit 3e18eed
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
59 changes: 59 additions & 0 deletions sdk/src/constants/spotMarkets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
export type SpotMarketConfig = {
symbol: string;
marketIndex: number;
poolId: number;
oracle: PublicKey;
mint: PublicKey;
oracleSource: OracleSource;
Expand All @@ -34,6 +35,7 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'USDC',
marketIndex: 0,
poolId: 0,
oracle: new PublicKey('En8hkHLkRe9d9DraYmBTrus518BvmVH448YcvmrFM6Ce'),
oracleSource: OracleSource.PYTH_STABLE_COIN_PULL,
mint: new PublicKey('8zGuJQqwhZafTah7Uc7Z4tXRnguqkn5KLFAP8oV6PHe2'),
Expand All @@ -45,6 +47,7 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'SOL',
marketIndex: 1,
poolId: 0,
oracle: new PublicKey('BAtFj4kQttZRVep3UZS2aZRDixkGYgWsbqTBVDbnSsPF'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey(WRAPPED_SOL_MINT),
Expand All @@ -60,6 +63,7 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'BTC',
marketIndex: 2,
poolId: 0,
oracle: new PublicKey('486kr3pmFPfTsS4aZgcsQ7kS4i9rjMsYYZup6HQNSTT4'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('3BZPwbcqB5kKScF3TEXxwNfx5ipV13kbRVDvfVp5c6fv'),
Expand All @@ -72,6 +76,7 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'PYUSD',
marketIndex: 3,
poolId: 0,
oracle: new PublicKey('HpMoKp3TCd3QT4MWYUKk2zCBwmhr5Df45fB6wdxYqEeh'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('GLfF72ZCUnS6N9iDJw8kedHzd6WFVf3VbpwdKKy76FRk'),
Expand All @@ -83,6 +88,7 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'Bonk',
marketIndex: 4,
poolId: 0,
oracle: new PublicKey('GojbSnJuPdKDT1ZuHuAM5t9oz6bxTo1xhUKpTua2F72p'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('7SekVZDmKCCDgTP8m6Hk4CfexFSru9RkwDCczmcwcsP6'),
Expand All @@ -91,12 +97,37 @@ export const DevnetSpotMarkets: SpotMarketConfig[] = [
pythFeedId:
'0x72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419',
},
{
symbol: 'JLP',
marketIndex: 5,
poolId: 1,
oracle: new PublicKey('5Mb11e5rt1Sp6A286B145E4TmgMzsM2UX9nCF2vas5bs'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('HGe9FejFyhWSx6zdvx2RjynX7rmoEXFiJiLU437NXemZ'),
precision: new BN(10).pow(SIX),
precisionExp: SIX,
pythFeedId:
'0xc811abc82b4bad1f9bd711a2773ccaa935b03ecef974236942cec5e0eb845a3a',
},
{
symbol: 'USDC',
marketIndex: 6,
poolId: 1,
oracle: new PublicKey('En8hkHLkRe9d9DraYmBTrus518BvmVH448YcvmrFM6Ce'),
oracleSource: OracleSource.PYTH_STABLE_COIN_PULL,
mint: new PublicKey('8zGuJQqwhZafTah7Uc7Z4tXRnguqkn5KLFAP8oV6PHe2'),
precision: new BN(10).pow(SIX),
precisionExp: SIX,
pythFeedId:
'0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
},
];

export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'USDC',
marketIndex: 0,
poolId: 0,
oracle: new PublicKey('En8hkHLkRe9d9DraYmBTrus518BvmVH448YcvmrFM6Ce'),
oracleSource: OracleSource.PYTH_STABLE_COIN_PULL,
mint: new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
Expand All @@ -108,6 +139,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'SOL',
marketIndex: 1,
poolId: 0,
oracle: new PublicKey('BAtFj4kQttZRVep3UZS2aZRDixkGYgWsbqTBVDbnSsPF'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey(WRAPPED_SOL_MINT),
Expand All @@ -126,6 +158,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'mSOL',
marketIndex: 2,
poolId: 0,
oracle: new PublicKey('FAq7hqjn7FWGXKDwJHzsXGgBcydGTcK4kziJpAGWXjDb'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So'),
Expand All @@ -138,6 +171,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'wBTC',
marketIndex: 3,
poolId: 0,
oracle: new PublicKey('9Tq8iN5WnMX2PcZGj4iSFEAgHCi8cM6x8LsDUbuzq8uw'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh'),
Expand All @@ -150,6 +184,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'wETH',
marketIndex: 4,
poolId: 0,
oracle: new PublicKey('6bEp2MiyoiiiDxcVqE8rUHQWwHirXUXtKfAEATTVqNzT'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs'),
Expand All @@ -168,6 +203,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'USDT',
marketIndex: 5,
poolId: 0,
oracle: new PublicKey('BekJ3P5G3iFeC97sXHuKnUHofCFj9Sbo7uyF2fkKwvit'),
oracleSource: OracleSource.PYTH_STABLE_COIN_PULL,
mint: new PublicKey('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'),
Expand All @@ -180,6 +216,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'jitoSOL',
marketIndex: 6,
poolId: 0,
oracle: new PublicKey('9QE1P5EfzthYDgoQ9oPeTByCEKaRJeZbVVqKJfgU9iau'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn'),
Expand All @@ -195,6 +232,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'PYTH',
marketIndex: 7,
poolId: 0,
oracle: new PublicKey('GqkCu7CbsPVz1H6W6AAHuReqbJckYG59TXz7Y5HDV7hr'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3'),
Expand All @@ -210,6 +248,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'bSOL',
marketIndex: 8,
poolId: 0,
oracle: new PublicKey('BmDWPMsytWmYkh9n6o7m79eVshVYf2B5GVaqQ2EWKnGH'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1'),
Expand All @@ -222,6 +261,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'JTO',
marketIndex: 9,
poolId: 0,
oracle: new PublicKey('Ffq6ACJ17NAgaxC6ocfMzVXL3K61qxB2xHg6WUawWPfP'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL'),
Expand All @@ -237,6 +277,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'WIF',
marketIndex: 10,
poolId: 0,
oracle: new PublicKey('6x6KfE7nY2xoLCRSMPT1u83wQ5fpGXoKNBqFjrCwzsCQ'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm'),
Expand All @@ -255,6 +296,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'JUP',
marketIndex: 11,
poolId: 0,
oracle: new PublicKey('AwqRpfJ36jnSZQykyL1jYY35mhMteeEAjh7o8LveRQin'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN'),
Expand All @@ -270,6 +312,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'RENDER',
marketIndex: 12,
poolId: 0,
oracle: new PublicKey('8TQztfGcNjHGRusX4ejQQtPZs3Ypczt9jWF6pkgQMqUX'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('rndrizKT3MK1iimdxRdWabcF7Zg7AR5T4nud4EkHBof'),
Expand All @@ -283,6 +326,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'W',
marketIndex: 13,
poolId: 0,
oracle: new PublicKey('4HbitGsdcFbtFotmYscikQFAAKJ3nYx4t7sV7fTvsk8U'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('85VBFQZC9TZkfaptBWjvUw7YbZjy52A6mjtPGjstQAmQ'),
Expand All @@ -298,6 +342,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'TNSR',
marketIndex: 14,
poolId: 0,
oracle: new PublicKey('13jpjpVyU5hGpjsZ4HzCcmBo85wze4N8Au7U6cC3GMip'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6'),
Expand All @@ -313,6 +358,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'DRIFT',
marketIndex: 15,
poolId: 0,
oracle: new PublicKey('23KmX7SNikmUr2axSCy6Zer7XPBnvmVcASALnDGqBVRR'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('DriFtupJYLTosbwoN8koMbEYSx54aFAVLddWsbksjwg7'),
Expand All @@ -328,6 +374,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'INF',
marketIndex: 16,
poolId: 0,
oracle: new PublicKey('B7RUYg2zF6UdUSHv2RmpnriPVJccYWojgFydNS1NY5F8'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('5oVNBeEEQvYi1cX3ir8Dx5n1P7pdxydbGF2X4TxVusJm'),
Expand All @@ -340,6 +387,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'dSOL',
marketIndex: 17,
poolId: 0,
oracle: new PublicKey('7QJ6e57t3yM8HYVg6bAnJiCiZ3wQQ5CSVsa6GA16nJuK'),
oracleSource: OracleSource.SWITCHBOARD_ON_DEMAND,
mint: new PublicKey('Dso1bDeDjCQxTrWHqUUi63oBvV7Mdm6WaobLbQ7gnPQ'),
Expand All @@ -350,6 +398,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'USDY',
marketIndex: 18,
poolId: 0,
oracle: new PublicKey('BPTQgHV4y2x4jvKPPkkd9aS8jY7L3DGZBwjEZC8Vm27o'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('A1KLoBrKBde8Ty9qtNQUtq3C2ortoC3u7twggz7sEto6'),
Expand All @@ -362,6 +411,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'JLP',
marketIndex: 19,
poolId: 0,
oracle: new PublicKey('5Mb11e5rt1Sp6A286B145E4TmgMzsM2UX9nCF2vas5bs'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4'),
Expand All @@ -374,6 +424,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'POPCAT',
marketIndex: 20,
poolId: 0,
oracle: new PublicKey('H3pn43tkNvsG5z3qzmERguSvKoyHZvvY6VPmNrJqiW5X'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('7GCihgDB8fe6KNjn2MYtkzZcRjQy3t9GHdC8uHYmW2hr'),
Expand All @@ -389,6 +440,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'CLOUD',
marketIndex: 21,
poolId: 0,
oracle: new PublicKey('FNFejcXENaPgKaCTfstew9vSSvdQPnXjGTkJjUnnYvHU'),
oracleSource: OracleSource.SWITCHBOARD_ON_DEMAND,
mint: new PublicKey('CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu'),
Expand All @@ -399,6 +451,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'PYUSD',
marketIndex: 22,
poolId: 0,
oracle: new PublicKey('HpMoKp3TCd3QT4MWYUKk2zCBwmhr5Df45fB6wdxYqEeh'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo'),
Expand All @@ -410,6 +463,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'USDe',
marketIndex: 23,
poolId: 0,
oracle: new PublicKey('BXej5boX2nWudwAfZQedo212B9XJxhjTeeF3GbCwXmYa'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('DEkqHyPN7GMRJ5cArtQFAWefqbZb33Hyf6s5iCwjEonT'),
Expand All @@ -421,6 +475,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'sUSDe',
marketIndex: 24,
poolId: 0,
oracle: new PublicKey('BRuNuzLAPHHGSSVAJPKMcmJMdgDfrekvnSxkxPDGdeqp'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('Eh6XEPhSwoLv5wFApukmnaVSHQ6sAnoD9BmgmwQoN2sN'),
Expand All @@ -432,6 +487,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'BNSOL',
marketIndex: 25,
poolId: 0,
oracle: new PublicKey('8DmXTfhhtb9kTcpTVfb6Ygx8WhZ8wexGqcpxfn23zooe'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('BNso1VUJnh4zcfpZa6986Ea66P6TCp59hvtNJ8b1X85'),
Expand All @@ -443,6 +499,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'MOTHER',
marketIndex: 26,
poolId: 0,
oracle: new PublicKey('56ap2coZG7FPWUigVm9XrpQs3xuCwnwQaWtjWZcffEUG'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('3S8qX1MsMqRbiwKg2cQyx7nis1oHMgaCuc9c4VfvVdPN'),
Expand All @@ -454,6 +511,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'cbBTC',
marketIndex: 27,
poolId: 0,
oracle: new PublicKey('486kr3pmFPfTsS4aZgcsQ7kS4i9rjMsYYZup6HQNSTT4'),
oracleSource: OracleSource.PYTH_PULL,
mint: new PublicKey('cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij'),
Expand All @@ -468,6 +526,7 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
{
symbol: 'USDS',
marketIndex: 28,
poolId: 0,
oracle: new PublicKey('7pT9mxKXyvfaZKeKy1oe2oV2K1RFtF7tPEJHUY3h2vVV'),
oracleSource: OracleSource.PYTH_STABLE_COIN_PULL,
mint: new PublicKey('USDSwr9ApdHk5bvJKMjzff41FfuX8bSxdKcR81vTwcA'),
Expand Down
1 change: 1 addition & 0 deletions sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,7 @@ export type UserAccount = {
hasOpenAuction: boolean;
lastFuelBonusUpdateTs: number;
marginMode: MarginMode;
poolId: number;
};

export type SpotPosition = {
Expand Down
3 changes: 3 additions & 0 deletions sdk/tests/dlob/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ export const mockSpotMarkets: Array<SpotMarketAccount> = [
fuelBoostMaker: 0,
fuelBoostInsurance: 0,
tokenProgram: 0,
poolId: 0,
},
{
status: MarketStatus.ACTIVE,
Expand Down Expand Up @@ -465,6 +466,7 @@ export const mockSpotMarkets: Array<SpotMarketAccount> = [
fuelBoostMaker: 0,
fuelBoostInsurance: 0,
tokenProgram: 0,
poolId: 0,
},
{
status: MarketStatus.ACTIVE,
Expand Down Expand Up @@ -556,6 +558,7 @@ export const mockSpotMarkets: Array<SpotMarketAccount> = [
fuelBoostMaker: 0,
fuelBoostInsurance: 0,
tokenProgram: 0,
poolId: 0,
},
];

Expand Down
1 change: 1 addition & 0 deletions sdk/tests/user/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ export const mockUserAccount: UserAccount = {
hasOpenAuction: false,
lastFuelBonusUpdateTs: 0,
marginMode: MarginMode.DEFAULT,
poolId: 0,
};

0 comments on commit 3e18eed

Please sign in to comment.