-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
['ASSET1', 100n], | ||
['ASSET3', 200n], | ||
]), | ||
lot: new Map<string, bigint>([['ASSET1', 100n]]), |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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
package-lock.json
Outdated
@@ -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", |
There was a problem hiding this comment.
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 }; |
There was a problem hiding this comment.
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
src/bidder_submitter.ts
Outdated
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); |
There was a problem hiding this comment.
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
if (isNative) { | ||
tokenBalance = | ||
tokenBalance > FixedMath.toFixed(50, 7) ? tokenBalance - FixedMath.toFixed(50, 7) : 0n; | ||
} |
There was a problem hiding this comment.
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
No description provided.