Skip to content

Commit b6eff53

Browse files
committed
cursor bugs
1 parent 0dad8c5 commit b6eff53

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

python/client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,12 @@ def sign_hash(hash_hex):
6464

6565
def get_mid(coin):
6666
"""Get the current mid price for a coin from Hyperliquid."""
67-
r = requests.post("https://api.hyperliquid.xyz/info", json={"type": "allMids"})
67+
r = requests.post(HL_INFO_URL, json={"type": "allMids"})
68+
return float(r.json().get(coin, 0))
69+
70+
71+
def get_hip3_mid(coin):
72+
"""Get mid price for a HIP-3 market (requires dex parameter)."""
73+
dex = coin.split(":")[0]
74+
r = requests.post(HL_INFO_URL, json={"type": "allMids", "dex": dex})
6875
return float(r.json().get(coin, 0))

rust/examples/hip3_order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async fn main() {
1313
mid = 78.0;
1414
}
1515

16-
let sz = format!("{:.2}", 10.0 / mid);
16+
let sz = format!("{:.2}", 11.0 / mid);
1717
let buy_px = format!("{:.2}", mid * 1.03);
1818

1919
println!("{COIN} mid: ${mid:.2}");

typescript/src/hip3Order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function main() {
99
mid = 78.0;
1010
}
1111

12-
const sz = (10.0 / mid).toFixed(2);
12+
const sz = (11.0 / mid).toFixed(2);
1313
const buyPx = (mid * 1.03).toFixed(2);
1414

1515
console.log(`${COIN} mid: $${mid.toFixed(2)}`);

0 commit comments

Comments
 (0)