From 12ae860afd312af060a095425fa3e3bed239fa60 Mon Sep 17 00:00:00 2001 From: 0xNineteen <0x39015319@gmail.com> Date: Fri, 4 Nov 2022 12:56:07 +0000 Subject: [PATCH] update to newest deploy --- examples/start_if_stake.py | 18 +++++++++++++++--- protocol-v2 | 2 +- src/driftpy/constants/config.py | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/examples/start_if_stake.py b/examples/start_if_stake.py index 728b2998..4844f488 100644 --- a/examples/start_if_stake.py +++ b/examples/start_if_stake.py @@ -53,10 +53,11 @@ async def main( chu = ClearingHouseUser(ch) from spl.token.instructions import get_associated_token_address - usdc_market = await get_spot_market_account(ch.program, spot_market_index) - usdc_mint = usdc_market.mint + spot_market = await get_spot_market_account(ch.program, spot_market_index) + spot_mint = spot_market.mint - ata = get_associated_token_address(wallet.public_key, usdc_mint) + ata = get_associated_token_address(wallet.public_key, spot_mint) + ch.spot_market_atas[spot_market_index] = ata ch.usdc_ata = ata balance = await connection.get_token_account_balance(ata) print('current spot ata balance:', balance['result']['value']['uiAmount']) @@ -76,6 +77,17 @@ async def main( print('initializing stake account...') await ch.initialize_insurance_fund_stake(spot_market_index) + # if_stake = await get_if_stake_account( + # ch.program, ch.authority, spot_market_index + # ) + # market = await get_spot_market_account( + # ch.program, spot_market_index + # ) + # print( + # if_stake.market_index, + # ch.program_id + # ) + await ch.add_insurance_fund_stake(spot_market_index, if_amount) elif operation == 'remove': diff --git a/protocol-v2 b/protocol-v2 index ed743447..5fac104a 160000 --- a/protocol-v2 +++ b/protocol-v2 @@ -1 +1 @@ -Subproject commit ed7434476ea52996698cc4f6cd1a9fe355872d2d +Subproject commit 5fac104af5780a005cdac46de8a702e3918a41ae diff --git a/src/driftpy/constants/config.py b/src/driftpy/constants/config.py index d6f37e6d..a04313c2 100644 --- a/src/driftpy/constants/config.py +++ b/src/driftpy/constants/config.py @@ -18,7 +18,7 @@ class Config: "devnet": Config( env='devnet', pyth_oracle_mapping_address=PublicKey('BmA9Z6FjioHJPpjT39QazZyhDRUdZy2ezwx4GiDdE2u2'), - clearing_house_program_id=PublicKey('4PzAUP84r19y2whicgTysCiqxw5aHabLHyDh3oJiAtqe'), + clearing_house_program_id=PublicKey('dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH'), usdc_mint_address=PublicKey('8zGuJQqwhZafTah7Uc7Z4tXRnguqkn5KLFAP8oV6PHe2'), markets=devnet_markets, banks=devnet_banks,