Skip to content

Commit

Permalink
add transfer deposit python docs
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Nov 27, 2023
1 parent c64694f commit 1da5eac
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ driftClient.withdraw(

```python

spot_market_index = 0 # USDC
amount = drift_client.convert_to_spot_precision(spot_market_index, 100) # $100
market_index = 0 # USDC
amount = drift_client.convert_to_spot_precision(market_index, 100) # $100

tx_sig = await drift_client.withdraw(amount, spot_market_index)
```
Expand Down Expand Up @@ -334,6 +334,20 @@ driftClient.transferDeposit(
);
```

```python
market_index = 0
amount = drift_client.convert_to_spot_precision(market_ndex, 100)
from_sub_account_id = 0
to_sub_account_id = 0

await drift_client.transfer_deposit(
amount,
market_index,
from_sub_account_id,
to_sub_account_id,
)
```

| Parameter | Description | Optional | Default |
| ----------- | ----------- | -------- | ------- |
| amount | The amount to transfer in spot market's token mint precision | No | |
Expand Down

0 comments on commit 1da5eac

Please sign in to comment.