You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,13 @@ Examples on how to do this can be found here:
103
103
-`spot_get_account_assets_http.py`
104
104
-`spot_get_account_assets_ws.py`
105
105
106
+
Moving money to / from subaccounts is possible for spot assets.
107
+
For USDC, you can move directly from main perp balance to subaccount spot balance, for example.
108
+
More details can be found in the following example:
109
+
-`sub_account_create.py`
110
+
-`sub_account_transfer_eth.py`
111
+
-`sub_account_transfer_usdc.py`
112
+
106
113
## Public Pools
107
114
Public pools behave just like subaccounts, except that anyone can join them.
108
115
You can create / modify a public pool using the SDK. Check out the following example:
@@ -118,6 +125,33 @@ If you want to deposit / withdraw from a public pool, check the following exampl
118
125
To get information about pools, check:
119
126
-`public_pool_info.py`
120
127
128
+
## Moving funds around
129
+
-`withdraw_fast.py`
130
+
- send USDC directly from Lighter to Arbitrum
131
+
-`withdraw_normal.py`
132
+
- send USDC/ETH from Lighter to Ethereum
133
+
-`transfer.py`
134
+
- generic example of how to transfer funds between accounts.
135
+
- same functionality as `sub_account_transfer_eth` and `sub_account_transfer_usdc`
136
+
137
+
## Transfer Notes
138
+
The `memo` field is a user message, and it has to be exactly 32 bytes long. In case of fast withdrawals, you need to specify the recipient in the memo.
139
+
This is the case since the memo is part of the signature. This way, the recipient is verified.
140
+
141
+
When calling `client.transfer`, you pass the amount without needing to worry about the decimals.
142
+
When calling `client.sign_transfer` on the other hand, you need to specify the decimals and pass an integer.
143
+
144
+
The `fee` field can be obtained by calling `info_api.transfer_fee_info(...)`. The field can be passed as it is.
145
+
Transfers between subaccounts are free for all assets.
146
+
147
+
When sending assets, you can specify the source and destination routes.
148
+
A route is either `perp` or `spot`. You can send USDC directly from your perp balance to another person's spot balance.
149
+
If you receive USDC in your perp account, it will be instantly used as collateral for open positions.
150
+
This also allows you to move USDC from your spot balance to your perp balance.
151
+
Spot assets (like ETH) need to have both the from and to route set to `spot`.
152
+
You can get all `asset_id`s by following the example below:
153
+
-`spot_get_order_books.py`
154
+
121
155
## Setup steps for mainnet
122
156
- deposit money on Lighter to create an account first
0 commit comments