2 Commits

Author SHA256 Message Date
minimons b14cfdb52e X: Update publishGitHub script 2026-07-03 11:05:52 +02:00
minimons 79b654e336 21: Add sizeUsd to JupiterPerpsPosition 2026-06-29 15:54:21 +02:00
2 changed files with 23 additions and 3 deletions
+21 -3
View File
@@ -1,21 +1,39 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <github-snapshot-branch>" >&2
exit 1
fi
BRANCH="$1"
SOURCE="$HOME/projects/com_r35157_nenjim-hubd-api" SOURCE="$HOME/projects/com_r35157_nenjim-hubd-api"
TARGET="$HOME/projects/com_r35157_nenjim-hubd-api_github_snapshot" TARGET="$HOME/projects/com_r35157_nenjim-hubd-api_github_snapshot"
cd "$TARGET"
git fetch origin
if git show-ref --verify --quiet "refs/heads/$BRANCH"; then
git switch "$BRANCH"
elif git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
git switch --track "origin/$BRANCH"
else
git switch --create "$BRANCH"
fi
rsync -a --delete \ rsync -a --delete \
--exclude '.git' \ --exclude '.git' \
"$SOURCE/" \ "$SOURCE/" \
"$TARGET/" "$TARGET/"
cd "$TARGET"
git add -A git add -A
if git diff --cached --quiet; then if git diff --cached --quiet; then
echo "No snapshot changes to publish." echo "No snapshot changes to publish on branch '$BRANCH'."
exit 0 exit 0
fi fi
git commit -m "Mirror snapshot" git commit -m "Mirror snapshot"
git push git push -u origin "$BRANCH"
@@ -13,6 +13,7 @@ import java.math.BigDecimal;
* @param entryPrice the entry price of the position, denominated in USDC * @param entryPrice the entry price of the position, denominated in USDC
* @param direction whether the position is long or short * @param direction whether the position is long or short
* @param tradedTokenMint the mint address of the token being traded * @param tradedTokenMint the mint address of the token being traded
* @param sizeUsd the size of this position in USD
* @param collateralUsd the amount of USD representing the collateral for this position * @param collateralUsd the amount of USD representing the collateral for this position
*/ */
public record JupiterPerpsPosition( public record JupiterPerpsPosition(
@@ -20,6 +21,7 @@ public record JupiterPerpsPosition(
ΩUSDCPriceΩ entryPrice, ΩUSDCPriceΩ entryPrice,
JupiterPerpsPositionDirection direction, JupiterPerpsPositionDirection direction,
ΩSPLMintAddressΩ tradedTokenMint, ΩSPLMintAddressΩ tradedTokenMint,
ΩUSDCAmountΩ sizeUsd,
ΩUSDCAmountΩ collateralUsd ΩUSDCAmountΩ collateralUsd
) { ) {
} }