@@ -163,7 +163,7 @@ def get_largest_perp_positions(request: BackendRequest, market_index: int = None
163
163
# Store position info with actual value
164
164
all_positions .append ((
165
165
base_asset_value , # Actual value for sorting
166
- user .user_public_key ,
166
+ str ( user .user_public_key ) ,
167
167
position .market_index ,
168
168
position .base_asset_amount / BASE_PRECISION , # Keep original sign for display
169
169
))
@@ -239,7 +239,7 @@ def get_most_levered_perp_positions_above_1m(request: BackendRequest, market_ind
239
239
if base_asset_value > 1_000_000 :
240
240
item = (
241
241
to_financial (base_asset_value ),
242
- user .user_public_key ,
242
+ str ( user .user_public_key ) ,
243
243
position .market_index ,
244
244
position .base_asset_amount / BASE_PRECISION ,
245
245
leverage ,
@@ -303,7 +303,7 @@ def get_largest_spot_borrows(request: BackendRequest, market_index: int = None):
303
303
) * market_price_ui
304
304
item = (
305
305
to_financial (borrow_value ),
306
- user .user_public_key ,
306
+ str ( user .user_public_key ) ,
307
307
position .market_index ,
308
308
position .scaled_balance / SPOT_BALANCE_PRECISION ,
309
309
)
@@ -380,15 +380,15 @@ def get_most_levered_spot_borrows_above_1m(request: BackendRequest, market_index
380
380
381
381
error_positions .append ({
382
382
"market_index" : position .market_index ,
383
- "public_key" : user .user_public_key ,
383
+ "public_key" : str ( user .user_public_key ) ,
384
384
"scaled_balance" : scaled_balance ,
385
385
"error" : position_error
386
386
})
387
387
388
388
# Add this one with error
389
389
item = (
390
390
borrow_value , # Will be sorted last due to 0 value
391
- user .user_public_key ,
391
+ str ( user .user_public_key ) ,
392
392
position .market_index ,
393
393
scaled_balance ,
394
394
leverage ,
@@ -412,7 +412,7 @@ def get_most_levered_spot_borrows_above_1m(request: BackendRequest, market_index
412
412
if borrow_value > 750_000 :
413
413
item = (
414
414
to_financial (borrow_value ),
415
- user .user_public_key ,
415
+ str ( user .user_public_key ) ,
416
416
position .market_index ,
417
417
position .scaled_balance / SPOT_BALANCE_PRECISION ,
418
418
leverage ,
@@ -429,7 +429,7 @@ def get_most_levered_spot_borrows_above_1m(request: BackendRequest, market_index
429
429
# Add error position
430
430
error_positions .append ({
431
431
"market_index" : position .market_index ,
432
- "public_key" : user .user_public_key ,
432
+ "public_key" : str ( user .user_public_key ) ,
433
433
"scaled_balance" : position .scaled_balance / SPOT_BALANCE_PRECISION ,
434
434
"error" : position_error
435
435
})
@@ -487,7 +487,7 @@ def get_largest_spot_borrow_per_market(request: BackendRequest):
487
487
) * market_price_ui
488
488
borrow_item = (
489
489
to_financial (borrow_value ),
490
- user .user_public_key ,
490
+ str ( user .user_public_key ) ,
491
491
position .market_index ,
492
492
position .scaled_balance / SPOT_BALANCE_PRECISION ,
493
493
)
0 commit comments