AlphaCapture Protocol
  • Getting Started
    • Overview
    • Use Cases
  • Basic Concepts
    • Proof of Performance
      • Proof of Idea
      • Proof of Trade
    • Pricing
      • Stop Losses
      • Supported Assets
    • Access Control
    • zkSubscription
      • Marketplaces
    • Verification
    • FAQs
  • SDK Reference
    • Installation
    • Strategies
      • Retrieving Strategies
        • My Strategies
        • Accessible Strategies
        • All Strategies
        • Creator Strategies
      • Get Strategy (Signal)
      • Get Strategy (Rebalance)
        • Get Rebalances
        • Get Rebalance (Single)
        • Get Current Portfolio
    • Ideas
      • Retrieving Ideas
      • Creating Ideas
        • Proof of Idea
        • Proof of Trade
        • Estimated Costs
        • Asset Price Check
      • Adjusting Idea
      • Closing Ideas
        • Proof of Idea
        • Proof of Trade
      • Share of Token
      • Miscellaneous
  • D2 Execution
    • Overview
Powered by GitBook
On this page
  1. SDK Reference
  2. Ideas
  3. Closing Ideas

Proof of Idea

Closes a Signal based Investment Idea within an Investment Strategy. This is the equivalent of closing a real position.

Strategy Reference

The long form reference returned when the idea was first created should be used.

Ticker

This must be the same, pimary ticker that was used to create the Investment Idea i.e. not an alternative ticker.

Alternative Tickers

It is not possible to change the alternative tickers from those that were passed in upon creation, therefore they can be be passed in at the point of closure.

Pricing

The same pricing provider should be used.

The credentials for the provider must be passed again as they are not persisted.

Close Idea Object

Create the object to be posted.


// Initialize the SDK
const activ = await getActiv();

// Build the Idea object
const payload: CI.ICloseIdeaRequest = {
	strategyReference: '',
	ticker: '',
	pricingCredentials: {
		provider: '',
		credentials: {
			key: '',
			secret: '',
		},
	},
}

Close Idea Request

A retry mechanism can be useful to ensure that the process completes successfully.


const data = await Helper.retryFunctionHelper<any>({
	maxRetries: 3,
	retryCallback: async () => {
		return activ.closeIdea(payload);
	},
	notificationCallback: async (error: string, retryIndex: number) => {

		log({
			message: `[closeActivTradeIdeaByTicker] Error closing Activ Idea (retry ${retryIndex}): ${error}`,
			type: 'error',
		});

	}
});

PreviousClosing IdeasNextProof of Trade

Last updated 1 year ago