From 0223ead60d95cec25bc119b9c5b7f13189184277 Mon Sep 17 00:00:00 2001 From: soundsonacid Date: Tue, 16 Jul 2024 12:24:19 -0500 Subject: [PATCH] update market constants --- src/driftpy/constants/perp_markets.py | 72 +++++++++++++-------------- src/driftpy/constants/spot_markets.py | 32 ++++++------ tests/ci/devnet.py | 12 ++--- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/driftpy/constants/perp_markets.py b/src/driftpy/constants/perp_markets.py index 0b344230..c6d26728 100644 --- a/src/driftpy/constants/perp_markets.py +++ b/src/driftpy/constants/perp_markets.py @@ -46,7 +46,7 @@ class PerpMarketConfig: base_asset_symbol="1MBONK", market_index=4, oracle=Pubkey.from_string("GojbSnJuPdKDT1ZuHuAM5t9oz6bxTo1xhUKpTua2F72p"), - oracle_source=OracleSource.PythPull(), + oracle_source=OracleSource.Pyth1MPull(), ), PerpMarketConfig( symbol="MATIC-PERP", @@ -88,7 +88,7 @@ class PerpMarketConfig: base_asset_symbol="1MPEPE", market_index=10, oracle=Pubkey.from_string("CLxofhtzvLiErpn25wvUzpZXEqBhuZ6WMEckEraxyuGt"), - oracle_source=OracleSource.PythPull(), + oracle_source=OracleSource.Pyth1MPull(), ), PerpMarketConfig( symbol="OP-PERP", @@ -230,50 +230,50 @@ class PerpMarketConfig: symbol="1MBONK-PERP", base_asset_symbol="1MBONK", market_index=4, - oracle=Pubkey.from_string("8ihFLu5FimgTQ1Unh4dVyEHUGodJ5gJQCrQf4KUVB9bN"), - oracle_source=OracleSource.Pyth1M(), + oracle=Pubkey.from_string("GojbSnJuPdKDT1ZuHuAM5t9oz6bxTo1xhUKpTua2F72p"), + oracle_source=OracleSource.Pyth1MPull(), ), PerpMarketConfig( symbol="MATIC-PERP", base_asset_symbol="MATIC", market_index=5, - oracle=Pubkey.from_string("7KVswB9vkCgeM3SHP7aGDijvdRAHK8P5wi9JXViCrtYh"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("5Wf1WrXLeNJghU8WRo5odvwAjpjSSF4THbjdxbKmwVsi"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="ARB-PERP", base_asset_symbol="ARB", market_index=6, - oracle=Pubkey.from_string("5HRrdmghsnU3i2u5StaKaydS7eq3vnKVKwXMzCNKsc4C"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("8ocfAdqVRnzvfdubQaTxar4Kz5HJhNbPNmkLxswqiHUD"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="DOGE-PERP", base_asset_symbol="DOGE", market_index=7, - oracle=Pubkey.from_string("FsSM3s38PX9K7Dn6eGzuE29S2Dsk1Sss1baytTQdCaQj"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("23y63pHVwKfYSCDFdiGRaGbTYWoyr8UzhUE7zukyf6gK"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="BNB-PERP", base_asset_symbol="BNB", market_index=8, - oracle=Pubkey.from_string("4CkQJBxhU8EZ2UjhigbtdaPbpTe6mqf811fipYBFbSYN"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("Dk8eWjuQHMbxJAwB9Sg7pXQPH4kgbg8qZGcUrWcD9gTm"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="SUI-PERP", base_asset_symbol="SUI", market_index=9, - oracle=Pubkey.from_string("3Qub3HaAJaa2xNY7SUqPKd3vVwTqDfDDkEUMPjXD2c1q"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("HBordkz5YxjzNURmKUY4vfEYFG9fZyZNeNF1VDLMoemT"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="1MPEPE-PERP", base_asset_symbol="1MPEPE", market_index=10, - oracle=Pubkey.from_string("FSfxunDmjjbDV2QxpyxFCAPKmYJHSLnLuvQXDLkMzLBm"), - oracle_source=OracleSource.Pyth1M(), + oracle=Pubkey.from_string("CLxofhtzvLiErpn25wvUzpZXEqBhuZ6WMEckEraxyuGt"), + oracle_source=OracleSource.Pyth1MPull(), ), PerpMarketConfig( symbol="OP-PERP", @@ -286,8 +286,8 @@ class PerpMarketConfig: symbol="RNDR-PERP", base_asset_symbol="RNDR", market_index=12, - oracle=Pubkey.from_string("CYGfrBJB9HgLf9iZyN4aH5HvUAi2htQ4MjPxeXMf4Egn"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("F3mPHRtJqqq57JPDBmUwUVhpyPLmjE5dAzDfpVgpFkug"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="XRP-PERP", @@ -300,22 +300,22 @@ class PerpMarketConfig: symbol="HNT-PERP", base_asset_symbol="HNT", market_index=14, - oracle=Pubkey.from_string("7moA1i5vQUpfDwSpK6Pw9s56ahB7WFGidtbL2ujWrVvm"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("9b1rcK9RUPK2vAqwNYCYEG34gUVpS2WGs2YCZZy2X5Tb"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="INJ-PERP", base_asset_symbol="INJ", market_index=15, - oracle=Pubkey.from_string("9EdtbaivHQYA4Nh3XzGR6DwRaoorqXYnmpfsnFhvwuVj"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("BfXcyDWJmYADa5eZD7gySSDd6giqgjvm7xsAhQ239SUD"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="LINK-PERP", base_asset_symbol="LINK", market_index=16, - oracle=Pubkey.from_string("ALdkqQDMfHNg77oCNskfX751kHys4KE7SFuZzuKaN536"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("Gwvob7yoLMgQRVWjScCRyQFMsgpRKrSAYisYEyjDJwEp"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="RLB-PERP", @@ -342,22 +342,22 @@ class PerpMarketConfig: symbol="JTO-PERP", base_asset_symbol="JTO", market_index=20, - oracle=Pubkey.from_string("D8UUgr8a3aR3yUeHLu7v8FWK7E8Y5sSU7qrYBXUJXBQ5"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("Ffq6ACJ17NAgaxC6ocfMzVXL3K61qxB2xHg6WUawWPfP"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="SEI-PERP", base_asset_symbol="SEI", market_index=21, - oracle=Pubkey.from_string("6cUuAyAX3eXoiWkjFF77RQBEUF15AAMQ7d1hm4EPd3tv"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("EVyoxFo5jWpv1vV7p6KVjDWwVqtTqvrZ4JMFkieVkVsD"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="AVAX-PERP", base_asset_symbol="AVAX", market_index=22, - oracle=Pubkey.from_string("Ax9ujW5B9oqcv59N8m6f1BpTBq2rGeGaBcpKjC5UYsXU"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("FgBGHNex4urrBmNbSj8ntNQDGqeHcWewKtkvL6JE6dEX"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="WIF-PERP", @@ -391,8 +391,8 @@ class PerpMarketConfig: symbol="W-PERP", base_asset_symbol="W", market_index=27, - oracle=Pubkey.from_string("H9j8CT1bFiWHaZUPMooEaxMRHdWdJ5T9CzFn41z96JHW"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("4HbitGsdcFbtFotmYscikQFAAKJ3nYx4t7sV7fTvsk8U"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="KMNO-PERP", @@ -405,8 +405,8 @@ class PerpMarketConfig: symbol="TNSR-PERP", base_asset_symbol="TNSR", market_index=29, - oracle=Pubkey.from_string("7Cfyymx49ipGsgEsCA2XygAB2DUsan4C6Cyb5c8oR5st"), - oracle_source=OracleSource.Switchboard(), + oracle=Pubkey.from_string("13jpjpVyU5hGpjsZ4HzCcmBo85wze4N8Au7U6cC3GMip"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="DRIFT-PERP", @@ -433,8 +433,8 @@ class PerpMarketConfig: symbol="ZEX-PERP", base_asset_symbol="ZEX", market_index=33, - oracle=Pubkey.from_string("4gdbqxkMrF1bYVeEJKRmTqCCvJjRCZrRhxvriGY6SwLj"), - oracle_source=OracleSource.Switchboard(), + oracle=Pubkey.from_string("HVwBCaR4GEB1fHrp7xCTzbYoZXL3V8b1aek2swPrmGx3"), + oracle_source=OracleSource.PythPull(), ), PerpMarketConfig( symbol="POPCAT-PERP", diff --git a/src/driftpy/constants/spot_markets.py b/src/driftpy/constants/spot_markets.py index 6c90728f..521a0b8e 100644 --- a/src/driftpy/constants/spot_markets.py +++ b/src/driftpy/constants/spot_markets.py @@ -56,8 +56,8 @@ class SpotMarketConfig: SpotMarketConfig( symbol="mSOL", market_index=2, - oracle=Pubkey.from_string("E4v1BBgoso9s64TQvmyownAVJbhbEPGyzA3qn4n46qj9"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("FAq7hqjn7FWGXKDwJHzsXGgBcydGTcK4kziJpAGWXjDb"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"), ), SpotMarketConfig( @@ -98,15 +98,15 @@ class SpotMarketConfig: SpotMarketConfig( symbol="bSOL", market_index=8, - oracle=Pubkey.from_string("AFrYBhb5wKQtxRS9UA9YRS4V3dwFm7SqmS6DHKq6YVgo"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("BmDWPMsytWmYkh9n6o7m79eVshVYf2B5GVaqQ2EWKnGH"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1"), ), SpotMarketConfig( symbol="JTO", market_index=9, - oracle=Pubkey.from_string("D8UUgr8a3aR3yUeHLu7v8FWK7E8Y5sSU7qrYBXUJXBQ5"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("Ffq6ACJ17NAgaxC6ocfMzVXL3K61qxB2xHg6WUawWPfP"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL"), ), SpotMarketConfig( @@ -126,22 +126,22 @@ class SpotMarketConfig: SpotMarketConfig( symbol="RNDR", market_index=12, - oracle=Pubkey.from_string("CYGfrBJB9HgLf9iZyN4aH5HvUAi2htQ4MjPxeXMf4Egn"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("F3mPHRtJqqq57JPDBmUwUVhpyPLmjE5dAzDfpVgpFkug"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("rndrizKT3MK1iimdxRdWabcF7Zg7AR5T4nud4EkHBof"), ), SpotMarketConfig( symbol="W", market_index=13, - oracle=Pubkey.from_string("H9j8CT1bFiWHaZUPMooEaxMRHdWdJ5T9CzFn41z96JHW"), - oracle_source=OracleSource.Pyth(), + oracle=Pubkey.from_string("4HbitGsdcFbtFotmYscikQFAAKJ3nYx4t7sV7fTvsk8U"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("85VBFQZC9TZkfaptBWjvUw7YbZjy52A6mjtPGjstQAmQ"), ), SpotMarketConfig( symbol="TNSR", market_index=14, - oracle=Pubkey.from_string("7Cfyymx49ipGsgEsCA2XygAB2DUsan4C6Cyb5c8oR5st"), - oracle_source=OracleSource.Switchboard(), + oracle=Pubkey.from_string("13jpjpVyU5hGpjsZ4HzCcmBo85wze4N8Au7U6cC3GMip"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6"), ), SpotMarketConfig( @@ -154,8 +154,8 @@ class SpotMarketConfig: SpotMarketConfig( symbol="INF", market_index=16, - oracle=Pubkey.from_string("81SuhCcCQri9w4yPyv56ErtpXuncVyFCDT3fYehceG1M"), - oracle_source=OracleSource.Switchboard(), + oracle=Pubkey.from_string("B7RUYg2zF6UdUSHv2RmpnriPVJccYWojgFydNS1NY5F8"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("5oVNBeEEQvYi1cX3ir8Dx5n1P7pdxydbGF2X4TxVusJm"), ), SpotMarketConfig( @@ -168,8 +168,8 @@ class SpotMarketConfig: SpotMarketConfig( symbol="USDY", market_index=18, - oracle=Pubkey.from_string("DiqUGbq5CV8Tjcae1whjrX97qPo6gU7BKAvKNFc2vrX8"), - oracle_source=OracleSource.Switchboard(), + oracle=Pubkey.from_string("BPTQgHV4y2x4jvKPPkkd9aS8jY7L3DGZBwjEZC8Vm27o"), + oracle_source=OracleSource.PythPull(), mint=Pubkey.from_string("A1KLoBrKBde8Ty9qtNQUtq3C2ortoC3u7twggz7sEto6"), ), SpotMarketConfig( diff --git a/tests/ci/devnet.py b/tests/ci/devnet.py index 9776ca2b..469e49c8 100644 --- a/tests/ci/devnet.py +++ b/tests/ci/devnet.py @@ -46,13 +46,13 @@ async def test_devnet_constants(rpc_url: str): for expected, received in zip(expected_perp_markets, received_perp_markets): assert ( expected.market_index == received.market_index - ), f"Perp: Expected market index {expected.market_index}, got {received.market_index} Market: {received.pubkey}" + ), f"Devnet Perp: Expected market index {expected.market_index}, got {received.market_index} Market: {received.pubkey}" assert str(expected.oracle) == str( received.amm.oracle - ), f"Perp: Expected oracle {expected.oracle}, got {received.amm.oracle} Market: {received.pubkey} Market Index: {received.market_index}" + ), f"Devnet Perp: Expected oracle {expected.oracle}, got {received.amm.oracle} Market: {received.pubkey} Market Index: {received.market_index}" assert str(expected.oracle_source) == str( received.amm.oracle_source - ), f"Perp: Expected oracle source {expected.oracle_source}, got {received.amm.oracle_source} Market: {received.pubkey} Market Index: {received.market_index}" + ), f"Devnet Perp: Expected oracle source {expected.oracle_source}, got {received.amm.oracle_source} Market: {received.pubkey} Market Index: {received.market_index}" expected_spot_markets = sorted( devnet_spot_market_configs, key=lambda market: market.market_index @@ -64,13 +64,13 @@ async def test_devnet_constants(rpc_url: str): for expected, received in zip(expected_spot_markets, received_spot_markets): assert ( expected.market_index == received.market_index - ), f"Spot: Expected market index {expected.market_index}, got {received.market_index} Market: {received.pubkey}" + ), f"Devnet Spot: Expected market index {expected.market_index}, got {received.market_index} Market: {received.pubkey}" assert str(expected.oracle) == str( received.oracle - ), f"Spot: Expected oracle {expected.oracle}, got {received.oracle} Market: {received.pubkey} Market Index: {received.market_index}" + ), f"Devnet Spot: Expected oracle {expected.oracle}, got {received.oracle} Market: {received.pubkey} Market Index: {received.market_index}" assert str(expected.oracle_source) == str( received.oracle_source - ), f"Spot: Expected oracle source {expected.oracle_source}, got {received.oracle_source} Market: {received.pubkey} Market Index: {received.market_index}" + ), f"Devnet Spot: Expected oracle source {expected.oracle_source}, got {received.oracle_source} Market: {received.pubkey} Market Index: {received.market_index}" @mark.asyncio