Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position management #27

Merged
merged 13 commits into from
Dec 7, 2024
Merged

Position management #27

merged 13 commits into from
Dec 7, 2024

Conversation

mootz12
Copy link
Contributor

@mootz12 mootz12 commented Nov 13, 2024

No description provided.

@mootz12 mootz12 requested a review from Ryang-21 November 13, 2024 19:30
['ASSET1', 100n],
['ASSET3', 200n],
]),
lot: new Map<string, bigint>([['ASSET1', 100n]]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the lot should match something in profits same with the test below

@@ -43,6 +43,8 @@ describe('validateAppConfig', () => {
keypair: Keypair.random().secret(),
minProfitPct: 1,
minHealthFactor: 1,
primaryAsset: 'asset',
minPrimaryCollateral: '100',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add tests for validating profit

@@ -9,8 +9,8 @@
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@blend-capital/blend-sdk": "^2.0.3",
"@stellar/stellar-sdk": "^12.3.0",
"@blend-capital/blend-sdk": "2.1.1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update to 2.1.2

src/auction.ts Outdated
} else {
throw new Error(`Failed to value bid asset: ${assetId}`);
}
}

return { effectiveCollateral, effectiveLiabilities, lotValue, bidValue };
return { effectiveCollateral, effectiveLiabilities, repayableLiabilities, lotValue, bidValue };
Copy link
Collaborator

@Ryang-21 Ryang-21 Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repayableLiabilities is no longer used

const pool = await sorobanHelper.loadPool();
const poolOracle = await sorobanHelper.loadPoolOracle();
const filler_user = await sorobanHelper.loadUser(filler_pubkey);
const filler_balances = await sorobanHelper.loadBalances(filler_pubkey, filler_tokens);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use getFillerBalances

src/filler.ts Outdated
Comment on lines 131 to 134
if (isNative) {
tokenBalance =
tokenBalance > FixedMath.toFixed(50, 7) ? tokenBalance - FixedMath.toFixed(50, 7) : 0n;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary if getFillerAvailableBalance is used

@mootz12 mootz12 merged commit ac8f90d into main Dec 7, 2024
1 check passed
@mootz12 mootz12 deleted the position-management branch December 7, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants