Skip to content

Commit

Permalink
failed attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
leomassazza committed Jul 14, 2023
1 parent 6da0435 commit 32c65bc
Showing 1 changed file with 48 additions and 22 deletions.
70 changes: 48 additions & 22 deletions markets/perps-market/test/integration/Position/PnL.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,28 @@ describe('Position - pnl', () => {
};
const ethPrice = bn(1000);

const { systems, perpsMarkets, synthMarkets, provider, trader1, keeper } = bootstrapMarkets({
synthMarkets: [
{
name: 'Bitcoin',
token: 'snxBTC',
buyPrice: bn(10_000),
sellPrice: bn(10_000),
},
],
perpsMarkets: [
{
name: 'Ether',
token: 'snxETH',
price: ethPrice,
// setting to 0 to avoid funding and p/d price change affecting pnl
fundingParams: { skewScale: bn(0), maxFundingVelocity: bn(0) },
orderFees,
},
],
traderAccountIds: [2, 3],
});
const { systems, perpsMarkets, synthMarkets, provider, trader1, trader2, keeper } =

Check warning on line 15 in markets/perps-market/test/integration/Position/PnL.test.ts

View workflow job for this annotation

GitHub Actions / lint

'trader2' is assigned a value but never used
bootstrapMarkets({
synthMarkets: [
{
name: 'Bitcoin',
token: 'snxBTC',
buyPrice: bn(10_000),
sellPrice: bn(10_000),
},
],
perpsMarkets: [
{
name: 'Ether',
token: 'snxETH',
price: ethPrice,
// setting to 0 to avoid funding and p/d price change affecting pnl
fundingParams: { skewScale: bn(0), maxFundingVelocity: bn(0) },
orderFees,
},
],
traderAccountIds: [2, 3],
});

let ethMarketId: ethers.BigNumber;
let btcSynth: SynthMarkets[number];
Expand All @@ -44,7 +45,32 @@ describe('Position - pnl', () => {
btcSynth = synthMarkets()[0];
});

// TODO Need to add some snxUSD to the market in order to pay the gains to the trader
// TODO Need to add some liquidity in order to pay the gains to the trader
before('add liquidity that will be used to pay for trader gains', async () => {
// **NOTE** it didn't work that way
//
// await depositCollateral({
// systems,
// trader: trader2,
// accountId: () => 3,
// collaterals: [
// {
// snxUSDAmount: () => bn(100_000),
// },
// ],
// });
// await openPosition({
// systems,
// provider,
// trader: trader2(),
// accountId: 3,
// marketId: ethMarketId,
// settlementStrategyId: perpsMarket.strategyId(),
// keeper: keeper(),
// sizeDelta: bn(10),
// price: ethPrice,
// });
});

const collateralTestCases = [
{
Expand Down

0 comments on commit 32c65bc

Please sign in to comment.