Skip to content

Commit

Permalink
update to newest deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNineteen committed Nov 4, 2022
1 parent f401230 commit 12ae860
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions examples/start_if_stake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand All @@ -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':

Expand Down
2 changes: 1 addition & 1 deletion protocol-v2
Submodule protocol-v2 updated 49 files
+1 −1 Anchor.toml
+1 −1 cli/cli.ts
+1 −1 docs/sdk/index.html
+12 −10 programs/drift/src/controller/insurance.rs
+3 −3 programs/drift/src/controller/liquidation.rs
+7 −7 programs/drift/src/controller/liquidation/tests.rs
+2 −2 programs/drift/src/controller/orders.rs
+0 −1 programs/drift/src/controller/orders/tests.rs
+0 −11 programs/drift/src/controller/pnl/delisting.rs
+0 −12 programs/drift/src/controller/pnl/tests.rs
+0 −4 programs/drift/src/controller/repeg/tests.rs
+68 −38 programs/drift/src/controller/spot_balance/tests.rs
+4 −0 programs/drift/src/error.rs
+2 −1 programs/drift/src/instructions/admin.rs
+28 −0 programs/drift/src/instructions/user.rs
+1 −1 programs/drift/src/lib.rs
+6 −1 programs/drift/src/math/amm.rs
+100 −0 programs/drift/src/math/amm/tests.rs
+1 −1 programs/drift/src/math/ceil_div.rs
+3 −2 programs/drift/src/math/constants.rs
+45 −0 programs/drift/src/math/floor_div.rs
+118 −0 programs/drift/src/math/funding/tests.rs
+101 −9 programs/drift/src/math/margin.rs
+364 −1 programs/drift/src/math/margin/tests.rs
+1 −0 programs/drift/src/math/mod.rs
+0 −1 programs/drift/src/math/oracle/tests.rs
+4 −4 programs/drift/src/math/repeg.rs
+39 −1 programs/drift/src/math/safe_math.rs
+23 −11 programs/drift/src/math/spot_balance.rs
+1 −1 programs/drift/src/state/insurance_fund_stake.rs
+5 −0 programs/drift/src/state/perp_market_map.rs
+5 −0 programs/drift/src/state/spot_market_map.rs
+2 −4 programs/drift/src/state/state.rs
+1 −3 sdk/README.md
+1 −1 sdk/package.json
+7 −6 sdk/src/config.ts
+12 −1 sdk/src/constants/perpMarkets.ts
+10 −0 sdk/src/constants/spotMarkets.ts
+1 −1 sdk/src/driftClient.ts
+6 −3 sdk/src/events/fetchLogs.ts
+1 −1 sdk/src/examples/makeTradeExample.ts
+16 −10 sdk/src/idl/drift.json
+2 −2 sdk/src/types.ts
+21 −21 sdk/yarn.lock
+42 −32 test-scripts/run-anchor-tests.sh
+7 −3 tests/liquidatePerp.ts
+3 −2 tests/liquidateSpot.ts
+1 −1 tests/liquidateSpotSocialLoss.ts
+34 −6 tests/spotDepositWithdraw.ts
2 changes: 1 addition & 1 deletion src/driftpy/constants/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 12ae860

Please sign in to comment.